multiple commands in one launchd item
Hi, Just spent *hours* experimenting with this and although it is possible to add several commands into a LaunchDaemon using the previously mention ProgramArguments from Damien i.e. /bin/bash -c *code* as separate items, you can only use one item line for the entire script. It's not long before it becomes unreadable. All-in all, as Nehemiah mentioned, if it can go into a script, it probably should go into a script. However, all LaunchDaemon external scripts should have the same level of permissions as a LaunchDaemon plist file. Otherwise it's a potential security threat. The contents of the external file could be changed to whatever. The owner/group should be root/wheel and the mode 0755. A.
On Dec 13, 2009, at 8:05 PM, dev.admin@ntlworld.com wrote:
Hi,
Just spent *hours* experimenting with this and although it is possible to add several commands into a LaunchDaemon using the previously mention ProgramArguments from Damien i.e. /bin/bash -c *code* as separate items, you can only use one item line for the entire script. It's not long before it becomes unreadable.
All-in all, as Nehemiah mentioned, if it can go into a script, it probably should go into a script.
However, all LaunchDaemon external scripts should have the same level of permissions as a LaunchDaemon plist file. Otherwise it's a potential security threat. The contents of the external file could be changed to whatever.
The owner/group should be root/wheel and the mode 0755.
launchd will enforce the required ownership. -- Damien Sorresso BSD Engineering Apple Inc.
participants (2)
-
Damien Sorresso
-
dev.admin@ntlworld.com