asterisk init script is not LSB compliant (for heartbeat, i.e. linux-ha)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
asterisk (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
Binary package hint: asterisk
Description: Ubuntu 8.04
Release: 8.04
Package: asterisk
Version: 1:1.4.17~
In order to use asterisk in a heartbeat setup, I need the init script to report the status of the service according to the LSB standard [1]. The script has to exit with a status of 3 if the service is stopped and 0 if it is running. But the asterisk init script returns 1 if asterisk is stopped and 0 if it is running. The fix is quite easy:
--- /etc/init.
+++ /etc/init.
@@ -126,7 +126,7 @@
plist=`ps ax | awk "{ if (\\$5 == \"$DAEMON\") print \\$1 }"`
if [ "$plist" = "" ]; then
- return 1
+ return 3
else
[1] http://
I think that it would not be a good idea to continue to use awk to detect if the daemon is running. It would in my opinion make more sense to make this code use the status_of_proc() function which is now included in the init functions.