aboutsummaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rw-r--r--package/redis/S50redis38
-rw-r--r--package/redis/redis.mk5
2 files changed, 43 insertions, 0 deletions
diff --git a/package/redis/S50redis b/package/redis/S50redis
new file mode 100644
index 0000000000..c5751d7f44
--- /dev/null
+++ b/package/redis/S50redis
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# start redis
+#
+
+start() {
+ echo -n "Starting redis: "
+ umask 077
+ start-stop-daemon -S -q -c redis:redis -b \
+ --exec /usr/bin/redis-server -- /etc/redis.conf
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+stop() {
+ echo -n "Stopping redis: "
+ /usr/bin/redis-cli shutdown
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload)
+ restart
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+esac
+
+exit $?
diff --git a/package/redis/redis.mk b/package/redis/redis.mk
index 04c2d6a48a..8537fb2bd2 100644
--- a/package/redis/redis.mk
+++ b/package/redis/redis.mk
@@ -30,4 +30,9 @@ define REDIS_INSTALL_TARGET_CMDS
$(TARGET_DIR)/etc/redis.conf
endef
+define REDIS_INSTALL_INIT_SYSV
+ $(INSTALL) -m 0755 -D package/redis/S50redis \
+ $(TARGET_DIR)/etc/init.d/S50redis
+endef
+
$(eval $(generic-package))