Bug#1859: Start/stop scripts do not work when not invoked by init
Package: sysvinit
Version: 2.57b-1
I want to use the scripts in /etc/init.d to manually start/stop daemons,
e.g. do a "xdm stop", then change the config, and finally "xdm start". I
noticed that "xdm start/stop" does not work, when called manually. This
is because it (and many other scripts) include /etc/init.d/functions,
which destroys $1 (start/stop), if $RUNLEVEL is not set (which it is not,
if I call the script by hand).
I think "functions" should restore the arguments. The following patch
makes works for me:
--- functions.hsorig Sat Nov 4 21:12:25 1995
+++ functions Sun Nov 12 23:16:49 1995
@@ -15,12 +15,14 @@
# Set RUNLEVEL and PREVLEVEL
if [ "$RUNLEVEL" = "" ]
then
+ args="$*"
levels=`runlevel`
if [ $? = 0 ]
then
- eval set $levels
+ set $levels
PREVLEVEL=$1
RUNLEVEL=$2
+ set $args
fi
fi
Harald Schueler
Universitaet Essen Tel +49-201-1832456
Fachbereich 7 Fax +49-201-1832120
45117 Essen Email hs@ILP.Physik.Uni-Essen.DE
Reply to: