Re: [PATCH v2] systemd: set default.target to multi-user.target

Martin Jansa
2013-01-25T19:50:38Z

[-- Attachment #1: Type: text/plain, Size: 1961 bytes --]

On Fri, Jan 25, 2013 at 07:35:51PM +0100, Andreas Müller wrote:
> On Fri, Jan 25, 2013 at 7:06 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
> > On Fri, Jan 25, 2013 at 06:53:54PM +0100, Andreas Müller wrote:
> >> On Fri, Jan 25, 2013 at 6:50 PM, Burton, Ross <ross.burton@intel.com> wrote:
> >> > Hi,
> >> >
> >> > Been chatting to Richard. How about systemd ships a symlink to
> >> > multi-user, and the X11 init script packages change the symlink to
> >> > graphical in their postinst.
> >> >
> >> > (we must remember to put this in the release notes for anyone who has
> >> > a custom X init script)
> >> >
> >> > Ross
> >> >
> >> Have not yet tested but how about:
> >>
> >> pkg_postinst_systemd () {
> >> if [ -n "$D" ]; then
> >> # no display-manager.service around?
> >> if [ ! -e ${D}${systemd_unitdir}/systemd/system/display-manager.service -a \
> >
> > I think you wanted $D ^ here.
> Yes there are more of this but before cleaning up & run into tests:
> Would this find friends?
>
> > Cannot we just just u-a for default.target ? And each possible target
> > providing own u-a alternative (DMs with higher prio then systemd)?
> Sorry but I don't understand this

Something like:

systemd:
inherit update-alternatives
ALTERNATIVE_${PN} = "systemd-def-target"
ALTERNATIVE_TARGET[systemd-def-target] = "${systemd_unitdir}/system/multi-user.target"
ALTERNATIVE_LINK_NAME[systemd-def-target] = "${systemd_unitdir}/systemd/system/default.target"
ALTERNATIVE_PRIORITY[systemd-def-target] ?= "1"

xserver-nodm-init and DMs:
inherit update-alternatives
ALTERNATIVE_${PN} = "systemd-def-target"
ALTERNATIVE_TARGET[systemd-def-target] = "${systemd_unitdir}/system/graphical.target"
ALTERNATIVE_LINK_NAME[systemd-def-target] = "${systemd_unitdir}/systemd/system/default.target"
ALTERNATIVE_PRIORITY[systemd-def-target] ?= "10"

Cheers,
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]