Patchwork systemd: set default.target to multi-user.target

login
register
mail settings
Submitter Radu Moisan
Date Jan. 24, 2013, 1:36 p.m.
Message ID <1359034562-31592-1-git-send-email-radu.moisan@intel.com>
Download mbox | patch
Permalink /patch/43293/
State New
Headers show

Comments

Radu Moisan - Jan. 24, 2013, 1:36 p.m.
this fixes a service dependency issue;
while graphical.target is the default mode, systemd
will try to start display-manager.service which is not
available.

Signed-off-by: Radu Moisan <radu.moisan@intel.com>
---
 .../systemd/set_default_target_to_multi-user.patch |   13 +++++++++++++
 meta/recipes-core/systemd/systemd_196.bb           |    1 +
 2 files changed, 14 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/set_default_target_to_multi-user.patch
Martin Jansa - Jan. 24, 2013, 1:48 p.m.
On Thu, Jan 24, 2013 at 03:36:02PM +0200, Radu Moisan wrote:
> this fixes a service dependency issue;
> while graphical.target is the default mode, systemd
> will try to start display-manager.service which is not
> available.

what about images with display-manager available?

meta-efl/recipes-efl/efl/entrance/entrance.service:Alias=display-manager.service
meta-gnome/recipes-gnome/gdm/gdm/gdm.service.in:Alias=display-manager.service
meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init/xserver-nodm.service:Alias=display-manager.service

?

Making this change in global PKG_ARCH recipe doesn't look correct (and
also missing Upstream-Status and SOB line).

Cheers,

> Signed-off-by: Radu Moisan <radu.moisan@intel.com>
> ---
>  .../systemd/set_default_target_to_multi-user.patch |   13 +++++++++++++
>  meta/recipes-core/systemd/systemd_196.bb           |    1 +
>  2 files changed, 14 insertions(+)
>  create mode 100644 meta/recipes-core/systemd/systemd/set_default_target_to_multi-user.patch
> 
> diff --git a/meta/recipes-core/systemd/systemd/set_default_target_to_multi-user.patch b/meta/recipes-core/systemd/systemd/set_default_target_to_multi-user.patch
> new file mode 100644
> index 0000000..d29471c
> --- /dev/null
> +++ b/meta/recipes-core/systemd/systemd/set_default_target_to_multi-user.patch
> @@ -0,0 +1,13 @@
> +Index: git/Makefile.am
> +===================================================================
> +--- git.orig/Makefile.am
> ++++ git/Makefile.am
> +@@ -3873,7 +3873,7 @@ systemd-install-data-hook:
> + 		$(LN_S) reboot.target runlevel6.target )
> + 	( cd $(DESTDIR)$(systemunitdir) && \
> + 		rm -f default.target ctrl-alt-del.target autovt@.service && \
> +-		$(LN_S) graphical.target default.target && \
> ++		$(LN_S) multi-user.target default.target && \
> + 		$(LN_S) reboot.target ctrl-alt-del.target && \
> + 		$(LN_S) getty@.service autovt@.service )
> + 	( cd $(DESTDIR)$(systemunitdir)/multi-user.target.wants && \
> diff --git a/meta/recipes-core/systemd/systemd_196.bb b/meta/recipes-core/systemd/systemd_196.bb
> index a78a8a6..c6798fc 100644
> --- a/meta/recipes-core/systemd/systemd_196.bb
> +++ b/meta/recipes-core/systemd/systemd_196.bb
> @@ -23,6 +23,7 @@ SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \
>             file://var-run.conf \
>             ${UCLIBCPATCHES} \
>             file://00-create-volatile.conf \
> +           file://set_default_target_to_multi-user.patch \
>            "
>  SRC_URI[md5sum] = "05ebd7f108e420e2b4e4810ea4b3c810"
>  SRC_URI[sha256sum] = "6bd4a658a5dd8198235b17ad1b1f0cc56d9e6f00d646ddcffdfc6f058b55e4bf"
> -- 
> 1.7.9.5
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Samuel Stirtzel - Jan. 24, 2013, 2:03 p.m.
2013/1/24 Radu Moisan <radu.moisan@intel.com>:
>
> On 01/24/2013 03:48 PM, Martin Jansa wrote:
>>
>> On Thu, Jan 24, 2013 at 03:36:02PM +0200, Radu Moisan wrote:
>>>
>>> this fixes a service dependency issue;
>>> while graphical.target is the default mode, systemd
>>> will try to start display-manager.service which is not
>>> available.
>>
>> what about images with display-manager available?
>>
>>
>> meta-efl/recipes-efl/efl/entrance/entrance.service:Alias=display-manager.service
>>
>> meta-gnome/recipes-gnome/gdm/gdm/gdm.service.in:Alias=display-manager.service
>>
>> meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init/xserver-nodm.service:Alias=display-manager.service
>>
>> ?
>>
>> Making this change in global PKG_ARCH recipe doesn't look correct (and
>> also missing Upstream-Status and SOB line).
>>
>> Cheers,
>>
> The problem goes both ways. If we leave it as it is, graphical.target as
> default, what about images that don't need a display manager, like
> core-image-minimal that is in particular the target, for the time being, for
> systemd integration.
>
> Radu

 ln -sf /lib/systemd/system/multi-user.target
/etc/systemd/system/default.target  ?




--
Regards
Samuel
Andreas Müller - Jan. 24, 2013, 2:05 p.m.
On Thu, Jan 24, 2013 at 2:48 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Thu, Jan 24, 2013 at 03:36:02PM +0200, Radu Moisan wrote:
>> this fixes a service dependency issue;
>> while graphical.target is the default mode, systemd
>> will try to start display-manager.service which is not
>> available.
>
> what about images with display-manager available?
>
> meta-efl/recipes-efl/efl/entrance/entrance.service:Alias=display-manager.service
> meta-gnome/recipes-gnome/gdm/gdm/gdm.service.in:Alias=display-manager.service
> meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init/xserver-nodm.service:Alias=display-manager.service
>
> ?
>
> Making this change in global PKG_ARCH recipe doesn't look correct (and
> also missing Upstream-Status and SOB line).
>
> Cheers,
>
>> Signed-off-by: Radu Moisan <radu.moisan@intel.com>
>> ---
>>  .../systemd/set_default_target_to_multi-user.patch |   13 +++++++++++++
>>  meta/recipes-core/systemd/systemd_196.bb           |    1 +
>>  2 files changed, 14 insertions(+)
>>  create mode 100644 meta/recipes-core/systemd/systemd/set_default_target_to_multi-user.patch
>>
>> diff --git a/meta/recipes-core/systemd/systemd/set_default_target_to_multi-user.patch b/meta/recipes-core/systemd/systemd/set_default_target_to_multi-user.patch
>> new file mode 100644
>> index 0000000..d29471c
>> --- /dev/null
>> +++ b/meta/recipes-core/systemd/systemd/set_default_target_to_multi-user.patch
>> @@ -0,0 +1,13 @@
>> +Index: git/Makefile.am
>> +===================================================================
>> +--- git.orig/Makefile.am
>> ++++ git/Makefile.am
>> +@@ -3873,7 +3873,7 @@ systemd-install-data-hook:
>> +             $(LN_S) reboot.target runlevel6.target )
>> +     ( cd $(DESTDIR)$(systemunitdir) && \
>> +             rm -f default.target ctrl-alt-del.target autovt@.service && \
>> +-            $(LN_S) graphical.target default.target && \
>> ++            $(LN_S) multi-user.target default.target && \
>> +             $(LN_S) reboot.target ctrl-alt-del.target && \
>> +             $(LN_S) getty@.service autovt@.service )
>> +     ( cd $(DESTDIR)$(systemunitdir)/multi-user.target.wants && \
>> diff --git a/meta/recipes-core/systemd/systemd_196.bb b/meta/recipes-core/systemd/systemd_196.bb
>> index a78a8a6..c6798fc 100644
>> --- a/meta/recipes-core/systemd/systemd_196.bb
>> +++ b/meta/recipes-core/systemd/systemd_196.bb
>> @@ -23,6 +23,7 @@ SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \
>>             file://var-run.conf \
>>             ${UCLIBCPATCHES} \
>>             file://00-create-volatile.conf \
>> +           file://set_default_target_to_multi-user.patch \
>>            "
>>  SRC_URI[md5sum] = "05ebd7f108e420e2b4e4810ea4b3c810"
>>  SRC_URI[sha256sum] = "6bd4a658a5dd8198235b17ad1b1f0cc56d9e6f00d646ddcffdfc6f058b55e4bf"
>> --
>> 1.7.9.5
>>
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
> --
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
>
As far as I can see we will exchange a systemd warning that
display-manager.service cannot be started by a not started
display-manager for those using one.

Andreas
Radu Moisan - Jan. 24, 2013, 2:05 p.m.
On 01/24/2013 03:48 PM, Martin Jansa wrote:
> On Thu, Jan 24, 2013 at 03:36:02PM +0200, Radu Moisan wrote:
>> this fixes a service dependency issue;
>> while graphical.target is the default mode, systemd
>> will try to start display-manager.service which is not
>> available.
> what about images with display-manager available?
>
> meta-efl/recipes-efl/efl/entrance/entrance.service:Alias=display-manager.service
> meta-gnome/recipes-gnome/gdm/gdm/gdm.service.in:Alias=display-manager.service
> meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init/xserver-nodm.service:Alias=display-manager.service
>
> ?
>
> Making this change in global PKG_ARCH recipe doesn't look correct (and
> also missing Upstream-Status and SOB line).
>
> Cheers,
>
The problem goes both ways. If we leave it as it is, graphical.target as 
default, what about images that don't need a display manager, like 
core-image-minimal that is in particular the target, for the time being, 
for systemd integration.

