[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

how to start an obnoxious daemon at boot?



hi,

I have a BestPower UPS (it is a `smart' one) and I am trying to start the monitoring daemon with a /etc/init.d/ script like everything else (using the init.d/skeleton for a template), however i have a problem:

this daemon does not create .pid files, and it forks several times when its first starting up so start-stop-daemon --make-pidfile gets the pid of a process that is killed as soon as the daemon is finished connecting to the UPS, so the `stop' part of the script won't work :(

and if that is not enough this daemon always leaves a zombie process after it starts up, so trying to fix the .pid with pidof does not work either since it finds 2 pids...

I have been trying various scripting tricks to replace start-stop-daemon creating an empty file in /var/run so i can tell when its running or not, the other problem I have is the way this daemon forks and exits it seems to cause my script to aport prematurely.

BestPower supplies the full source code to their software (and gives full specification on the comm protocol to anyone who asks), but I am not skilled enough of a programmer to fix these problems (that and the code is kinda gross...)

does anyone have any suggestions for how to do this? does there happen to be a replacement software for these UPSs (that works in smart mode) ?



Best Regards,
Ethan Benson
To obtain my PGP key: http://www.alaska.net/~erbenson/pgp/


Reply to: