Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected exit code 2 on Raspberry Pi #29

Open
chivakaa opened this issue Dec 26, 2017 · 0 comments
Open

Unexpected exit code 2 on Raspberry Pi #29

chivakaa opened this issue Dec 26, 2017 · 0 comments

Comments

@chivakaa
Copy link

Hi,

I have not clear where is the mistake on script check_service, because some running service return exit 0 (OK) and others also running return exit 2

Evidence of exit 2 with running service on linux

root@emonpi(rw):nagios# ./libexec/check_service -o linux -t "service emonhub status"
● emonhub.service - LSB: Start/stop emonHub
Loaded: loaded (/etc/init.d/emonhub)
Active: active (running) since Sun 2017-12-24 18:10:15 CET; 1 day 23h ago
Process: 31020 ExecStop=/etc/init.d/emonhub stop (code=exited, status=0/SUCCESS)
Process: 10504 ExecStart=/etc/init.d/emonhub start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/emonhub.service
└─10551 python /usr/share/emonhub/emonhub.py --config-file /home/pi/data/emonhub.conf --logfile /var/log/emonhub/emonhub.log

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
root@emonpi(rw):nagios# echo $?
2

Evidence of expected running

çroot@emonpi(rw):nagios# ./libexec/check_service -o linux -t "service mosquitto status"
● mosquitto.service - Mosquitto MQTT Broker
Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled)
Active: active (running) since Mon 2017-12-25 17:23:18 CET; 24h ago
Docs: man:mosquitto(8)
https://mosquitto.org/
Main PID: 25504 (mosquitto)
CGroup: /system.slice/mosquitto.service
└─25504 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

Dec 25 17:23:18 emonpi systemd[1]: Started Mosquitto MQTT Broker.
root@emonpi(rw):nagios# echo $?
0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant