El Sábado, 12 de Diciembre de 2009, David Masover escribió: > > So I cannot use "start-stop-daemon --stop --name rb_program" because it > > would find no process names "rb_program" > > This is probably not a good idea in the first place -- it means you can't > have separate copies of the program running, and start/stop them > independently, to say nothing of the possibility that some other program > might share the same name. > > Since you're using start-stop-daemon anyway, why don't you make a pidfile? > > start-stop-daemon --start --startas /home/ibc/rb_program --make-pidfile -- > pidfile /var/run/rb_program.pid --background > > If your program is backgrounding itself already, configure it to create its > own pidfile -- shouldn't be too hard. Then you can do this instead: > > start-stop-daemon --stop --pidfile /var/run/rb_program.pid Yes, in fact I use it now: my Ruby server creates a pidfile. The good point of using: start-stop-daemon --stop --pidfile /var/run/rb_program.pid --name rb_program is that it would stop the process just if it's called "rb_program" and its pid matches the value of /var/run/rb_program.pid, so you cannot kill any other process using that pid by accident (it could occur if your program didn't delete the pidfile and a new process has taken same pid value). > > So, is there some way to force the process to appear as "rb_program" in > > /proc/PID/status? > > I'd like to know that, too, because it'd be useful for things like killall > when things get out of hand. But even if there was, this is still the wrong > approach -- your start-stop-daemon command is sort of equivalent to > killall, which is a really blunt instrument. > -- Iñaki Baz Castillo <ibc / aliax.net>