Package: insserv
Version: 1.09.0-1
Severity: important
User:     [EMAIL PROTECTED]
Usertags: incorrect-dependency

When activating insserv, it will add stop symlinks for scripts that
are currently not enabled for a runlevel that is listed in
default-stop.  This make the shutdown sequence incorrect for scripts
with incorrect default-stop header.

Here is a testsuite fragment to demonstrate the problem:

##########################################################################
echo
echo "info: Check if insserv add stop symlinks for scripts that"
echo "info: currently do not have them."
echo

rm -rf $initddir/../rc*.d/*
rm -rf $initddir/*
mkdir -p $initddir

addscript script <<'EOF' || true
### BEGIN INIT INFO
# Provides:          script
# Required-Start:
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO
EOF

addscript nostopscript <<'EOF' || true
### BEGIN INIT INFO
# Provides:          nostopscript
# Required-Start:
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:
### END INIT INFO
EOF

# Problem is only triggered if there are start or stop symlinks for
# the script present.
for name in script nostopscript ; do
    for runlevel in 2 3 4 5 ; do
        mkdir -p $initddir/../rc$runlevel.d
        ln -s ../init.d/script $initddir/../rc$runlevel.d/S02$name
    done
done

check_script_present 2 script
check_script_present 5 script
check_script_not_present S script
check_script_not_present 1 script
check_script_not_present 1 nostopscript

# Update symlinks, see if it add stop symlinks
insserv_reg .

list_rclinks

check_script_present 2 script
check_script_present 5 script
check_script_not_present S script
check_script_not_present 1 script
check_script_not_present 1 nostopscript

##########################################################################

This is the output when the script is executed:

  info: Check if insserv add stop symlinks for scripts that
  info: currently do not have them.

  insserv.conf

  init.d:
  nostopscript  script

  insserv:
  override

  rc0.d:
  K01script

  rc1.d:
  K01script

  rc2.d:
  S01script  S02nostopscript

  rc3.d:
  S01script  S02nostopscript

  rc4.d:
  S01script  S02nostopscript

  rc5.d:
  S01script  S02nostopscript

  rc6.d:
  K01script

  rcS.d:
  error: script script present in runlevel 1

Happy hacking,
-- 
Petter Reinholdtsen



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to