Radu
Samuel Stirtzel - Jan. 24, 2013, 2:05 p.m.
2013/1/24 Samuel Stirtzel <s.stirtzel@googlemail.com>:
> 2013/1/24 Radu Moisan <radu.moisan@intel.com>:
>>
>> On 01/24/2013 03:48 PM, Martin Jansa wrote:
>>>
>>> On Thu, Jan 24, 2013 at 03:36:02PM +0200, Radu Moisan wrote:
>>>>
>>>> this fixes a service dependency issue;
>>>> while graphical.target is the default mode, systemd
>>>> will try to start display-manager.service which is not
>>>> available.
>>>
>>> what about images with display-manager available?
>>>
>>>
>>> meta-efl/recipes-efl/efl/entrance/entrance.service:Alias=display-manager.service
>>>
>>> meta-gnome/recipes-gnome/gdm/gdm/gdm.service.in:Alias=display-manager.service
>>>
>>> meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init/xserver-nodm.service:Alias=display-manager.service
>>>
>>> ?
>>>
>>> Making this change in global PKG_ARCH recipe doesn't look correct (and
>>> also missing Upstream-Status and SOB line).
>>>
>>> Cheers,
>>>
>> The problem goes both ways. If we leave it as it is, graphical.target as
>> default, what about images that don't need a display manager, like
>> core-image-minimal that is in particular the target, for the time being, for
>> systemd integration.
>>
>> Radu
>
>  ln -sf /lib/systemd/system/multi-user.target
> /etc/systemd/system/default.target  ?
>
Send too soon / wrong button :/

you want to change the default do
 ln -sf /lib/systemd/system/multi-user.target
/etc/systemd/system/default.target  ?

why not do that with .bbappends?

I'd prefer "vanilla" over hacky workarounds


--
Regards
Samuel
Ross Burton - Jan. 24, 2013, 3:03 p.m.
Hi,

A fairly uncomplicated way would be to have a variable that defaults
to multi-user, but allow images to override it (e.g. all the X images
in oe-core would do this), and set the symlink at image creation time.

Ross
Andreas Müller - Jan. 24, 2013, 3:16 p.m.
On Thu, Jan 24, 2013 at 4:03 PM, Burton, Ross <ross.burton@intel.com> wrote:
> Hi,
>
> A fairly uncomplicated way would be to have a variable that defaults
> to multi-user, but allow images to override it (e.g. all the X images
> in oe-core would do this), and set the symlink at image creation time.
>
> Ross
>
So I would have to touch all my images to save GUI-less guys from
systemd warning? Hmm

Andreas
Ross Burton - Jan. 24, 2013, 3:20 p.m.
On 24 January 2013 15:16, Andreas Müller <schnitzeltony@googlemail.com> wrote:
> So I would have to touch all my images to save GUI-less guys from
> systemd warning? Hmm

It would default to a text console, so you'd need to modify your GUI
images.  There may be some common place we can override this globally
for anything with X.

Ross
Samuel Stirtzel - Jan. 24, 2013, 3:30 p.m.
2013/1/24 Burton, Ross <ross.burton@intel.com>:
> On 24 January 2013 15:16, Andreas Müller <schnitzeltony@googlemail.com> wrote:
>> So I would have to touch all my images to save GUI-less guys from
>> systemd warning? Hmm
>
> It would default to a text console, so you'd need to modify your GUI
> images.  There may be some common place we can override this globally
> for anything with X.
>

The developer of systemd made this the default just so we can change it?

There is no reasoning why to change the _default_ so that others have
to change their image rather than you have to change yours.


