Skip to content

Commit

Permalink
Support for relocatable RPMs
Browse files Browse the repository at this point in the history
Save the value of `RPM_INSTALL_PREFIX` into application's sysconfig file.

Upon application start up, look for this value, else use the `chdir` value
supplied via sbt templates.
  • Loading branch information
fsat committed Sep 3, 2015
1 parent 3bd5fb3 commit 9e1f7d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ then

addGroup ${{daemon_group}} "${{daemon_group_gid}}"
addUser ${{daemon_user}} "${{daemon_user_uid}}" ${{daemon_group}} "${{app_name}} user-daemon" "${{daemon_shell}}"
fi
fi

sed -i 's/PACKAGE_PREFIX\=.*//g' /etc/sysconfig/${{app_name}}
if [ "$RPM_INSTALL_PREFIX" != "" ]; then
echo "PACKAGE_PREFIX=${RPM_INSTALL_PREFIX}" >> /etc/sysconfig/${{app_name}}
fi
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@
# This order means system config appends/overrides package config
[ -e /etc/sysconfig/${{app_name}} ] && . /etc/sysconfig/${{app_name}}

cd ${{chdir}}
INSTALL_DIR="${{chdir}}"
if [ "${PACKAGE_PREFIX}" != "" ]; then
INSTALL_DIR="${PACKAGE_PREFIX}/${{app_name}}"
fi

exec="${{chdir}}/bin/${{exec}}"
exec="$INSTALL_DIR/bin/${{exec}}"
prog="${{app_name}}"
lockfile="/var/lock/subsys/${{app_name}}"

Expand Down

0 comments on commit 9e1f7d8

Please sign in to comment.