summaryrefslogtreecommitdiff
path: root/community/mfs/mfschunkserver
diff options
context:
space:
mode:
Diffstat (limited to 'community/mfs/mfschunkserver')
-rwxr-xr-xcommunity/mfs/mfschunkserver38
1 files changed, 38 insertions, 0 deletions
diff --git a/community/mfs/mfschunkserver b/community/mfs/mfschunkserver
new file mode 100755
index 000000000..b9567b703
--- /dev/null
+++ b/community/mfs/mfschunkserver
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/mfschunkserver`
+case "$1" in
+ start)
+ stat_busy "Starting MooseFS Chunkserver Daemon"
+ if [ -z "$PID" ]; then
+ /usr/sbin/mfschunkserver start
+ fi
+ if [ ! -z "$PID" -o $? -gt 0 ]; then
+ stat_fail
+ else
+ PID=`pidof -o %PPID /usr/sbin/mfschunkserver`
+ echo $PID > /var/run/mfsmetalogger.pid
+ add_daemon mfschunkserver
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping MooseFS Chunkserver Daemon"
+ [ ! -z "$PID" ] && /usr/sbin/mfschunkserver stop &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon mfschunkserver
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac