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