Make our LSB init script _actually_ LSB compliant. (#17824)
We seem to have been relying on some Debian-specific stuff instead of actually following LSB requirements.
Austin S. Hemmelgarn committed
Jun 13, 2024 at 13:25 UTC
a2f0b951d6a20fb1a92f3376348ccda2f34ec1a8
1 file changed
+11
-5
system/lsb/init.d/netdata.in
+11
-5
@@ -47,18 +47,24 @@ service_start() {
47
48
chown @netdata_user_POST@:@netdata_user_POST@ $PIDFILE_PATH
49
50
- log_daemon_msg "Starting real-time performance monitoring" "netdata"
50
+ log_success_msg "Starting real-time performance monitoring"
51
start_daemon -p $PIDFILE $DAEMON_PATH/$DAEMON $DAEMONOPTS
52
RETVAL=$?
53
- log_end_msg $RETVAL
53
+ case "${RETVAL}" in
54
+ 0) log_success_msg "Started real-time performance monitoring" ;;
55
+ *) log_error_msg "Failed to start real-time performance monitoring" ;;
56
+ esac
57
return $RETVAL
58
}
59
60
service_stop() {
58
- log_daemon_msg "Stopping real-time performance monitoring" "netdata"
61
+ log_success_msg "Stopping real-time performance monitoring"
62
killproc -p ${PIDFILE} $DAEMON_PATH/$DAEMON
63
RETVAL=$?
61
- log_end_msg $RETVAL
64
+ case "${RETVAL}" in
65
+ 0) log_success_msg "Stopped real-time performance monitoring" ;;
66
+ *) log_error_msg "Failed to stop real-time performance monitoring" ;;
67
+ esac
68
69
if [ $RETVAL -eq 0 ]; then
70
rm -f ${PIDFILE}
@@ -77,7 +83,7 @@ condrestart() {
83
}
84
85
service_status() {
80
- status_of_proc -p $PIDFILE $DAEMON_PATH/$DAEMON netdata
86
+ pidofproc -p $PIDFILE $DAEMON_PATH/$DAEMON
87
}
88
89