mirror of
https://github.com/libvirt/libvirt.git
synced 2026-08-17 00:24:42 -05:00
run: detect daemons when run via wrapper commands
The run script tries to detect when a daemon is being run in order to shutdown other systemd unit files that clash. As implemented this only works if the daemon name is the first argument. This won't be the case if running via GDB or strace eg ./run strace -e trace=openat ./build/src/virtqemud We need to check all argv to find which might be a daemon path/name. Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
@@ -130,9 +130,9 @@ def change_unit(name, action):
|
||||
|
||||
try_stop_units = []
|
||||
if is_systemd_host():
|
||||
name = os.path.basename(prog)
|
||||
|
||||
maybe_stopped_units = []
|
||||
for arg in sys.argv:
|
||||
name = os.path.basename(arg)
|
||||
if is_modular_daemon(name):
|
||||
# Only need to stop libvirtd or this specific modular unit
|
||||
maybe_stopped_units += daemon_units("libvirtd")
|
||||
|
||||
Reference in New Issue
Block a user