Recreate /var/run/influxdb dir upon recovery

This update fixes an issue where the /var/run/influxdb directory
is not being re-created over a DOR because the controller manifest that
creates it is not being run in that recovery mode.

The fix is to enhance the influxdb service file to ensure this directory
is created whenever the service is started.

Story: 2002823
Task: 22740

Change-Id: Iecd81969ae1611b963fae5595f60c3eb2d2da851
Signed-off-by: Jack Ding <jack.ding@windriver.com>
This commit is contained in:
Eric MacDonald 2018-06-04 14:43:40 -04:00 committed by Jack Ding
parent c585f46890
commit 279e0d38e9
1 changed files with 3 additions and 0 deletions

View File

@ -11,6 +11,9 @@ LimitNOFILE=65536
Environment='STDOUT=/dev/null'
Environment='STDERR=/var/log/influxdb/influxd.log'
EnvironmentFile=-/etc/default/influxdb
PermissionsStartOnly=true
ExecStartPre=-/usr/bin/mkdir -p /var/run/influxdb
ExecStartPre=-/usr/bin/chown influxdb:influxdb /var/run/influxdb
ExecStart=/bin/sh -c "/usr/bin/influxd -config /etc/influxdb/influxdb.conf -pidfile /var/run/influxdb/influxdb.pid ${INFLUXD_OPTS} >> ${STDOUT} 2>> ${STDERR}"
ExecStopPost=/bin/bash -c 'rm /var/run/influxdb/influxdb.pid'
KillMode=control-group