When I run lsb_release
on Debian 8, following error is appeared:
No LSB modules are available.
Is there any missing file causes this problem?
When I run lsb_release
on Debian 8, following error is appeared:
No LSB modules are available.
Is there any missing file causes this problem?
I just moved to debian squeeze and need to change the startup sequence of some scripts. I used to do this with update-rc.d service defaulta xx xx
but now with the LSB way of doing things the update-rc.d
method does not change the order.
I need to start the packages in this order:
Any ideas?
I'm writing an lsb init script (admittedly something I've never done from scratch) that launches a php script that daemonizes itself. The php script starts off like so:
#!/usr/bin/env php
<?php
/* do some stuff */
It's then started like so in the init script:
# first line is args to start-stop-daemon, second line is args to php-script
start-stop-daemon --start --exec /path/to/executable/php-script.php \
-- --daemon --pid-file=$PIDFILE --other-php-script-args
The --daemon
flag causes the php script to detach & run as a daemon itself, rather than relying on start-stop-daemon
to detach it.
This is how it's (trying to) stop it in the init script:
start-stop-daemon --stop --oknodo --exec /path/to/executable/php-script.php \
--pidfile $PIDFILE
The problem is, when I try to stop via the init script, it gives me this:
$ sudo /etc/init.d/my-lsb-init-script stop
* Stopping My Project
No /path/to/executable/php-script.php found running; none killed.
...done.
A quick peek at ps
tells me that, even though the php script itself is executable, its running as php <script>
rather than the script name itself, which is keeping start-stop-daemon from seeing it. The PID file is even being generated, but it seems to ignore it and try to find+kill by process name instead.
$ ps ax | grep '/path/to/executable/php-script.php'
2505 pts/1 S 0:01 php /path/to/executable/php-script.php --daemon --pid-file /var/run/blah/blah.pid --other-php-script-args
2507 pts/1 S 0:00 php /path/to/executable/php-script.php --daemon --pid-file /var/run/blah/blah.pid --other-php-script-args
2508 pts/1 S 0:00 php /path/to/executable/php-script.php --daemon --pid-file /var/run/blah/blah.pid --other-php-script-args
2509 pts/1 S 0:00 php /path/to/executable/php-script.php --daemon --pid-file /var/run/blah/blah.pid --other-php-script-args
2518 pts/1 S 0:01 php /path/to/executable/php-script.php --daemon --pid-file /var/run/blah/blah.pid --other-php-script-args
$ cat /var/run/blah/blah.pid
2518
Am I completely misunderstanding something here? Or is there an easy way to work around this?
This is a migrated question from stackoverflow, as I was told, this is the place for it to be. https://stackoverflow.com/questions/2263567/how-to-conform-to-update-rc-d-with-lsb-standard
I have set up a simple script to back up some directories. While I haven't had any problems setting up the functionality, I'm stuck with adding the script to rcX.d dir's using update-rc.d
.
My script:
#! /bin/sh
### BEGIN INIT INFO
# Provides: backup
# Required-Start: backup
# Required-Stop:
# Should-Stop:
# Default-Start: 0 6
# Default-Stop:
# Description: Backs up some dirs
### END INIT INFO
check_mounted() {
# Check if HD is mounted
}
do_backup() {
if check_mounted; then
# Some rsync statements.
fi
}
case "$1" in
start)
do_backup
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop|"")
# No-op
;;
*)
echo "Usage: backup [start]" >&2
exit 3
;;
esac
:
Using update-rc.d backup start 10 0 6 .
I get the following warnings and errors:
update-rc.d: warning: backup start runlevel arguments (none) do not match LSB Default-Start values (0 6)
update-rc.d: warning: backup stop runlevel arguments (0 6.) do not match LSB Default-Stop values (none)
update-rc.d: error: start|stop arguments not terminated by "."
The syntax I try to use is the following:
update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
Google wasn't that helpful at finding a solution. How can I correctly set up a script and add it via update-rc.d?
I'm using Ubuntu 9.10.
UPDATE
Using update-rc.d backup start 10 0 6 . stop 10 0 .
the error disappears.
The warnings about default values persists:
update-rc.d: warning: backup start runlevel arguments (none) do not match LSB Default-Start values (0 6)
update-rc.d: warning: backup stop runlevel arguments (0 6 0 6) do not match LSB Default-Stop values (none)
It even is added to the appropiate rcX-dirs but it still does not get executed...