From 260116e58f93a01642de161f924a3bad831921a6 Mon Sep 17 00:00:00 2001 From: FezVrasta Date: Thu, 18 Jun 2015 14:38:44 +0200 Subject: [PATCH] fixed some typo, removed daemon function, waiting to find a cross distro daemon feature... --- tools/arkdaemon | 81 ++----------------------------------------------- 1 file changed, 2 insertions(+), 79 deletions(-) diff --git a/tools/arkdaemon b/tools/arkdaemon index 952fef9..2498318 100644 --- a/tools/arkdaemon +++ b/tools/arkdaemon @@ -4,81 +4,6 @@ source /etc/arkdaemon.cfg source /home/${steamuser}/.arkmanager.cfg -# A function to start a program. -daemon() { - # Test syntax. - local gotbase= force= nicelevel corelimit - local pid base= user= nice= bg= pid_file= - nicelevel=0 - while [ "$1" != "${1##[-+]}" ]; do - case $1 in - '') echo $"$0: Usage: daemon [+/-nicelevel] {program}" - return 1;; - --check) - base=$2 - gotbase="yes" - shift 2 - ;; - --check=?*) - base=${1#--check=} - gotbase="yes" - shift - ;; - --user) - user=$2 - shift 2 - ;; - --user=?*) - user=${1#--user=} - shift - ;; - --pidfile) - pid_file=$2 - shift 2 - ;; - --pidfile=?*) - pid_file=${1#--pidfile=} - shift - ;; - --force) - force="force" - shift - ;; - [-+][0-9]*) - nice="nice -n $1" - shift - ;; - *) echo $"$0: Usage: daemon [+/-nicelevel] {program}" - return 1;; - esac - done - - # Save basename. - [ -z "$gotbase" ] && base=${1##*/} - - # See if it's already running. Look *only* at the pid file. - __pids_var_run "$base" "$pid_file" - - [ -n "$pid" -a -z "$force" ] && return - - # make sure it doesn't core dump anywhere unless requested - corelimit="ulimit -S -c ${DAEMON_COREFILE_LIMIT:-0}" - - # if they set NICELEVEL in /etc/sysconfig/foo, honor it - [ -n "${NICELEVEL:-}" ] && nice="nice -n $NICELEVEL" - - # Echo daemon - [ "${BOOTUP:-}" = "verbose" -a -z "${LSB:-}" ] && echo -n " $base" - - # And start it up. - if [ -z "$user" ]; then - $nice /bin/bash -c "$corelimit >/dev/null 2>&1 ; $*" - else - $nice runuser -s /bin/bash - $user -c "$corelimit >/dev/null 2>&1 ; $*" - fi - [ "$?" -eq 0 ] && success $"$base startup" || failure $"$base startup" -} - NAME=arkmanager_daemon DESC="ARK manager daemon used to start the server and keep it updated" PIDFILE="/var/run/${NAME}.pid" @@ -89,8 +14,6 @@ DAEMON="sh /usr/bin/arkmanager update" START_OPTS="--pidfile ${PIDFILE} --user=${steamuser} ${DAEMON}" -test -x $DAEMON || exit 0 - set -e case "$1" in @@ -101,13 +24,13 @@ case "$1" in ;; stop) echo -n "Stopping $DESC: " - kill -TERM ${cat $PIDFILE} + kill ${cat $PIDFILE} echo "$NAME." rm -f $PIDFILE ;; restart|force-reload) echo -n "Restarting $DESC: " - kill -TERM ${cat $PIDFILE} + kill $(cat $PIDFILE) sleep 1 daemon $START_OPTS >> $LOGFILE echo "$NAME."