[pve-devel] r5566 - in pve-manager/pve2: lib/PVE lib/PVE/API2 www/manager

svn-commits at proxmox.com svn-commits at proxmox.com
Fri Feb 18 08:01:00 CET 2011


Author: dietmar
Date: 2011-02-18 08:01:00 +0100 (Fri, 18 Feb 2011)
New Revision: 5566

Modified:
   pve-manager/pve2/lib/PVE/API2/Services.pm
   pve-manager/pve2/lib/PVE/REST.pm
   pve-manager/pve2/www/manager/NodeConfig.js
Log:
add pve-cluster service


Modified: pve-manager/pve2/lib/PVE/API2/Services.pm
===================================================================
--- pve-manager/pve2/lib/PVE/API2/Services.pm	2011-02-18 06:45:59 UTC (rev 5565)
+++ pve-manager/pve2/lib/PVE/API2/Services.pm	2011-02-18 07:01:00 UTC (rev 5566)
@@ -25,6 +25,7 @@
     cron => { name => 'CRON', desc => 'Daemon to execute scheduled commands' },
     pvedaemon => { name => 'NodeManager', desc => 'PVE node manager daemon' },
     corosync => { name => 'Corosync', desc => 'Corosync cluster daemon' },
+    pvecluster => { name => 'PVECluster', desc => 'Proxmox VE cluster file system' },
 };
 
 my $service_cmd = sub {
@@ -39,18 +40,24 @@
 
     if ($service eq 'postfix') {
 	$initd_cmd = '/etc/init.d/postfix';
+    } elsif ($service eq 'pvecluster') {
+	if ($cmd eq 'restart') {    
+	    $initd_cmd = '/etc/init.d/pve-cluster';
+	} else {
+	    die "invalid service cmd 'pve-cluster $cmd': ERROR";
+	}
     } elsif ($service eq 'pvedaemon') {
 	if ($cmd eq 'restart') {    
 	    $initd_cmd = '/etc/init.d/pvedaemon';
 	} else {
-	    die "invalid service cmd 'pvedaemon $cmd': ERROR";
+	    die "invalid service cmd '$service $cmd': ERROR";
 	}
     } elsif  ($service eq 'apache') {
 	if ($cmd eq 'restart') {    
 	    $initd_cmd = '/usr/sbin/apache2ctl';
 	    $cmd = 'graceful';
 	} else {
-	    die "invalid service cmd 'apache $cmd': ERROR";
+	    die "invalid service cmd '$service $cmd': ERROR";
 	}
     } elsif  ($service eq 'ntpd') {
 	# debian start/stop scripts does not work for us
@@ -94,6 +101,8 @@
 	$pid_file = '/var/run/apache2.pid';
     } elsif  ($service eq 'pvedaemon') {
 	$pid_file = '/var/run/pvedaemon.pid';
+    } elsif  ($service eq 'pvecluster') {
+	$pid_file = '/var/run/pve-cluster.pid';
     } elsif  ($service eq 'ntpd') {
 	$pid_file = '/var/run/ntpd.pid';
     } elsif  ($service eq 'sshd') {

Modified: pve-manager/pve2/lib/PVE/REST.pm
===================================================================
--- pve-manager/pve2/lib/PVE/REST.pm	2011-02-18 06:45:59 UTC (rev 5565)
+++ pve-manager/pve2/lib/PVE/REST.pm	2011-02-18 07:01:00 UTC (rev 5566)
@@ -451,7 +451,7 @@
 sub handler {
      my($r) = @_;
 
-     syslog('info', "perl handler called");
+     #syslog('info', "perl handler called");
 
      my $method = $r->method;
 
@@ -506,7 +506,7 @@
      $r->headers_out()->add('Content-Length', length($raw));
      $r->print($raw);
     
-     syslog('info', "perl handler end $res->{status}");
+     #syslog('info', "perl handler end $res->{status}");
 
      return OK;
 }

Modified: pve-manager/pve2/www/manager/NodeConfig.js
===================================================================
--- pve-manager/pve2/www/manager/NodeConfig.js	2011-02-18 06:45:59 UTC (rev 5565)
+++ pve-manager/pve2/www/manager/NodeConfig.js	2011-02-18 07:01:00 UTC (rev 5566)
@@ -846,7 +846,9 @@
 	sm.on('rowselect', function(selm, row, record) {
 	    var service = record.data.service;
 	    var state = record.data.state;
-	    if (service == 'apache' || service == 'pvedaemon') {
+	    if (service == 'apache' ||
+		service == 'pvecluster' ||
+		service == 'pvedaemon') {
 		if (state == 'running') {
 		    start_btn.disable();
 		    restart_btn.enable();



More information about the pve-devel mailing list