[pve-devel] [PATCH v4 container 3/4] switch to pve-container@ unit

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Oct 10 09:17:17 CEST 2017


Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 src/PVE/API2/LXC/Status.pm | 2 +-
 src/PVE/VZDump/LXC.pm      | 2 +-
 src/lxc-pve-poststop-hook  | 7 ++++---
 src/lxc-pve-reboot-trigger | 3 ++-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/PVE/API2/LXC/Status.pm b/src/PVE/API2/LXC/Status.pm
index 0d24ea6..2989e9b 100644
--- a/src/PVE/API2/LXC/Status.pm
+++ b/src/PVE/API2/LXC/Status.pm
@@ -191,7 +191,7 @@ __PACKAGE__->register_method({
 
 		    local $ENV{PVE_SKIPLOCK}=1 if $skiplock;
 
-		    my $cmd = ['systemctl', 'start', "lxc\@$vmid"];
+		    my $cmd = ['systemctl', 'start', "pve-container\@$vmid"];
 
 		    run_command($cmd);
 
diff --git a/src/PVE/VZDump/LXC.pm b/src/PVE/VZDump/LXC.pm
index 45a851c..f9616e0 100644
--- a/src/PVE/VZDump/LXC.pm
+++ b/src/PVE/VZDump/LXC.pm
@@ -260,7 +260,7 @@ sub stop_vm {
 sub start_vm {
     my ($self, $task, $vmid) = @_;
 
-    $self->cmd(['systemctl', 'start', "lxc\@$vmid"]);
+    $self->cmd(['systemctl', 'start', "pve-container\@$vmid"]);
 }
 
 sub suspend_vm {
diff --git a/src/lxc-pve-poststop-hook b/src/lxc-pve-poststop-hook
index 0396739..654aa26 100755
--- a/src/lxc-pve-poststop-hook
+++ b/src/lxc-pve-poststop-hook
@@ -77,9 +77,10 @@ __PACKAGE__->register_method ({
 	    # In order to make sure hot-plugged config changes aren't reverted
 	    # to what the monitor initially loaded we need to stop the container
 	    # and restart it.
-	    # Update the config and queue a restart of the lxc@$vmid task, note
-	    # that we must not block because we're part of the service cgroup
-	    # systemd waits for to die before issuing the new lxc-start command.
+	    # Update the config and queue a restart of the pve-container@$vmid
+	    # task, note that we must not block because we're part of the
+	    # service cgroup systemd waits for to die before issuing the new
+	    # lxc-start command.
 	    PVE::LXC::update_lxc_config($vmid, $conf);
 	    # Tell the post-stop hook we want to be restarted.
 	    open(my $fh, '>', "/var/lib/lxc/$vmid/reboot")
diff --git a/src/lxc-pve-reboot-trigger b/src/lxc-pve-reboot-trigger
index 95c3ac8..6e413ea 100755
--- a/src/lxc-pve-reboot-trigger
+++ b/src/lxc-pve-reboot-trigger
@@ -7,4 +7,5 @@ my $vmid = $ARGV[0] or exit(1);
 exit(0) if $vmid !~ /^\d+$/; # check for a PVE ID
 exit(0) if !-e "/etc/pve/lxc/${vmid}.conf";
 exit(0) if !unlink("/var/lib/lxc/$vmid/reboot");
-exec {'systemctl'} 'systemctl', '--no-block', 'restart', "lxc\@${vmid}.service";
+
+exec {'systemctl'} 'systemctl', '--no-block', 'restart', "pve-container\@${vmid}.service";
-- 
2.14.1





More information about the pve-devel mailing list