From 7795adfda4df27d041031bc96dffabf3e042138f Mon Sep 17 00:00:00 2001 From: Adam Tygart Date: Thu, 25 Jul 2024 14:23:14 -0500 Subject: [PATCH] systemd adapter fails with zsh as user shell (#834) zsh interprets the * in ondemand-* as a file path and returns an error if nothing is matched (unless the user has set 'setopt no_nomatch' in their .zshrc. Escape it to pass the asterisk on to systemctl (so it can be parsed internally). --- lib/ood_core/job/adapters/systemd/launcher.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ood_core/job/adapters/systemd/launcher.rb b/lib/ood_core/job/adapters/systemd/launcher.rb index fd558a8f1..fb9d5e19a 100644 --- a/lib/ood_core/job/adapters/systemd/launcher.rb +++ b/lib/ood_core/job/adapters/systemd/launcher.rb @@ -204,7 +204,7 @@ def unique_session_name # List all Systemd sessions on destination_host started by this adapter def list_remote_systemd_session(destination_host) - cmd = ssh_cmd(destination_host, ['systemctl', '--user', 'show', '-t', 'service', '--state=running', "#{session_name_label}-*"]) + cmd = ssh_cmd(destination_host, ['systemctl', '--user', 'show', '-t', 'service', '--state=running', "#{session_name_label}-\\*"]) # individual units are separated with an empty line call(*cmd).split("\n\n").map do |oneunit|