--
Regards
Samuel
Ross Burton - Jan. 24, 2013, 3:37 p.m.
On 24 January 2013 15:30, Samuel Stirtzel <s.stirtzel@googlemail.com> wrote:
> There is no reasoning why to change the _default_ so that others have
> to change their image rather than you have to change yours.

core-image-minimal needs to boot to multi-user.  core-image-sato needs
to boot to graphical.  This isn't a "we'll make this change, screw
you" situation, oe-core itself needs to be able to select the default
target, and I'm not terribly happy with a warning on every boot that
doesn't happen to involve a display manager.

Ross
Martin Jansa - Jan. 24, 2013, 3:43 p.m.
On Thu, Jan 24, 2013 at 03:37:09PM +0000, Burton, Ross wrote:
> On 24 January 2013 15:30, Samuel Stirtzel <s.stirtzel@googlemail.com> wrote:
> > There is no reasoning why to change the _default_ so that others have
> > to change their image rather than you have to change yours.
> 
> core-image-minimal needs to boot to multi-user.  core-image-sato needs
> to boot to graphical.  This isn't a "we'll make this change, screw
> you" situation

I think the point is, keep default default.target for images where it's
OK (gui or warning) and change default.target to something else only for
images where it matters (nogui if you care about warning).

Changing default value by patch in systemd recipe and then setting
default value back in many image recipes doesn't look sane.

> oe-core itself needs to be able to select the default
> target, and I'm not terribly happy with a warning on every boot that
> doesn't happen to involve a display manager.

Yes there needs to be easy way for image to say default target, just
don't change default value in systemd source.

Cheers,
Ross Burton - Jan. 24, 2013, 3:48 p.m.
On 24 January 2013 15:43, Martin Jansa <martin.jansa@gmail.com> wrote:
> I think the point is, keep default default.target for images where it's
> OK (gui or warning) and change default.target to something else only for
> images where it matters (nogui if you care about warning).
>
> Changing default value by patch in systemd recipe and then setting
> default value back in many image recipes doesn't look sane.

Sure, so we make the default graphical, and there's no change as far
as the final image is concerned.

Ross
Radu Moisan - Jan. 25, 2013, 10:11 a.m.
On 01/24/2013 05:48 PM, Burton, Ross wrote:
> On 24 January 2013 15:43, Martin Jansa <martin.jansa@gmail.com> wrote:
>> I think the point is, keep default default.target for images where it's
>> OK (gui or warning) and change default.target to something else only for
>> images where it matters (nogui if you care about warning).
>>
>> Changing default value by patch in systemd recipe and then setting
>> default value back in many image recipes doesn't look sane.
> Sure, so we make the default graphical, and there's no change as far
> as the final image is concerned.

Thanks guys for your feedback, dropping this and looking for another 
approach.

Radu

Patch

diff --git a/meta/recipes-core/systemd/systemd/set_default_target_to_multi-user.patch b/meta/recipes-core/systemd/systemd/set_default_target_to_multi-user.patch
new file mode 100644
index 0000000..d29471c
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/set_default_target_to_multi-user.patch
@@ -0,0 +1,13 @@ 
+Index: git/Makefile.am
+===================================================================
+--- git.orig/Makefile.am
++++ git/Makefile.am
+@@ -3873,7 +3873,7 @@ systemd-install-data-hook:
+ 		$(LN_S) reboot.target runlevel6.target )
+ 	( cd $(DESTDIR)$(systemunitdir) && \
+ 		rm -f default.target ctrl-alt-del.target autovt@.service && \
+-		$(LN_S) graphical.target default.target && \
++		$(LN_S) multi-user.target default.target && \
+ 		$(LN_S) reboot.target ctrl-alt-del.target && \
+ 		$(LN_S) getty@.service autovt@.service )
+ 	( cd $(DESTDIR)$(systemunitdir)/multi-user.target.wants && \
diff --git a/meta/recipes-core/systemd/systemd_196.bb b/meta/recipes-core/systemd/systemd_196.bb
index a78a8a6..c6798fc 100644
--- a/meta/recipes-core/systemd/systemd_196.bb
+++ b/meta/recipes-core/systemd/systemd_196.bb
@@ -23,6 +23,7 @@  SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \
            file://var-run.conf \
            ${UCLIBCPATCHES} \
            file://00-create-volatile.conf \
+           file://set_default_target_to_multi-user.patch \
           "
 SRC_URI[md5sum] = "05ebd7f108e420e2b4e4810ea4b3c810"
 SRC_URI[sha256sum] = "6bd4a658a5dd8198235b17ad1b1f0cc56d9e6f00d646ddcffdfc6f058b55e4bf"