
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
Convert from command to launchd plist or from launchd plist to command
$ gem install launchd_tools
Output the command and arguments from a launchd plist:
$ launchd2cmd /path/to/launchd.plist [another/launchd.plist]
Create a launchd plist from a command and arguments:
$ cmd2launchd /path/to/daemon [arg] [-option]
####launchd2cmd with multiple directories:
$ launchd2cmd /System/Library/LaunchAgents /System/Library/LaunchDaemons
...
# /System/Library/LaunchDaemons/tftp.plist
/usr/libexec/tftpd -i /private/tftpboot
####launchd2cmd wildcards/globbing:
$ launchd2cmd /Library/Launch*/com.googlecode.munki.*
...
# /Library/LaunchDaemons/com.googlecode.munki.managedsoftwareupdate-manualcheck.plist
/usr/local/munki/supervisor --timeout 43200 -- /usr/local/munki/managedsoftwareupdate --manualcheck
####cmd2launchd creating a launchd plist skeleton:
$ cmd2launchd /usr/local/bin/daemond -d --mode foreground
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version='1.0'>
<dict>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/daemond</string>
<string>-d</string>
<string>--mode</string>
<string>foreground</string>
</array>
</dict>
</plist>
>> require 'launchd_tools/path'
=> false
>> sshd_plist_path =
LaunchdTools::Path.new("/System/Library/LaunchDaemons/ssh.plist")
=> #<LaunchdTools::Path:0x007f9a7b1a5f50
@path="/System/Library/LaunchDaemons/ssh.plist">
>> sshd_job = sshd_plist_path.parse
=> #<LaunchdTools::LaunchdJob:0x007f9a7aa6cc70
@attributes={"EnvironmentVariables"=>[],
"ProgramArguments"=>["/usr/sbin/sshd", "-i"]}>
>> sshd_job.program_arguments
=> ["/usr/sbin/sshd", "-i"]
>> require 'launchd_tools/launchd_plist'
=> true
>> plist = LaunchdTools::LaunchdPlist.new
=> #<LaunchdTools::LaunchdPlist:0x007fde1c434c78 @doc=<UNDEFINED> ...
</>, @program_args_array_element=<array/>>
>> plist.add_program_args(["/usr/local/bin/daemon", "-f", "-o",
"/var/log/daemon.log"])
=> ["/usr/local/bin/daemon", "-f", "-o", "/var/log/daemon.log"]
>> puts plist.to_s
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version='1.0'>
<dict>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/daemon</string>
<string>-f</string>
<string>-o</string>
<string>/var/log/daemon.log</string>
</array>
</dict>
</plist>
git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)FAQs
Unknown package
We found that launchd_tools demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.