I have noticed that if openvpn fails to start because of an invalid password or something, it doesn't delete the openvpn.pid file in the /var/run/ folder.
Is this the intended behaviour? Is the /var/run/*.pid files in the folder a reliable way to determine if a process is running?
Some background: Via a cron - sh script, i'm checking the IP address of a jail and if it's the same as my ISP-issued static IP address, i'm stopping and starting the openvpn service.
I'm reading the PID file to determine if i need to stop the service before starting it. Problem is the PID file exists but the service is not running, therefore openvpn reports an error that then gets emailed to me via cron; I work up this morning to 60 emails from cron !
Is this the intended behaviour? Is the /var/run/*.pid files in the folder a reliable way to determine if a process is running?
Some background: Via a cron - sh script, i'm checking the IP address of a jail and if it's the same as my ISP-issued static IP address, i'm stopping and starting the openvpn service.
I'm reading the PID file to determine if i need to stop the service before starting it. Problem is the PID file exists but the service is not running, therefore openvpn reports an error that then gets emailed to me via cron; I work up this morning to 60 emails from cron !