Discussion:
Insserv overrides
(too old to reply)
Sylvain
2012-02-03 06:30:02 UTC
Permalink
Hello,

I have a setup in which the slim display manager logs in automatically
and then starts a program (thanks to the .xinitrc file). This program
needs dbus to work correctly and at the moment it crashes every time
it's launched because dbus is not yet started (slim starts in runlevel 3).

I was told about using insserv overrides but I can't find any good
documentation on this, even the manpage is quite vague about the format
the override file should have. So I put this in a
#!/bin/sh
### BEGIN INIT INFO
# Provides: slim
# Required-Start: $local_fs $remote_fs dbus
# Required-Stop: $local_fs $remote_fs
# Should-Start: xfs $named slapd
# Should-Stop: xfs $named slapd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop the SLiM daemon.
### END INIT INFO
I'm not sure if I should repeat the whole LSB headers or only the one I
want to change (in this case Required-Start). In all cases, this doesn't
work since dbus is still not started when the program that depends on it
starts. Am I missing something? Should I run an insserv command to take
the override file into account? How can I check that the override file
is used?

Thanks,
Sylvain
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@gmail.com
Darac Marjal
2012-02-03 11:20:02 UTC
Permalink
Post by Sylvain
Hello,
I have a setup in which the slim display manager logs in
automatically and then starts a program (thanks to the .xinitrc
file). This program needs dbus to work correctly and at the moment
it crashes every time it's launched because dbus is not yet started
(slim starts in runlevel 3).
I was told about using insserv overrides but I can't find any good
documentation on this, even the manpage is quite vague about the
format the override file should have. So I put this in a
First of all, check that the name of this file is correct. Insserv will
look for an override based on the name of the file it runs, not based on
any links thereto. (This caught me out once. A third party program
installed its own init scripts and made a symlink in /etc/init.d/ with a
different name). This shouldn't be a problem for slim, though.
Post by Sylvain
#!/bin/sh
### BEGIN INIT INFO
# Provides: slim
# Required-Start: $local_fs $remote_fs dbus
# Required-Stop: $local_fs $remote_fs
# Should-Start: xfs $named slapd
# Should-Stop: xfs $named slapd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop the SLiM daemon.
### END INIT INFO
I'm not sure if I should repeat the whole LSB headers or only the
one I want to change (in this case Required-Start). In all cases,
this doesn't work since dbus is still not started when the program
that depends on it starts. Am I missing something? Should I run an
insserv command to take the override file into account? How can I
check that the override file is used?
I'm not sure that the shebang (#!/bin/sh) is needed; try removing the
first two lines of the script.

Next, run:

# insserv -v -n -d 2>&1|$PAGER

and look for lines such as:

insserv: Loading /etc/insserv/overrides/slim

After many "Loading lines", you'll either get no more information (your
initscripts are ordered as per the header comments) or a series of
"remove service"/"enable service" lines which tell you what insserv
wants to do to re-order your scripts. If you're happy with what it wants
to do, re-run the insserv command without "-n".
--
Darac Marjal
Sylvain
2012-02-08 19:30:02 UTC
Permalink
Post by Darac Marjal
Post by Sylvain
Hello,
I have a setup in which the slim display manager logs in
automatically and then starts a program (thanks to the .xinitrc
file). This program needs dbus to work correctly and at the moment
it crashes every time it's launched because dbus is not yet started
(slim starts in runlevel 3).
I was told about using insserv overrides but I can't find any good
documentation on this, even the manpage is quite vague about the
format the override file should have. So I put this in a
First of all, check that the name of this file is correct. Insserv will
look for an override based on the name of the file it runs, not based on
any links thereto. (This caught me out once. A third party program
installed its own init scripts and made a symlink in /etc/init.d/ with a
different name). This shouldn't be a problem for slim, though.
Post by Sylvain
#!/bin/sh
### BEGIN INIT INFO
# Provides: slim
# Required-Start: $local_fs $remote_fs dbus
# Required-Stop: $local_fs $remote_fs
# Should-Start: xfs $named slapd
# Should-Stop: xfs $named slapd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop the SLiM daemon.
### END INIT INFO
I'm not sure if I should repeat the whole LSB headers or only the
one I want to change (in this case Required-Start). In all cases,
this doesn't work since dbus is still not started when the program
that depends on it starts. Am I missing something? Should I run an
insserv command to take the override file into account? How can I
check that the override file is used?
I'm not sure that the shebang (#!/bin/sh) is needed; try removing the
first two lines of the script.
# insserv -v -n -d 2>&1|$PAGER
insserv: Loading /etc/insserv/overrides/slim
After many "Loading lines", you'll either get no more information (your
initscripts are ordered as per the header comments) or a series of
"remove service"/"enable service" lines which tell you what insserv
wants to do to re-order your scripts. If you're happy with what it wants
to do, re-run the insserv command without "-n".
Thanks, that worked! I looked in /etc/rc2.d/ to check and noticed that
slim is now after dbus.

Cheers,
Sylvain
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@gmail.com
Loading...