]>
git.proxmox.com Git - pve-container.git/blob - src/pve-container-stop-wrapper
7 my $vmid = $ARGV[0] or exit(1);
8 exit(0) if $vmid !~ /^\d+$/;
9 exit(0) if !-e
"/etc/pve/lxc/${vmid}.conf";
11 if (unlink("/var/lib/lxc/$vmid/reboot")) {
12 # restart if rebooted from within container
13 exec {'systemctl'} 'systemctl', '--no-block', 'restart', "pve-container\@${vmid}.service";
14 } elsif (!defined($ENV{EXIT_CODE
}) || $ENV{EXIT_CODE
} ne "exited") {
15 # stop if called via "systemctl stop lxc@ID"
16 exec {'lxc-stop'} 'lxc-stop', '-n', $vmid;
18 # just exit if container was shutdown from within or via lxc-stop