I'm trying to install an OSX LaunchDaemon using python but calling launchctl using subprocess.Popen doesn't actually install the service.
I have the plist file in /Library/LaunchDaemons/ and I can load the plist file just fine using the terminal:
$ launchctl load -w /Library/LaunchDaemons/com.myplist.file.plist
$ launchctl start com.myplist.file
$ launchctl list
"- 0 com.myplist.file"
The service loads and starts properly through the command line, meaning my plist file is correctly set up, But the problem starts when I execute the same commands with python subprocess.Popen or any python system call command.
# Load the service command = shlex.split("launchctl load -w /Library/LaunchDaemons/com.myplist.file.plist") subprocess.Popen(command) # Start the service command = shlex.split("launchctl start com.myplist.file") subprocess.Popen(command) I've also tried setting shell=True but no luck. Any thoughts or ideas on this?