Browse Source

Improve init script

cn 5 years ago
parent
commit
c6c10a5a69
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      init.d/debian-6-dyndnsd

+ 5
- 2
init.d/debian-6-dyndnsd View File

@@ -23,18 +23,21 @@ case "$1" in
23 23
   start)
24 24
     log_daemon_msg "Starting dyndnsd.rb" "dyndnsd"
25 25
     start-stop-daemon --start --quiet --oknodo --make-pidfile --pidfile "/var/run/dyndnsd.pid" --background --exec $DAEMON -- $DAEMON_OPTS
26
+    log_end_msg $?
26 27
     ;;
27 28
   stop)
28 29
     log_daemon_msg "Stopping dyndnsd.rb" "dyndnsd"
29 30
     start-stop-daemon --stop --quiet --oknodo --pidfile "/var/run/dyndnsd.pid"
31
+    log_end_msg $?
30 32
     ;;
31 33
   restart|force-reload)
32 34
     log_daemon_msg "Restarting dyndnsd.rb" "dyndnsd"
33 35
     start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile "/var/run/dyndsd.pid"
34 36
     start-stop-daemon --start --quiet --oknodo --make-pidfile --pidfile "/var/run/dyndnsd.pid" --background --exec $DAEMON -- $DAEMON_OPTS
37
+    log_end_msg $?
35 38
     ;;
36 39
   *)
37
-    echo "Usage: $0 {start|stop|restart|force-reload}" >&2
38
-    exit 1
40
+    log_action_msg "Usage: $0 {start|stop|restart|force-reload}"
41
+    exit 2
39 42
     ;;
40 43
 esac