Hello

I am trying to solve the previously mentioned problem to re-launch kannel
automatically with monit if it kills itself.

Since in monit you have to specify a command to start and stop the process,
I tried to create a simple script which i called kannel to start and stop
kannel by just typing:

/etc/rc.d/init.d/kannel start
/etc/rc.d/init.d/kannel stop

I had to use:

--pid-file /var/run/bearerbox.pid

when starting bearerbox to store its pid since i would need the pid if i
need to kill it.

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).

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!

Best Regards,


Reuben Sant

______________________
Address: "Soleado", Bidnija Road, Bidnija, Limits of St.Paul's Bay. SPB 13.
Malta
Mob: (+356) 79 313645 [try this first pls]
Tel: (+356) 21 424222
Email: [EMAIL PROTECTED]
MSN: [EMAIL PROTECTED]
Web: http://www.reubensant.net


----- Original Message ----- 
From: "Jonathan Houser" <[EMAIL PROTECTED]>
To: "Alejandro Ramirez" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[email protected]>
Sent: Friday, September 02, 2005 7:19 PM
Subject: Re: Kannel Suicide


>
>   Alejandro,
>
> > Very interesting this MONIT thing... is it possible to see how your
script starts kannel.. my init.d script does not create a PID file in
/var/run for smsbox or sqlbox or... any box. How do you manage that??
>
>      Gentoo uses start-stop-daemon for its services/daemons, and that's
> all I use as well.  The start-stop-daemon app has the ability to be told
> to create a PID file -- just check the man page.
>
> Jon
>



Reply via email to