Patchwork [2/2] systemd: set default.target to multi-user.target

login
register
mail settings
Submitter Radu Moisan
Date April 9, 2013, 2:02 p.m.
Message ID <1365516144-5157-3-git-send-email-radu.moisan@intel.com>
Download mbox | patch
Permalink /patch/47699/
State New
Headers show

Comments

Radu Moisan - April 9, 2013, 2:02 p.m.
This fixes a service dependency issue;
When graphical.target is the default mode, systemd
will try to start display-manager.service which is not
available on some targets.

For xserver-nodm-init we would then have something like:
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}/system/default.target"
ALTERNATIVE_PRIORITY[systemd-def-target] ?= "10"

Fixes [Yocto #3816]

Signed-off-by: Radu Moisan <radu.moisan@intel.com>
---
 meta/recipes-core/systemd/systemd_199.bb |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Ross Burton - April 9, 2013, 2:58 p.m.
On 9 April 2013 15:02, Radu Moisan <radu.moisan@intel.com> wrote:
> This fixes a service dependency issue;
> When graphical.target is the default mode, systemd
> will try to start display-manager.service which is not
> available on some targets.
>
> For xserver-nodm-init we would then have something like:
> 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}/system/default.target"
> ALTERNATIVE_PRIORITY[systemd-def-target] ?= "10"

If we're going to make this change we also need to fix
xserver-nodm-init at the same time otherwise we break graphical boots
in oe-core.

Ross
Radu Moisan - April 9, 2013, 3:03 p.m.
On 04/09/2013 05:58 PM, Burton, Ross wrote:
> On 9 April 2013 15:02, Radu Moisan <radu.moisan@intel.com> wrote:
>> This fixes a service dependency issue;
>> When graphical.target is the default mode, systemd
>> will try to start display-manager.service which is not
>> available on some targets.
>>
>> For xserver-nodm-init we would then have something like:
>> 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}/system/default.target"
>> ALTERNATIVE_PRIORITY[systemd-def-target] ?= "10"
> If we're going to make this change we also need to fix
> xserver-nodm-init at the same time otherwise we break graphical boots
> in oe-core.

I have a patch waiting for this for a while. I'll rebase and send if you 
want it.

Radu
Radu Moisan - April 9, 2013, 3:11 p.m.
On 04/09/2013 06:03 PM, Radu Moisan wrote:
>
> On 04/09/2013 05:58 PM, Burton, Ross wrote:
>> On 9 April 2013 15:02, Radu Moisan <radu.moisan@intel.com> wrote:
>>> This fixes a service dependency issue;
>>> When graphical.target is the default mode, systemd
>>> will try to start display-manager.service which is not
>>> available on some targets.
>>>
>>> For xserver-nodm-init we would then have something like:
>>> 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}/system/default.target"
>>> ALTERNATIVE_PRIORITY[systemd-def-target] ?= "10"
>> If we're going to make this change we also need to fix
>> xserver-nodm-init at the same time otherwise we break graphical boots
>> in oe-core.
>
> I have a patch waiting for this for a while. I'll rebase and send if 
> you want it.
>

dropping this for now.

Radu

Patch

diff --git a/meta/recipes-core/systemd/systemd_199.bb b/meta/recipes-core/systemd/systemd_199.bb
index 354e557..bd5881b 100644
--- a/meta/recipes-core/systemd/systemd_199.bb
+++ b/meta/recipes-core/systemd/systemd_199.bb
@@ -251,7 +251,7 @@  python __anonymous() {
 # TODO:
 # u-a for runlevel and telinit
 
-ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff"
+ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff systemd-def-target"
 
 ALTERNATIVE_TARGET[init] = "${systemd_unitdir}/systemd"
 ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
@@ -273,6 +273,10 @@  ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
 ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
 ALTERNATIVE_PRIORITY[poweroff] ?= "300"
 
+ALTERNATIVE_TARGET[systemd-def-target] = "${systemd_unitdir}/system/multi-user.target"
+ALTERNATIVE_LINK_NAME[systemd-def-target] = "${systemd_unitdir}/system/default.target"
+ALTERNATIVE_PRIORITY[systemd-def-target] ?= "1"
+
 pkg_postinst_udev-hwdb () {
 	if test -n "$D"; then
 		exit 1