Skip to content

Commit

Permalink
fix use of app_name and exec vars in systemv start-rpm-template
Browse files Browse the repository at this point in the history
It looks like a bug was introduced in commit 22a691, where if `executableScriptName in Linux` and `packageName in Linux` are not equal, then an incorrect script is generated.

The `exec` template variable should only be used to build the run command. Everything else should be the `app_name`.
  • Loading branch information
dwhjames committed Mar 29, 2015
1 parent 48b0c19 commit 08d5bd5
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 08d5bd5

Please sign in to comment.