init scripts don't return the proper exit codes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenContrail |
New
|
Undecided
|
Unassigned |
Bug Description
The init scripts for the services listed below don't return the proper exit codes (according to LSB[1]).
For example, running "service contrail-api status" should return 3 if the service is down. The script actually returns 0. This becomes a problem when using tools like chef that use this exist code to determine weather the service needs to be started.
Affected scripts (grouped by node type)
analytics
* contrail-
* contrail-collector
* contrail-
cfgm
* ifmap
* contrail-discovery
* contrail-
* contrail-api
* contrail-schema
* contrail-
control
* contrail-control
* contrail-dns
database
* contrail-database
rabbitmq
* rabbitmq-server
webui
* contrail-webui
* contrail-
For example, here's the contrail-api init script, https:/
[1] http://
This bug affects us very much. (Mirantis)
root@contrail- db-15427: /var/lib/ fuel# nc -l 5997 db-15427: /var/lib/ fuel# /usr/bin/ contrail- discovery --conf_file /etc/contrail/ contrail- discovery. conf --worker_id 0 discovery] : SANDESH: CONNECT TO COLLECTOR: True discovery] : Unable to open HTTP Port 5997, [Errno 98] Address already in use db-15427: /var/lib/ fuel# echo $?
root@contrail-
08/02/2016 10:53:43 PM [contrail-
08/02/2016 10:53:43 PM [contrail-
root@contrail-
0
Our workaround was to change the "exitcodes" to something unusual to make service restart infinitely until it reaches the "startretries":
[program: contrail- discovery] /usr/bin/ contrail- discovery --conf_file /etc/contrail/ contrail- discovery. conf --worker_id %(process_num)s name=%( process_ num)s stderr= true contrail/ contrail- discovery- %(process_ num)s-stdout. log logfile= /dev/null
command=
numprocs=1
process_
redirect_
stdout_logfile= /var/log/
stderr_
priority=430
autostart=true
killasgroup=true
stopsignal=KILL
exitcodes=222 ;'expected' exit codes for process (default 0,2)
startretries=10
user=contrail
Please fix services return non-zero exit code when it crashes.