Here's a simpler test case which shows the pre-stop script not being run.
# status foo foo stop/waiting # cat /etc/init/foo.conf description "Foo"
pre-start script touch /run/foo end script
pre-stop script rm -f /run/foo end script # ls -l /run/foo ls: cannot access /run/foo: No such file or directory # start foo foo start/running # ls -l /run/foo -rw-r--r-- 1 root root 0 2012-02-16 22:08 /run/foo # stop foo foo stop/waiting # ls -l /run/foo -rw-r--r-- 1 root root 0 2012-02-16 22:08 /run/foo
(The file /run/foo should have been deleted but wasn't.)
Here's a simpler test case which shows the pre-stop script not being run.
# status foo
foo stop/waiting
# cat /etc/init/foo.conf
description "Foo"
pre-start script
touch /run/foo
end script
pre-stop script
rm -f /run/foo
end script
# ls -l /run/foo
ls: cannot access /run/foo: No such file or directory
# start foo
foo start/running
# ls -l /run/foo
-rw-r--r-- 1 root root 0 2012-02-16 22:08 /run/foo
# stop foo
foo stop/waiting
# ls -l /run/foo
-rw-r--r-- 1 root root 0 2012-02-16 22:08 /run/foo
(The file /run/foo should have been deleted but wasn't.)