diff --git a/src/dev/build/tasks/os_packages/run_fpm.js b/src/dev/build/tasks/os_packages/run_fpm.js index c49ff01b24086..0496bcf08fb91 100644 --- a/src/dev/build/tasks/os_packages/run_fpm.js +++ b/src/dev/build/tasks/os_packages/run_fpm.js @@ -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); diff --git a/src/dev/build/tasks/os_packages/service_templates/systemd/usr/lib/tmpfiles.d/kibana.conf b/src/dev/build/tasks/os_packages/service_templates/systemd/usr/lib/tmpfiles.d/kibana.conf new file mode 100644 index 0000000000000..b5422df52fe11 --- /dev/null +++ b/src/dev/build/tasks/os_packages/service_templates/systemd/usr/lib/tmpfiles.d/kibana.conf @@ -0,0 +1 @@ +d /var/run/kibana 0755 kibana kibana - - \ No newline at end of file diff --git a/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana b/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana index ce29fd12b8e3c..d935dc6e31f80 100755 --- a/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana +++ b/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana @@ -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 @@ -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 "