sby_core: fix hardcoded /bin/bash path
authorSerge Bazanski <serge@bazanski.pl>
Wed, 24 Jul 2019 11:31:37 +0000 (13:31 +0200)
committerSerge Bazanski <serge@bazanski.pl>
Wed, 24 Jul 2019 11:31:37 +0000 (13:31 +0200)
Not all systems (eg. BSDs, NixOS) have a /bin/bash. The de-facto standard for maximum compatibility
these days is using /usr/bin/env bash.

sbysrc/sby_core.py

index 54e6c179454dd72513b5397228ed9d6162311104..98f40325f18f5d51c5f0dc63bcb04ac731b16feb 100644 (file)
@@ -135,7 +135,7 @@ class SbyTask:
                     signal.signal(signal.SIGINT, signal.SIG_IGN)
                     os.setpgrp()
 
-                self.p = subprocess.Popen(["/bin/bash", "-c", self.cmdline], stdin=subprocess.DEVNULL, stdout=subprocess.PIPE,
+                self.p = subprocess.Popen(["/usr/bin/env", "bash", "-c", self.cmdline], stdin=subprocess.DEVNULL, stdout=subprocess.PIPE,
                         stderr=(subprocess.STDOUT if self.logstderr else None), preexec_fn=preexec_fn)
 
                 fl = fcntl.fcntl(self.p.stdout, fcntl.F_GETFL)