[pve-devel] r6135 - in pve-cluster/trunk: data/perl debian

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Jun 21 14:38:18 CEST 2011


Author: dietmar
Date: 2011-06-21 14:38:18 +0200 (Tue, 21 Jun 2011)
New Revision: 6135

Modified:
   pve-cluster/trunk/data/perl/Cluster.pm
   pve-cluster/trunk/debian/init.d
Log:
fix startup


Modified: pve-cluster/trunk/data/perl/Cluster.pm
===================================================================
--- pve-cluster/trunk/data/perl/Cluster.pm	2011-06-21 12:33:17 UTC (rev 6134)
+++ pve-cluster/trunk/data/perl/Cluster.pm	2011-06-21 12:38:18 UTC (rev 6135)
@@ -65,14 +65,17 @@
 
     check_cfs_is_mounted();
 
-    my $dir = "$basedir/nodes/$nodename";
-    if (! -d $dir) {
-	mkdir($dir) || die "unable to create directory '$dir' - $!\n";
+    my @required_dirs = (
+	"$basedir/priv",
+	"$basedir/nodes", 
+	"$basedir/nodes/$nodename",
+	"$basedir/nodes/$nodename/priv");
+	       
+    foreach my $dir (@required_dirs) {
+	if (! -d $dir) {
+	    mkdir($dir) || die "unable to create directory '$dir' - $!\n";
+	}
     }
-    $dir = "$dir/priv";
-    if (! -d $dir) {
-	mkdir($dir) || die "unable to create directory '$dir' - $!\n";
-    }
 }
 
 sub gen_auth_key {

Modified: pve-cluster/trunk/debian/init.d
===================================================================
--- pve-cluster/trunk/debian/init.d	2011-06-21 12:33:17 UTC (rev 6134)
+++ pve-cluster/trunk/debian/init.d	2011-06-21 12:38:18 UTC (rev 6135)
@@ -58,9 +58,6 @@
 
 start_server() {
 
-    # make sure we have the fuse module 
-    modprobe -q fuse || /bin/true
-
     start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -q $DAEMON_OPTS
     errcode=$?
     return $errcode
@@ -83,7 +80,11 @@
             exit 0
         fi
 	errcode=0
-        start_server || errcode=$? 
+        start_server || errcode=$?
+	# try to create required directories
+	if [ $errcode -eq 0 ] ; then
+	    /usr/bin/pvecert || true
+	fi
         log_end_msg $errcode
 	;;
     stop)



More information about the pve-devel mailing list