rc.razerd.diff 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. diff -Nur razercfg-0.21.orig/razerd.initscript razercfg-0.21/razerd.initscript
  2. --- razercfg-0.21.orig/razerd.initscript 2013-07-30 04:54:30.000000000 -0500
  3. +++ razercfg-0.21/razerd.initscript 2013-12-02 00:32:40.664988672 -0600
  4. @@ -12,34 +12,33 @@
  5. export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
  6. NAME=razerd
  7. DAEMON="$(which $NAME)"
  8. -PIDFILE="/run/razerd/razerd.pid"
  9. +PIDFILE="/var/run/razerd/razerd.pid"
  10. DESC="Razer device state daemon"
  11. -. /lib/lsb/init-functions
  12. +. /etc/rc.d/init.d/functions
  13. case "$1" in
  14. start)
  15. - log_begin_msg "Starting $DESC: $NAME"
  16. - start-stop-daemon --start --quiet --pidfile $PIDFILE \
  17. - --oknodo --exec "$DAEMON" -- \
  18. - -f -B -P $PIDFILE
  19. - log_end_msg $?
  20. + mkdir -p $(dirname ${PIDFILE})
  21. + action $"Starting $DESC: $NAME" \
  22. + daemon --pidfile $PIDFILE $DAEMON -f -B -P $PIDFILE
  23. ;;
  24. stop)
  25. - log_begin_msg "Stopping $DESC: $NAME"
  26. - start-stop-daemon --stop --quiet --pidfile $PIDFILE \
  27. - --name "$NAME"
  28. + action $"Stopping $DESC: $NAME" \
  29. + killproc -p $PIDFILE
  30. RES=$?
  31. rm -f $PIDFILE
  32. - log_end_msg $RES
  33. ;;
  34. - restart|reload|force-reload)
  35. + restart)
  36. $0 stop
  37. sleep 1
  38. $0 start
  39. ;;
  40. + status)
  41. + status -p $PIDFILE $NAME
  42. + ;;
  43. *)
  44. - echo "Usage $0 [start|stop|restart|reload|force-reload]"
  45. + echo "Usage $0 [start|stop|restart|status]"
  46. exit 1
  47. ;;
  48. esac