diff options
Diffstat (limited to 'ftp/fastdfs/files/fdfs_storaged.in')
-rw-r--r-- | ftp/fastdfs/files/fdfs_storaged.in | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ftp/fastdfs/files/fdfs_storaged.in b/ftp/fastdfs/files/fdfs_storaged.in new file mode 100644 index 000000000000..09a6e52ebb29 --- /dev/null +++ b/ftp/fastdfs/files/fdfs_storaged.in @@ -0,0 +1,46 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: fdfs_storaged +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable `fdfs_storaged': +# +# fdfs_storaged_enable="YES" +# + +. /etc/rc.subr + +name="fdfs_storaged" +rcvar=fdfs_storaged_enable + +command="%%PREFIX%%/bin/fdfs_storaged" +pidfile="/var/run/fdfs_storaged.pid" + +start_postcmd="${name}_poststart" +stop_postcmd="rm ${pidfile}" + +fdfs_storaged_poststart() +{ + /bin/ps auxwww|/usr/bin/grep fdfs_storaged|/usr/bin/grep -v 'grep'|grep -v 'rc.d'|/usr/bin/awk '{print $2;}' > /var/run/fdfs_storaged.pid + + currpid=`/bin/cat /var/run/fdfs_storaged.pid` + + if [ "$currpid" -gt 0 ]; then + echo "Started fdfs_storaged." + fi +} + +# read configuration and set defaults +load_rc_config "$name" +: ${fdfs_storaged_enable="NO"} +: ${fdfs_storaged_config="%%PREFIX%%/etc/fdfs/storage.conf"} + +command_args="${fdfs_storaged_config}" +required_files="${fdfs_storaged_config}" + +run_rc_command "$1" + |