2020-07-13 06:42:43 +02:00
|
|
|
#!/bin/sh
|
2010-07-05 05:20:42 +02:00
|
|
|
|
2020-07-13 06:42:43 +02:00
|
|
|
# **********************************************************************
|
|
|
|
# Tentacle Server Daemon launcher for FreeBSD
|
|
|
|
# (c) 2010-2012 Junichi Satoh <junichi@rworks.jp>
|
|
|
|
#
|
|
|
|
# **********************************************************************
|
2018-07-04 12:32:55 +02:00
|
|
|
|
2020-07-13 06:42:43 +02:00
|
|
|
# PROVIDE: tentacle_server
|
|
|
|
# REQUIRE: LOGIN
|
|
|
|
# KEYWORD: shutdown
|
2018-07-04 12:32:55 +02:00
|
|
|
|
2020-07-13 06:42:43 +02:00
|
|
|
# Add the following line to /etc/rc.conf to enable `tentacle_server':
|
|
|
|
#
|
|
|
|
# tentacle_server_enable="YES"
|
|
|
|
#
|
2018-07-04 12:32:55 +02:00
|
|
|
|
2020-07-13 06:42:43 +02:00
|
|
|
. "/etc/rc.subr"
|
2018-07-04 12:32:55 +02:00
|
|
|
|
2020-07-13 06:42:43 +02:00
|
|
|
name="tentacle_server"
|
|
|
|
rcvar=tentacle_server_enable
|
2018-07-04 12:32:55 +02:00
|
|
|
|
2020-07-13 06:42:43 +02:00
|
|
|
# read configuration and set defaults
|
|
|
|
tentacle_server_enable=${tentacle_server_enable:-"NO"}
|
|
|
|
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'}
|
|
|
|
tentacle_server_user=${tentacle_server_user:-"pandora"}
|
|
|
|
load_rc_config $name
|
2018-07-04 12:32:55 +02:00
|
|
|
|
2020-07-13 06:42:43 +02:00
|
|
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
|
2018-07-04 12:32:55 +02:00
|
|
|
|
2020-07-13 06:42:43 +02:00
|
|
|
command=/usr/local/bin/${name}
|
|
|
|
command_interpreter=/usr/local/bin/perl
|
|
|
|
procname=$command
|
|
|
|
pidfile=/var/run/$name.pid
|
2018-07-04 12:32:55 +02:00
|
|
|
|
2020-07-13 06:42:43 +02:00
|
|
|
start_postcmd=start_postcmd
|
|
|
|
stop_postcmd=stop_postcmd
|
2018-07-04 12:32:55 +02:00
|
|
|
|
2020-07-13 06:42:43 +02:00
|
|
|
start_postcmd()
|
|
|
|
{
|
|
|
|
pgrep -f -j none "^$command_interpreter $command" > $pidfile
|
2018-07-04 12:32:55 +02:00
|
|
|
}
|
|
|
|
|
2020-07-13 06:42:43 +02:00
|
|
|
stop_postcmd()
|
|
|
|
{
|
|
|
|
rm -f $pidfile
|
2018-07-04 12:32:55 +02:00
|
|
|
}
|
|
|
|
|
2020-07-13 06:42:43 +02:00
|
|
|
run_rc_command "$1"
|