mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
packaging: changed how pid directory is created for systemd systems, #9133
This commit is contained in:
parent
4eabf6ce81
commit
5d3c3a6889
@ -42,12 +42,6 @@ case "$1" in
|
|||||||
IS_UPGRADE=true
|
IS_UPGRADE=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# make sure there is a /var/run/grafana dir on systemd systems
|
|
||||||
if [ -x /bin/systemctl ] ; then
|
|
||||||
mkdir -p $PID_FILE_DIR
|
|
||||||
chown -R $GRAFANA_USER:$GRAFANA_GROUP $PID_FILE_DIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "x$IS_UPGRADE" != "xtrue" ]; then
|
if [ "x$IS_UPGRADE" != "xtrue" ]; then
|
||||||
if command -v systemctl >/dev/null; then
|
if command -v systemctl >/dev/null; then
|
||||||
echo "### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd"
|
echo "### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd"
|
||||||
|
@ -12,6 +12,8 @@ Group=grafana
|
|||||||
Type=simple
|
Type=simple
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
WorkingDirectory=/usr/share/grafana
|
WorkingDirectory=/usr/share/grafana
|
||||||
|
RuntimeDirectory=grafana
|
||||||
|
RuntimeDirectoryMode=0750
|
||||||
ExecStart=/usr/sbin/grafana-server \
|
ExecStart=/usr/sbin/grafana-server \
|
||||||
--config=${CONF_FILE} \
|
--config=${CONF_FILE} \
|
||||||
--pidfile=${PID_FILE_DIR}/grafana-server.pid \
|
--pidfile=${PID_FILE_DIR}/grafana-server.pid \
|
||||||
|
@ -56,12 +56,6 @@ if [ $1 -eq 1 ] ; then
|
|||||||
find /etc/grafana -type f -exec chmod 640 {} ';'
|
find /etc/grafana -type f -exec chmod 640 {} ';'
|
||||||
find /etc/grafana -type d -exec chmod 755 {} ';'
|
find /etc/grafana -type d -exec chmod 755 {} ';'
|
||||||
|
|
||||||
# make sure there is a /var/run/grafana dir on systemd systems
|
|
||||||
if [ -x /bin/systemctl ] ; then
|
|
||||||
mkdir -p $PID_FILE_DIR
|
|
||||||
chown -R $GRAFANA_USER:$GRAFANA_GROUP $PID_FILE_DIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -x /bin/systemctl ] ; then
|
if [ -x /bin/systemctl ] ; then
|
||||||
echo "### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd"
|
echo "### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd"
|
||||||
echo " sudo /bin/systemctl daemon-reload"
|
echo " sudo /bin/systemctl daemon-reload"
|
||||||
@ -75,12 +69,6 @@ if [ $1 -eq 1 ] ; then
|
|||||||
echo " sudo service grafana-server start"
|
echo " sudo service grafana-server start"
|
||||||
fi
|
fi
|
||||||
elif [ $1 -ge 2 ] ; then
|
elif [ $1 -ge 2 ] ; then
|
||||||
# make sure there is a /var/run/grafana dir on systemd systems
|
|
||||||
if [ -x /bin/systemctl ] ; then
|
|
||||||
mkdir -p $PID_FILE_DIR
|
|
||||||
chown -R $GRAFANA_USER:$GRAFANA_GROUP $PID_FILE_DIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$RESTART_ON_UPGRADE" == "true" ]; then
|
if [ "$RESTART_ON_UPGRADE" == "true" ]; then
|
||||||
stopGrafana
|
stopGrafana
|
||||||
startGrafana
|
startGrafana
|
||||||
|
@ -12,6 +12,8 @@ Group=grafana
|
|||||||
Type=simple
|
Type=simple
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
WorkingDirectory=/usr/share/grafana
|
WorkingDirectory=/usr/share/grafana
|
||||||
|
RuntimeDirectory=grafana
|
||||||
|
RuntimeDirectoryMode=0750
|
||||||
ExecStart=/usr/sbin/grafana-server \
|
ExecStart=/usr/sbin/grafana-server \
|
||||||
--config=${CONF_FILE} \
|
--config=${CONF_FILE} \
|
||||||
--pidfile=${PID_FILE_DIR}/grafana-server.pid \
|
--pidfile=${PID_FILE_DIR}/grafana-server.pid \
|
||||||
|
Loading…
Reference in New Issue
Block a user