I have noticed since I have upgraded to 18.06 (in the last months only), that some of my processes - including OpenVPN - seem not to be respawned by procd when crashing.
I recently came across a reproducible scenario which lead me to the following findings:
- as listed by @antismap in a previous post (Here) and a very well documented procd bug (Here), the respawn element of a procd instance gets lost during restart within certain conditions (most typically when a process fails to respond to SIGTERM in time).
- this seem to happen quite easily on openvpn instances (I'm running on MT7621).
Wed Apr 17 16:17:21 2019 daemon.info procd: Instance openvpn::openvpn pid 1720 not stopped on SIGTERM, sending SIGKILL instead
As a quick way to observe the issue, I can typically reproduce this by running "/etc/init.d/openvpn restart" 4 or 5 times in a row.
Question: What would be the best way to get around this? Or is there a plan to address that bug?
Example of the issue as captured:
root@openwrt:/# /etc/init.d/openvpn restart
root@openwrt:/# ubus call service list '{"name":"openvpn","verbose": true}'
{
"openvpn": {
"instances": {
"openvpn": {
"running": true,
"pid": 5085,
"command": [
"\/usr\/sbin\/openvpn",
"--syslog",
"openvpn(openvpn)",
"--status",
"\/var\/run\/openvpn.openvpn.status",
"--cd",
"\/etc\/openvpn",
"--config",
"\/etc\/openvpn\/openvpn.conf"
],
"term_timeout": 15,
"respawn": {
"threshold": 3600,
"timeout": 5,
"retry": -1
}
}
},
"triggers": [...]
}
}
root@openwrt:/# /etc/init.d/openvpn restart
root@openwrt:/# ubus call service list '{"name":"openvpn","verbose": true}'
{
"openvpn": {
"instances": {
"openvpn": {
"running": true,
"pid": 5127,
"command": [
"\/usr\/sbin\/openvpn",
"--syslog",
"openvpn(openvpn)",
"--status",
"\/var\/run\/openvpn.openvpn.status",
"--cd",
"\/etc\/openvpn",
"--config",
"\/etc\/openvpn\/openvpn.conf"
],
"term_timeout": 15
}
},
"triggers": [...]
}
}
Thanks for your feedback!