[PATCH 2/2] start-stop-daemon - find processes better
Denys Vlasenko
vda.linux at googlemail.com
Thu May 1 00:53:44 PDT 2008
Hi,
Hereby I am informing all interested parties that
I am totally confused now.
I am not using ssd and I need your help
in making a decent documentation how it work
(or supposed to)
> > > But the intent of start-stop-daemon is to start and stop daemons.
> > > s-s-d --stop --exec /usr/sbin/ntpd
> > > I would that expect it to stop the currently running ntpd process
> > > regardless of if the binary itself still exists or not.
> >
> > Don't think so, this is what --name is for. At least I think so.
>
> --name is for checking the process name, or argv[0], which is different from
> how the daemon is started.
> > > you stopping udhcpd or all instances of busybox daemons?
> >
> > You won't stop anything with your solution because /proc/xxx/exe
> > contains the real file name. So
> > s-s-d --stop --exec /bin/mysymlinkeddaemon
> > will not match.
>
> Good point.
> New patch attached which just checks cmdline instead of doing exe then
> cmdline.
> Also you should consider the case of scripts. If /usr/bin/foo is a python
> script, and was started like
> start-stop-daemon --start --exec /usr/bin/foo
> then you could reasonably expect
> start-stop-daemon --stop --exec /usr/bin/foo
> to work. However it won't because the exe inode points at python and not the
> script.
Let's see what help says, and whether it matches reality
(I deleted some obvious options):
# start-stop-daemon --help
Usage: start-stop-daemon [OPTIONS] [--start|--stop] ... [-- arguments...]
Start and stop services
Options:
-S,--start Start
-K,--stop Stop
-a,--startas pathname Start process specified by pathname
WRONG? it seems to just set argv[0].
It's not a pathname, it's just a "name" (arbitrary)
-u,--user username|uid Stop this user's processes
Clarification? Will e.g. "ssd -K -u roy" stop
all roy's processes?
-x,--exec executable Program to either start or check
Waht does it mean "check"? "stop"?
How executable is searched for for "stop" case?
-n,--name process-name Stop processes with this name
Is it equivalent to "killall name"?
If not, what's the difference?
-p,--pidfile pid-file Save or load pid using a pid-file
-m,--make-pidfile Create the -p file and enter pid in it
?? How "save" is different from "create and enter pid in it"?
Please help by proposing your own help text which is
unambiguous. Be as verbose as needed.
--
vda
More information about the busybox
mailing list