[pve-devel] [PATCH] When starting in debug mode,	starts the daemon without going through systemctl
    Emmanuel Kasper 
    e.kasper at proxmox.com
       
    Tue May  3 12:43:12 CEST 2016
    
    
  
This fixes the problem that debug options for daemons were ignored and sets
the following behaviour for the daemons when -debug 1 is given
 * start on foreground with debug ouput on the console
 * do not start a sytemd unit
Starting the systemd unit in debug mode makes less sense because:
 * systemd will put the daemon in the background
 * systemd ignores environment variables so the only way to start
 the daemon with options would be through reading a config file
tested with pveproxy, pve-ha-lrm, pve-ha-crm
---
 src/PVE/Daemon.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/PVE/Daemon.pm b/src/PVE/Daemon.pm
index f81e589..9d72c32 100644
--- a/src/PVE/Daemon.pm
+++ b/src/PVE/Daemon.pm
@@ -669,7 +669,7 @@ sub register_start_command {
 	code => sub {
 	    my ($param) = @_;
 
-            if (&$init_ppid()) {
+            if (&$init_ppid() || $param->{debug}) {
                 $self->start($param->{debug});
             } else {
                 PVE::Tools::run_command(['systemctl', 'start', $self->{name}]);
-- 
2.1.4
    
    
More information about the pve-devel
mailing list