summaryrefslogtreecommitdiff
blob: e9197369d0c7806a4714cbe140f6abbe87785cb3 (plain)
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
33
34
35
36
37
38
39
40
41
42
#!/sbin/openrc-run
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

PNAME=remotetrx
NAME="RemoteTrx Server"
DAEMON=/usr/bin/$PNAME

POPTS="--daemon \
	${RUNASUSER:+--runasuser=$RUNASUSER} \
	${PIDFILE:+--pidfile=$PIDFILE} \
	${LOGFILE:+--logfile=$LOGFILE} \
	${CFGFILE:+--config=$CFGFILE}"

create_logfile()
{
  touch $LOGFILE
  if [ -n "$RUNASUSER" ]; then
    chown $RUNASUSER.$RUNASUSER $LOGFILE
  fi
}


depend() {
  need localmount
  use net
  after bootmisc
}

start() {
  ebegin "Starting $NAME"
  create_logfile
  export $ENV
  start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON -- $POPTS
  eend $?
}

stop() {
  ebegin "Stopping $NAME"
  start-stop-daemon --stop --pidfile $PIDFILE --exec $DAEMON
  eend $?
}