-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix SystemV init script template for rpm packaging #541
Conversation
Main fix is to make use of the `daemon` library function in `start`, correcting broken invocation of `runuser`. For processes that manage their own pid file, they should define the `PIDFILE` variable (sourced either through `/etc/default/…` or `/etc/sysconfig/…`). Otherwise, if undefined, this script will capture the pid and write it to `/var/run/${{app_name}}/running.pid`. Other minor changes: - don’t need to call `success`/`failure` in `start` as this is already done by `daemon` - don’t need to create `/var/run/${{app_name}}` dir as this is already done by the linux package mappings and thus the dir is created at package install time.
@muuki88, I’ve tested this with Centos 6.6 and a sample Play app. I can package up my semi-automated test environment and submit it as a PR, if you’d like. I’ve tested the script in the two cases with respect to pid file creation. First with the following in the JAVA_OPTS="-Dpidfile.path=/var/run/${{app_name}}/play.pid $JAVA_OPTS"
PIDFILE="/var/run/${{app_name}}/play.pid" In this case, this value of In the second case, I left PIDFILE="/var/run/${{app_name}}/running.pid" and appending |
$prog is undefined at this point
@@ -22,7 +22,11 @@ | |||
# ----------------- | |||
# JAVA_OPTS="-Dpidfile.path=/var/run/${{app_name}}/play.pid $JAVA_OPTS" | |||
|
|||
# Setting PIDFILE | |||
# --------------- | |||
# PIDFILE="/var/run/${{app_name}}/play.pid" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getting the config stuff right already paid off. Sweet!
I will give this a try hopefully in the next days. Really appreciate your work. Thanks :) |
Thanks! It’s been a good opportunity to brush up on Linux and Bash. |
fix SystemV init script template for rpm packaging
Main fix is to make use of the
daemon
library function instart
, correcting broken invocation ofrunuser
.For processes that manage their own pid file, they should define the
PIDFILE
variable (sourced either through/etc/default/…
or/etc/sysconfig/…
). Otherwise, if undefined, this script will capture the pid and write it to/var/run/${{app_name}}/running.pid
.Other minor changes:
success
/failure
instart
as this is already done bydaemon
/var/run/${{app_name}}
dir as this is already done by the linux package mappings and thus the dir is created at package install time.