Patchwork [1/2] systemd: set INHIBIT_UPDATERCD_BBCLASS without sysvinit in features

login
register
mail settings
Submitter Martin Jansa
Date April 4, 2013, 4:42 p.m.
Message ID <1365093733-31674-1-git-send-email-Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/47423/
State Accepted
Commit b1dca3a693bb439181a155c5248a2c6a900f729d
Headers show

Comments

Martin Jansa - April 4, 2013, 4:42 p.m.
* fixes udev configure in run-postinsts failing with:
  update-rc.d: /etc/init.d/systemd-udev: file does not exist
  because systemd-udev is installed only with sysvinit in features
  but update-rc.d was always called from PN postinst

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/recipes-core/systemd/systemd_199.bb | 6 ++++++
 1 file changed, 6 insertions(+)
Richard Purdie - April 4, 2013, 4:46 p.m.
On Thu, 2013-04-04 at 18:42 +0200, Martin Jansa wrote:
> * fixes udev configure in run-postinsts failing with:
>   update-rc.d: /etc/init.d/systemd-udev: file does not exist
>   because systemd-udev is installed only with sysvinit in features
>   but update-rc.d was always called from PN postinst
> 
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  meta/recipes-core/systemd/systemd_199.bb | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/meta/recipes-core/systemd/systemd_199.bb b/meta/recipes-core/systemd/systemd_199.bb
> index ba1d133..e574548 100644
> --- a/meta/recipes-core/systemd/systemd_199.bb
> +++ b/meta/recipes-core/systemd/systemd_199.bb
> @@ -239,6 +239,12 @@ INITSCRIPT_PACKAGES = "udev"
>  INITSCRIPT_NAME_udev = "systemd-udevd"
>  INITSCRIPT_PARAMS_udev = "start 03 S ."
>  
> +python __anonymous() {
> +    features = d.getVar("DISTRO_FEATURES", True).split()
> +    if "sysvinit" not in features:
> +        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
> +}
> +
>  # TODO:
>  # u-a for runlevel and telinit

Would this make sense to be in systemd.bbclass?

Cheers,

Richard
Martin Jansa - April 4, 2013, 4:55 p.m.
On Thu, Apr 04, 2013 at 05:46:48PM +0100, Richard Purdie wrote:
> On Thu, 2013-04-04 at 18:42 +0200, Martin Jansa wrote:
> > * fixes udev configure in run-postinsts failing with:
> >   update-rc.d: /etc/init.d/systemd-udev: file does not exist
> >   because systemd-udev is installed only with sysvinit in features
> >   but update-rc.d was always called from PN postinst
> > 
> > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > ---
> >  meta/recipes-core/systemd/systemd_199.bb | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/meta/recipes-core/systemd/systemd_199.bb b/meta/recipes-core/systemd/systemd_199.bb
> > index ba1d133..e574548 100644
> > --- a/meta/recipes-core/systemd/systemd_199.bb
> > +++ b/meta/recipes-core/systemd/systemd_199.bb
> > @@ -239,6 +239,12 @@ INITSCRIPT_PACKAGES = "udev"
> >  INITSCRIPT_NAME_udev = "systemd-udevd"
> >  INITSCRIPT_PARAMS_udev = "start 03 S ."
> >  
> > +python __anonymous() {
> > +    features = d.getVar("DISTRO_FEATURES", True).split()
> > +    if "sysvinit" not in features:
> > +        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
> > +}
> > +
> >  # TODO:
> >  # u-a for runlevel and telinit
> 
> Would this make sense to be in systemd.bbclass?

Similar logic is in systemd.bbclass already, but systemd is not inherited from
systemd and dbus recipes.

Also the version from systemd.bbclass does check also for systemd in
DISTRO_FEATURES, but that's not wanted here, because decision to install init.d
script is based only on sysvinit in DISTRO_FEATURES.

Lot's of fun with all init systems sharing the same PN :/.
Richard Purdie - April 4, 2013, 10:38 p.m.
On Thu, 2013-04-04 at 18:55 +0200, Martin Jansa wrote:
> On Thu, Apr 04, 2013 at 05:46:48PM +0100, Richard Purdie wrote:
> > On Thu, 2013-04-04 at 18:42 +0200, Martin Jansa wrote:
> > > * fixes udev configure in run-postinsts failing with:
> > >   update-rc.d: /etc/init.d/systemd-udev: file does not exist
> > >   because systemd-udev is installed only with sysvinit in features
> > >   but update-rc.d was always called from PN postinst
> > > 
> > > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > > ---
> > >  meta/recipes-core/systemd/systemd_199.bb | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > > 
> > > diff --git a/meta/recipes-core/systemd/systemd_199.bb b/meta/recipes-core/systemd/systemd_199.bb
> > > index ba1d133..e574548 100644
> > > --- a/meta/recipes-core/systemd/systemd_199.bb
> > > +++ b/meta/recipes-core/systemd/systemd_199.bb
> > > @@ -239,6 +239,12 @@ INITSCRIPT_PACKAGES = "udev"
> > >  INITSCRIPT_NAME_udev = "systemd-udevd"
> > >  INITSCRIPT_PARAMS_udev = "start 03 S ."
> > >  
> > > +python __anonymous() {
> > > +    features = d.getVar("DISTRO_FEATURES", True).split()
> > > +    if "sysvinit" not in features:
> > > +        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
> > > +}
> > > +
> > >  # TODO:
> > >  # u-a for runlevel and telinit
> > 
> > Would this make sense to be in systemd.bbclass?
> 
> Similar logic is in systemd.bbclass already, but systemd is not inherited from
> systemd and dbus recipes.

Ok, fair enough. I hadn't realised that.

> Also the version from systemd.bbclass does check also for systemd in
> DISTRO_FEATURES, but that's not wanted here, because decision to install init.d
> script is based only on sysvinit in DISTRO_FEATURES.
> 
> Lot's of fun with all init systems sharing the same PN :/.

:/.

Cheers,

Richard
Martin Jansa - April 8, 2013, 7:03 p.m.
On Thu, Apr 04, 2013 at 11:38:41PM +0100, Richard Purdie wrote:
> On Thu, 2013-04-04 at 18:55 +0200, Martin Jansa wrote:
> > On Thu, Apr 04, 2013 at 05:46:48PM +0100, Richard Purdie wrote:
> > > On Thu, 2013-04-04 at 18:42 +0200, Martin Jansa wrote:
> > > > * fixes udev configure in run-postinsts failing with:
> > > >   update-rc.d: /etc/init.d/systemd-udev: file does not exist
> > > >   because systemd-udev is installed only with sysvinit in features
> > > >   but update-rc.d was always called from PN postinst
> > > > 
> > > > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > > > ---
> > > >  meta/recipes-core/systemd/systemd_199.bb | 6 ++++++
> > > >  1 file changed, 6 insertions(+)
> > > > 
> > > > diff --git a/meta/recipes-core/systemd/systemd_199.bb b/meta/recipes-core/systemd/systemd_199.bb
> > > > index ba1d133..e574548 100644
> > > > --- a/meta/recipes-core/systemd/systemd_199.bb
> > > > +++ b/meta/recipes-core/systemd/systemd_199.bb
> > > > @@ -239,6 +239,12 @@ INITSCRIPT_PACKAGES = "udev"
> > > >  INITSCRIPT_NAME_udev = "systemd-udevd"
> > > >  INITSCRIPT_PARAMS_udev = "start 03 S ."
> > > >  
> > > > +python __anonymous() {
> > > > +    features = d.getVar("DISTRO_FEATURES", True).split()
> > > > +    if "sysvinit" not in features:
> > > > +        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
> > > > +}
> > > > +
> > > >  # TODO:
> > > >  # u-a for runlevel and telinit
> > > 
> > > Would this make sense to be in systemd.bbclass?
> > 
> > Similar logic is in systemd.bbclass already, but systemd is not inherited from
> > systemd and dbus recipes.
> 
> Ok, fair enough. I hadn't realised that.
> 
> > Also the version from systemd.bbclass does check also for systemd in
> > DISTRO_FEATURES, but that's not wanted here, because decision to install init.d
> > script is based only on sysvinit in DISTRO_FEATURES.
> > 
> > Lot's of fun with all init systems sharing the same PN :/.

There is also error from prerm :/

//var/lib/opkg/info/dbus-1.prerm: line 3: /etc/init.d/dbus-1: No such file or directory

updatercd_prerm() {
if test "x$D" = "x"; then
        ${INIT_D_DIR}/${INITSCRIPT_NAME} stop
fi
}

not sure if testing update-rc.d existence like in postinst/postrm 
if type update-rc.d >/dev/null 2>/dev/null; then
is right way, checking ${INIT_D_DIR}/${INITSCRIPT_NAME}
existence will possibly hide some real issues...

sigh
Ross Burton - April 16, 2013, 3:11 p.m.
Hi Martin,

On 8 April 2013 20:03, Martin Jansa <martin.jansa@gmail.com> wrote:
> There is also error from prerm :/
>
> //var/lib/opkg/info/dbus-1.prerm: line 3: /etc/init.d/dbus-1: No such file or directory
>
> updatercd_prerm() {
> if test "x$D" = "x"; then
>         ${INIT_D_DIR}/${INITSCRIPT_NAME} stop
> fi
> }
>
> not sure if testing update-rc.d existence like in postinst/postrm
> if type update-rc.d >/dev/null 2>/dev/null; then
> is right way, checking ${INIT_D_DIR}/${INITSCRIPT_NAME}
> existence will possibly hide some real issues...

This fragment doesn't exist with your explicit inhibit update-rc.d
patch, so this is effectively resolved.

Ross

Patch

diff --git a/meta/recipes-core/systemd/systemd_199.bb b/meta/recipes-core/systemd/systemd_199.bb
index ba1d133..e574548 100644
--- a/meta/recipes-core/systemd/systemd_199.bb
+++ b/meta/recipes-core/systemd/systemd_199.bb
@@ -239,6 +239,12 @@  INITSCRIPT_PACKAGES = "udev"
 INITSCRIPT_NAME_udev = "systemd-udevd"
 INITSCRIPT_PARAMS_udev = "start 03 S ."
 
+python __anonymous() {
+    features = d.getVar("DISTRO_FEATURES", True).split()
+    if "sysvinit" not in features:
+        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
 # TODO:
 # u-a for runlevel and telinit