1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00
freebsd-ports/ftp/fastdfs/files/fdfs_storaged.in
Alexander Leidinger 69c8b49c80 ftp/fastdfs: make the rc scripts service jails aware
PR:		279640
Approved by:	maintainer timeout (1 month)
2024-07-10 15:39:44 +02:00

46 lines
1013 B
Bash

#!/bin/sh
# 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_svcj_options:="net_basic"}
: ${fdfs_storaged_config="%%PREFIX%%/etc/fdfs/storage.conf"}
command_args="${fdfs_storaged_config}"
required_files="${fdfs_storaged_config}"
run_rc_command "$1"