]> code.ossystems Code Review - openembedded-core.git/commitdiff
systemd: make runlevel work in non-runlevel targets
authorChen Qi <Qi.Chen@windriver.com>
Wed, 3 Sep 2014 07:09:00 +0000 (15:09 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 3 Sep 2014 09:24:20 +0000 (10:24 +0100)
Previously, after booting into the targets like multi-user.target or
graphical.target, the output of `runlevel' command is 'unknown'.

This is confusing for users. Normally, we would expect mutli-user.target
would have a `runlevel' output of 'N 3'.
This is the behaviour of Fedora20.

This patch installs symlinks for systemd-update-utmp-runlevel.service
in do_install task to fix the above problem.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/systemd/systemd_216.bb

index f88a9a9e90206bda6295c78db708cfbee1c515a3..28456dd32511e5ba4b5098133af1c07fdd3e272f 100644 (file)
@@ -130,6 +130,18 @@ do_install() {
 
         # Delete journal README, as log can be symlinked inside volatile.
         rm -f ${D}/${localstatedir}/log/README
+
+       # Create symlinks for systemd-update-utmp-runlevel.service
+       install -d ${D}${systemd_unitdir}/system/graphical.target.wants
+       install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
+       install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
+       install -d ${D}${systemd_unitdir}/system/reboot.target.wants
+       install -d ${D}${systemd_unitdir}/system/rescue.target.wants
+       ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
+       ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
+       ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
+       ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
+       ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
 }
 
 do_install_ptest () {