Assign Specific PID

freeyourboxers

Registered
OK, so I have this piece of software (a "component" actually) that I want to restart every 25 or so minutes. My plan is to assign a specific PID to that process (if this is even possible) and then write a script that restarts that PID every 25 or so minutes. So I need to know how to assign a specific PID to that component. If anyone has any other ideas as to how to accomplish my goal, I'd be glad to hear them.

Thank you so much
 
have the same pid everytime? you could make the script lookup the pid for it everytime it restarts its.... for example

#!/bin/sh
kill -HUP `cat /var/run/httpd.pid`

this will lookup the pid of that process(if it writes in the that location) like FreeBSD does and cause it to restart.

If it doesn't write a pid file by default, perhaps you can force it to by invoking it with a -p argument

like so

/usr/local/bin/mydaemon -p /var/run/mydaemon.pid

anyway, just some thoughts from a BSD hacker.
 
Back
Top