From b81ef751b4fbb8d3f53432d536102045a31e4700 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Thu, 22 Nov 2007 13:51:17 +0000
Subject: [PATCH] Create /var/run/ganeti before noded startup

The /var/run directory can be a tmpfs mount, so even if we make it at
install time (or include it in the package) it can go away. Therefore,
test for its existence and create it in the startup script.

Reviewed-by: imsnah
---
 doc/examples/ganeti.initd.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/doc/examples/ganeti.initd.in b/doc/examples/ganeti.initd.in
index a1813235d..4525952b1 100644
--- a/doc/examples/ganeti.initd.in
+++ b/doc/examples/ganeti.initd.in
@@ -17,6 +17,7 @@ NAME=ganeti-noded
 NODED=@PREFIX@/sbin/ganeti-noded
 MASTER=@PREFIX@/sbin/ganeti-master
 SCRIPTNAME=@SYSCONFDIR@/init.d/ganeti
+RUNDIR="@LOCALSTATEDIR@/run/ganeti"
 
 test -f $NODED || exit 0
 
@@ -55,6 +56,7 @@ case "$1" in
     start)
         log_daemon_msg "Starting $DESC" "$NAME"
         check_config
+        test -e "$RUNDIR" || mkdir -p "$RUNDIR"
         if start-stop-daemon --start --quiet --exec $NODED; then
             log_end_msg 0
         else
-- 
GitLab