Skip to content

Commit

Permalink
Merge pull request #537 from dwhjames/fix/systemv-start-rpm
Browse files Browse the repository at this point in the history
fix use of app_name and exec vars in systemv start-rpm-template
  • Loading branch information
muuki88 committed Apr 4, 2015
2 parents 3fb8d03 + 08d5bd5 commit 9c19636
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
# $JAVA_OPTS used in $RUN_CMD wrapper
export JAVA_OPTS

prog="${{exec}}"

# FIXME The pid file should be handled by the executed script
# The pid can be filled in in this script
PIDFILE=/var/run/${{app_name}}/running.pid
Expand All @@ -50,15 +48,15 @@ fi


# smb could define some additional options in $RUN_OPTS
RUN_CMD="${{chdir}}/bin/${{app_name}}"
RUN_CMD="${{chdir}}/bin/${{exec}}"

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
[ -e /etc/sysconfig/${{app_name}} ] && . /etc/sysconfig/${{app_name}}

lockfile=/var/lock/subsys/$prog
lockfile=/var/lock/subsys/${{app_name}}

start() {
[ -x $RUN_CMD ] || exit 5
echo -n $"Starting $prog: "
echo -n $"Starting ${{app_name}}: "
cd ${{chdir}}

# FIXME figure out how to use daemon correctly
Expand All @@ -81,8 +79,8 @@ start() {
}

stop() {
echo -n $"Stopping $prog: "
killproc -p $PIDFILE $prog
echo -n $"Stopping ${{app_name}}: "
killproc -p $PIDFILE ${{app_name}}
retval=$?
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
Expand All @@ -103,7 +101,7 @@ force_reload() {

rh_status() {
# run checks to determine if the service is running or use generic status
status -p $PIDFILE -l $lockfile $prog
status -p $PIDFILE -l $lockfile ${{app_name}}
}

rh_status_q() {
Expand Down

0 comments on commit 9c19636

Please sign in to comment.