From 279e0d38e9125b3fc652b970ca93306f92f58a80 Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Mon, 4 Jun 2018 14:43:40 -0400 Subject: [PATCH] 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 --- monitoring/influxdb-extensions/src/influxdb.service | 3 +++ 1 file changed, 3 insertions(+) diff --git a/monitoring/influxdb-extensions/src/influxdb.service b/monitoring/influxdb-extensions/src/influxdb.service index 6e61df465..2d3104873 100644 --- a/monitoring/influxdb-extensions/src/influxdb.service +++ b/monitoring/influxdb-extensions/src/influxdb.service @@ -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