Skip to content

Commit

Permalink
[deb/rpm] manage pid folder (#68262)
Browse files Browse the repository at this point in the history
* [deb/rpm] manage pid folder

This adds a tmpfiles.d configuration file for systemd users, and changes
the path for both systemd and sysv to /var/run/kibana/kibana.pid.  pid
file generation is left unmodified for a future pr.

* cleanup

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
jbudz and elasticmachine authored Jun 8, 2020
1 parent 858523e commit 1e45e98
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/dev/build/tasks/os_packages/run_fpm.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ export async function runFpm(config, log, build, type, pkgSpecificFlags) {
// copy the data directory at /var/lib/kibana
`${resolveWithTrailingSlash(fromBuild('data'))}=/var/lib/kibana/`,

// copy the generated pleaserun services for systemd and sysv into /etc/
`${resolveWithTrailingSlash(__dirname, 'service_templates/sysv/etc')}=/etc/`,
`${resolveWithTrailingSlash(__dirname, 'service_templates/systemd/etc')}=/etc/`,
// copy package configurations
`${resolveWithTrailingSlash(__dirname, 'service_templates/sysv/')}=/`,
`${resolveWithTrailingSlash(__dirname, 'service_templates/systemd/')}=/`,
];

log.debug('calling fpm with args:', args);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d /var/run/kibana 0755 kibana kibana - -
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

name=kibana
program=/usr/share/kibana/bin/kibana
pidfile="/var/run/$name.pid"
pidfile="/var/run/kibana/$name.pid"

[ -r /etc/default/$name ] && . /etc/default/$name
[ -r /etc/sysconfig/$name ] && . /etc/sysconfig/$name
Expand All @@ -37,17 +37,13 @@ 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/"


# Setup any environmental stuff beforehand


# Run the program!
[ ! -d "/var/run/kibana/" ] && mkdir "/var/run/kibana/"
chown "$user":"$group" "/var/run/kibana/"
chmod 755 "/var/run/kibana/"

chroot --userspec "$user":"$group" "$chroot" sh -c "
Expand Down

0 comments on commit 1e45e98

Please sign in to comment.