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 4, 2015
1 parent 3bd5fb3 commit e6a1e13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ then

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

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

cd ${{chdir}}
INSTALL_DIR="${{chdir}}"
[ -n "${PACKAGE_PREFIX}" ] && INSTALL_DIR="${PACKAGE_PREFIX}/${{app_name}}"

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

Expand Down

0 comments on commit e6a1e13

Please sign in to comment.