[pve-devel] [PATCH container 18/20] pve-container at .service: switch to foreground mode

w.bumiller at proxmox.com w.bumiller at proxmox.com
Fri Apr 3 16:37:38 CEST 2020


From: Wolfgang Bumiller <w.bumiller at proxmox.com>

And use StandardOutput/Error=null, so we can use
`Type=simple`. Because using `Type=forking` has become more
difficult with systemd & upstream lxc's cgroup layout
changes. This seems to be the path of least resistance.

Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 src/pve-container at .service | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/pve-container at .service b/src/pve-container at .service
index 4b68f7e..d9185bc 100644
--- a/src/pve-container at .service
+++ b/src/pve-container at .service
@@ -1,19 +1,22 @@
-# based on lxc at .service, but without any dependencies because
+# based on lxc at .service, but without an install section because
 # starting and stopping should be initiated by PVE code, not
 # systemd.
 [Unit]
 Description=PVE LXC Container: %i
 DefaultDependencies=No
+After=lxc.service
+Wants=lxc.service
 Documentation=man:lxc-start man:lxc man:pct
 
 [Service]
-Type=forking
+Type=simple
 Delegate=yes
 KillMode=mixed
 TimeoutStopSec=120s
-ExecStart=/usr/bin/lxc-start -n %i
+ExecStart=/usr/bin/lxc-start -F -n %i
 ExecStop=/usr/share/lxc/pve-container-stop-wrapper %i
 # Environment=BOOTUP=serial
 # Environment=CONSOLETYPE=serial
-StandardOutput=syslog
-StandardError=syslog
+# Prevent container init from putting all its output into the journal
+StandardOutput=null
+StandardError=null
-- 
2.20.1





More information about the pve-devel mailing list