Merge pull request #15422 from apainintheneck/update-service-documentation

formula-cookbook: update service docs
This commit is contained in:
Mike McQuaid 2023-05-16 17:24:13 +01:00 committed by GitHub
commit 83ab385281
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -881,9 +881,21 @@ There are two ways to add `launchd` plists and `systemd` services to a formula,
2. If the formula does not provide a service file you can generate one using the following stanza:
```ruby
# 1. An individual command
service do
run opt_bin/"script"
end
# 2. A command with arguments
service do
run [opt_bin/"script", "--config", etc/"dir/config.yml"]
end
# 3. OS specific commands (If you omit one, the service file won't get generated for that OS.)
service do
run macos: [opt_bin/"macos_script", "standalone"],
linux: var/"special_linux_script"
end
```
#### Service block methods