From 25f83ee522ff65c687abd384f29f2a1580c13bc0 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Mon, 6 Jan 2025 16:58:40 -0500 Subject: [PATCH] Drop the interpreter for execution in the service file The waagent script is executable and has the interpreter set. Drop the use of the Python interpreter to execute the file from the systemd unit file. We achieve unbuffered I/O by setting the PYTHONUNBUFFERED environment variable instead. This makes it easier for distribution packaging as packagers will only have to update the pathto the interpreter used on the given distro in one file. --- init/waagent.service | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init/waagent.service b/init/waagent.service index e91f1433b..be2eca200 100644 --- a/init/waagent.service +++ b/init/waagent.service @@ -8,7 +8,8 @@ ConditionPathExists=/etc/waagent.conf [Service] Type=simple -ExecStart=/usr/bin/python -u /usr/sbin/waagent -daemon +Environment="PYTHONUNBUFFERED=true" +ExecStart=/usr/sbin/waagent -daemon Restart=always RestartSec=5