Reuben,
> /etc/rc.d/init.d/kannel start
> /etc/rc.d/init.d/kannel stop
As far as I am aware, init scripts are only meant to start and stop
one and only one process. Gentoo works around this by allowing you to
specify inter-dependencies in the init scripts themselves. Thus you
could have an init script for bearerbox, and another for smsbox and tell
init that bearerbox must be started before smsbox (which it will do
automatically should you call "smsbox start" on your own). Since you're
probably not using Gentoo, I'm not exactly sure how to go about what
you're looking for. You could always have "kannel stop" try to use two
start-stop-daemon's to stop both processes and remove the PID files
(which is what you probably have), but back them up with a couple of
killall's for the processes and a couple of "rm -f"s for the PID files.
It's cheesy, but it'd probably work just fine. I personally try to do
things the way the OS intended, but if you're using ancient technology
like Red Hat, there probably is no correct way to do this.
> First of all i noticed what might be a problem in smsbox. The pid file is
> supposed to be deleted when its corresponding process ends. That works fine
> with bearerbox, but when smsbox is terminated, it does not delete the pid
> file that was specified using --pid-file when starting the process. I
> thought that it was ok to leave the file there, and overwrite it next time
> it is launched, but when trying to load smsbox again, it starts PANICing
> that the pid file already exists, and commits suicide. So I had to just do
> without storing the pid for smsbox. If i need to close smsbox, I cannot have
> its pid to run the command kill $(cat /var/run/smsbox.pid).
If you're using start-stop-daemon, have it create the PID files for
you.
> Running the script 'kannel' as root will not give any problems at all. But
> when I run them as a different user, bearer box starts to PANIC again,
> stating that it "cannot open file".. Open file?? It is supposed to create it
> at /var/run.. And, i have to say this, it also commits suicide at this
> stage. Damn, what a depressed process!
Same as above. Also it might be complaining about a log file and
not the PID file.
Jon