2010-07-05 05:20:42 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# **********************************************************************
|
|
|
|
# Tentacle Server Daemon launcher for FreeBSD
|
|
|
|
# (c) 2010 Junichi Satoh <junichi@rworks.jp>
|
|
|
|
#
|
|
|
|
# **********************************************************************
|
|
|
|
|
|
|
|
# PROVIDE: tentacle_server
|
|
|
|
# REQUIRE: LOGIN
|
|
|
|
# KEYWORD: shutdown
|
|
|
|
|
|
|
|
# Add the following line to /etc/rc.conf to enable `tentacle_server':
|
|
|
|
#
|
|
|
|
# tentacle_server_enable="YES"
|
|
|
|
#
|
|
|
|
|
|
|
|
. "/etc/rc.subr"
|
|
|
|
|
|
|
|
name="tentacle_server"
|
|
|
|
rcvar=`set_rcvar`
|
|
|
|
|
|
|
|
# read configuration and set defaults
|
|
|
|
tentacle_server_enable=${tentacle_server_enable:-"NO"}
|
2011-02-16 05:22:45 +01:00
|
|
|
tentacle_server_flags=${tentacle_server_flags:-"-a 0.0.0.0 -p 41121 -s /var/spool/pandora/data_in -i.*\.conf:conf\;.*\.md5:md5\;.*\.zip:collections -d"}
|
2010-07-05 05:20:42 +02:00
|
|
|
tentacle_server_user=${tentacle_server_user:-"pandora"}
|
|
|
|
load_rc_config $name
|
|
|
|
|
|
|
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
|
|
|
|
|
|
|
|
command=/usr/local/bin/${name}
|
|
|
|
|
|
|
|
pidfile=/var/run/$name.pid
|
|
|
|
start_postcmd=start_postcmd
|
|
|
|
stop_postcmd=stop_postcmd
|
|
|
|
|
|
|
|
procname="/usr/bin/perl"
|
|
|
|
|
|
|
|
start_postcmd()
|
|
|
|
{
|
2010-11-11 01:58:56 +01:00
|
|
|
TENTACLE_PID=`pgrep -f -j none $name`
|
2010-07-05 05:20:42 +02:00
|
|
|
echo $TENTACLE_PID > $pidfile
|
|
|
|
}
|
|
|
|
|
|
|
|
stop_postcmd()
|
|
|
|
{
|
|
|
|
rm -f $pidfile
|
|
|
|
}
|
|
|
|
|
|
|
|
run_rc_command "$1"
|