-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[build] Commit generated init scripts #11205
Conversation
jbudz
commented
Apr 12, 2017
•
edited
Loading
edited
- We don't have any version locking on dependent ruby gems other than docs. This could cause accidental inconsistencies.
- We can make modifications, giving us more freedom to investigate issues like Setting NODE_OPTIONS with Debian/Ubuntu packages #7237, [Packaging] systemd Service Unit Should Create a PID directory #7759, Documentation for configuring --max-old-space-size #9006, systemd restart loop, reported as running with no errors #10895, etc
I'm closing this one for now, but may come back to it. pleaserun 0.0.28 will help us set environment variables addressing a few of the issues in number 2. Number one can be solved with a gemfile. |
I got back to this and did some digging, reopening for a few reasons.
This PR doesn't address any of those issues - I'm keeping this separate so we don't lose it on a merge and for future reference. |
We were previously using pleaserun to output Would it be worth it to keep a task around which uses pleaserun to update these files? |
We aren't making use of kibana.conf and .plist so we should be able to remove them. For the pleaserun task I'd opt for removing it and pull in updates manually if needed, the more we diverge the more off it will be. As an in between how about a followup PR (or commit here and merge without squashing) to bump this to latest before we start adding changes? |
You're right, if we intend on diverging from the I bumped diff --git a/tasks/build/services/sysv/etc/init.d/kibana b/tasks/build/services/sysv/etc/init.d/kibana
index 94066b0c07..07cc25a899 100755
--- a/tasks/build/services/sysv/etc/init.d/kibana
+++ b/tasks/build/services/sysv/etc/init.d/kibana
@@ -20,11 +20,26 @@ export PATH
name=kibana
program=/usr/share/kibana/bin/kibana
-args=-c\\\ /etc/kibana/kibana.yml
+args=-c\ /etc/kibana/kibana.yml
pidfile="/var/run/$name.pid"
+user="kibana"
+group="kibana"
+chroot="/"
+chdir="/"
+nice=""
-[ -r /etc/default/$name ] && . /etc/default/$name
-[ -r /etc/sysconfig/$name ] && . /etc/sysconfig/$name
+
+# If this is set to 1, then when `stop` is called, if the process has
+# not exited within a reasonable time, SIGKILL will be sent next.
+# The default behavior is to simply log a message "program stop failed; still running"
+KILL_ON_STOP_TIMEOUT=0
+
+# When loading default and sysconfig files, we use `set -a` to make
+# all variables automatically into environment variables.
+set -a
+[ -r /etc/default/kibana ] && . /etc/default/kibana
+[ -r /etc/sysconfig/kibana ] && . /etc/sysconfig/kibana
+set +a
[ -z "$nice" ] && nice=0
@@ -40,9 +55,11 @@ emit() {
start() {
# Ensure the log directory is setup correctly.
- [ ! -d "/var/log/kibana/" ] && mkdir "/var/log/kibana/"
- chown "$user":"$group" "/var/log/kibana/"
- chmod 755 "/var/log/kibana/"
+ if [ ! -d "/var/log/kibana/" ]; then
+ mkdir "/var/log/kibana/"
+ chown "$user":"$group" "/var/log/kibana/"
+ chmod 755 "/var/log/kibana/"
+ fi
# Setup any environmental stuff beforehand
@@ -54,7 +71,7 @@ start() {
cd \"$chdir\"
exec \"$program\" $args
- " >> /var/log/kibana/kibana.stdout 2>> /var/log/kibana/kibana.stderr &
+ " >> /var/log/kibana/kibana-stdout.log 2>> /var/log/kibana/kibana-stderr.log &
# Generate the pidfile from here. If we instead made the forked process
# generate it there will be a race condition between the pidfile writing We might as well take advantage of the updates. Here are the commands I used:
|
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.
LGTM - let's move forward with the version of pleaserun we are on and we can bump in a subsequent PR