mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
generic-worker on macOS: restart service on config change
This commit is contained in:
parent
70f507879f
commit
a5089885ac
1 changed files with 16 additions and 4 deletions
|
@ -44,12 +44,27 @@
|
||||||
clientId: {{ pillar["client_id"] }}
|
clientId: {{ pillar["client_id"] }}
|
||||||
accessToken: {{ pillar["access_token"] }}
|
accessToken: {{ pillar["access_token"] }}
|
||||||
livelogSecret: {{ pillar["livelog_secret"] }}
|
livelogSecret: {{ pillar["livelog_secret"] }}
|
||||||
|
- watch_in:
|
||||||
|
- service: net.generic.worker
|
||||||
|
|
||||||
{{ bin }}/generic-worker new-openpgp-keypair --file {{ home }}/key:
|
{{ bin }}/generic-worker new-openpgp-keypair --file {{ home }}/key:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
- creates: {{ home }}/key
|
- creates: {{ home }}/key
|
||||||
- runas: worker
|
- runas: worker
|
||||||
|
|
||||||
|
{{ home }}/run:
|
||||||
|
file.managed:
|
||||||
|
- mode: 744
|
||||||
|
- user: {{ user }}
|
||||||
|
- template: jinja
|
||||||
|
- contents: |-
|
||||||
|
#!/bin/sh
|
||||||
|
# generic-worker overwrites its config file to fill in defaults,
|
||||||
|
# but we want to avoid touching config.json here
|
||||||
|
# so that SaltStack knows to (only) restart the service when it (really) changes.
|
||||||
|
cp -a config.json config-run.json
|
||||||
|
exec {{ bin }}/generic-worker run --config config-run.json
|
||||||
|
|
||||||
/Library/LaunchAgents/net.generic.worker.plist:
|
/Library/LaunchAgents/net.generic.worker.plist:
|
||||||
file.managed:
|
file.managed:
|
||||||
- mode: 644
|
- mode: 644
|
||||||
|
@ -64,10 +79,7 @@
|
||||||
|
|
||||||
<key>ProgramArguments</key>
|
<key>ProgramArguments</key>
|
||||||
<array>
|
<array>
|
||||||
<string>{{ bin }}/generic-worker</string>
|
<string>{{ home }}/run</string>
|
||||||
<string>run</string>
|
|
||||||
<string>--config</string>
|
|
||||||
<string>config.json</string>
|
|
||||||
</array>
|
</array>
|
||||||
|
|
||||||
<key>KeepAlive</key>
|
<key>KeepAlive</key>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue