I have a VPN service that I would like to manage through supervisord.
When the VPN service installs itself, it makes an entry in /etc/systemd/system/pgateway.service
. Contents below:
[Unit]
Description=Cradlepoint NetCloud Client that provides access to secure overlay networks.
After=network.target
[Service]
Type=forking
PIDFile=/run/pGateway.pid
ExecStartPre=/bin/rm -f /run/pGateway.pid
ExecStart=/opt/pertino/pgateway/pGateway -f -p /run/pGateway.pid
TimeoutStopSec=30
Restart=on-abort
KillMode=process
[Install]
WantedBy=basic.target
Sometimes, this process dies and needs to be restarted. I would like to manage this VPN process through supervisord since I have the remote web interface to supervisorctl.
Would this be something easy to do? Am I missing anything important? The thing that catches me up is that supervisord doesn't specify a way to manage pid
files (If I even need to worry about that..)
Could I do something like the following in my supervisor.conf
?:
[program:pgateway]
command=/opt/pertino/pgateway/pGateway -f -p /run/pGateway.pid
process_name=%(program_name)s
numprocs=1
directory=/tmp
umask=022
priority=999
autostart=true
autorestart=unexpected
startsecs=10
startretries=3
exitcodes=0,2
stopsignal=TERM
stopwaitsecs=10
stopasgroup=false
killasgroup=false
user=root
redirect_stderr=false
stdout_logfile=/a/path
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stdout_events_enabled=false
stderr_logfile=/a/path
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
stderr_events_enabled=false
environment=A="1",B="2"
serverurl=AUTO