aboutsummaryrefslogtreecommitdiffstats
path: root/www/geneweb/files/gwd.in
blob: 41a46f1810ab47277a1597c85bc14536d38b9caf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
#
# PROVIDE: gwd
# REQUIRE: DAEMON
# BEFORE: LOGIN

#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
# SET THEM IN THE /etc/rc.conf FILE
#
gwd_enable=${gwd_enable-"NO"}
gwd_flags=${gwd_flags-"-hd /home/geneweb/gw"}
gwd_pidfile=${gwd_pidfile-"/home/geneweb/gwd.pid"}
gwd_chdir=${gwd_chdir-"/home/geneweb/bases"}
gwd_command=${gwd_command-"/usr/local/bin/gwd"}

gwd_user=${gwd_user-"geneweb"}

. /etc/rc.subr

name="gwd"
rcvar=`set_rcvar`
command="${gwd_command}"
pidfile="${gwd_pidfile}"

load_rc_config $name

start_cmd="echo \"Starting ${name}.\";cd ${gwd_chdir};su -m ${gwd_user} -c \"exec /usr/sbin/daemon -f -p ${pidfile} ${command} ${gwd_flags} ${command_args}\""
#start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} ${gwd_flags} ${command_args}"

run_rc_command "$1"