Hi,
When restarting a specific application with /etc/init.d/program/restart, respawn parameters are lost:
before :
ubus call service list '{"name":"program"}'
"program": {
"instances": {
"program": {
"running": true,
"pid": 4904,
"command": [
"\/usr\/bin\/program",
],
"term_timeout": 5,
"limits": {
"core": "unlimited"
},
"respawn": {
"threshold": 3600,
"timeout": 1,
"retry": 0
},
"pidfile": "\/var\/run\/program.pid"
}
}
},
after
"program": {
"instances": {
"program": {
"running": true,
"pid": 4904,
"command": [
"\/usr\/bin\/program",
],
"term_timeout": 5,
"limits": {
"core": "unlimited"
},
"pidfile": "\/var\/run\/program.pid"
}
}
},
When restarting the app with /etc/init.d/program/stop and then /etc/init.d/program/start, the issue does not appear.
procd logs give me the following :
with restart:
2019-02-04T14:50:32.273940+01:00 procd[1]: Stop instance program::program
2019-02-04T14:50:32.383913+01:00 procd[1]: Update service program
2019-02-04T14:50:32.385539+01:00 procd[1]: Update instance program::program
2019-02-04T14:50:32.385539+01:00 procd[1]: running /etc/init.d/program running
2019-02-04T14:50:32.389260+01:00 procd[1]: start /etc/init.d/program running
2019-02-04T14:50:32.498445+01:00 procd[1]: Instance program::program exit with error code 15 after 48 seconds <= program stops after the start procedure ?
2019-02-04T14:50:32.498445+01:00 procd[1]: Started instance program::program[6006]
2019-02-04T14:50:32.507124+01:00 procd[1]: stop /etc/init.d/program running - took 0.118804167s
with stop and then start :
2019-02-04T14:54:34.193629+01:00 procd[1]: Stop instance program::program
2019-02-04T14:54:34.271597+01:00 procd[1]: Instance program::program exit with error code 15 after 16 seconds
2019-02-04T14:54:34.590466+01:00 procd[1]: Ping
2019-02-04T14:54:39.596012+01:00 procd[1]: Ping
2019-02-04T14:54:44.598687+01:00 procd[1]: Ping
2019-02-04T14:54:45.251411+01:00 procd[1]: Create service program
2019-02-04T14:54:45.251411+01:00 procd[1]: Start instance program::program
2019-02-04T14:54:45.251411+01:00 procd[1]: Started instance program::program[6269]
2019-02-04T14:54:45.255180+01:00 procd[1]: running /etc/init.d/program running
2019-02-04T14:54:45.269798+01:00 procd[1]: start /etc/init.d/program running
2019-02-04T14:54:45.491149+01:00 procd[1]: stop /etc/init.d/program running - took 0.231052709s
It looks like the program takes too long to stop and procd has trouble with this ? how is procd handling restarts ?
thanks !