diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2018-11-12 21:23:30 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2018-11-15 17:38:13 +0100 |
commit | a5089885acda9f67e956c08e126715693fcc0715 (patch) | |
tree | 83cf122f42ab0872976b26eb976b923240c99ac2 /etc/taskcluster/macos | |
parent | 70f507879ff00aa7d649af344be98a628b1de5af (diff) | |
download | servo-a5089885acda9f67e956c08e126715693fcc0715.tar.gz servo-a5089885acda9f67e956c08e126715693fcc0715.zip |
generic-worker on macOS: restart service on config change
Diffstat (limited to 'etc/taskcluster/macos')
-rw-r--r-- | etc/taskcluster/macos/states/generic-worker.sls | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/etc/taskcluster/macos/states/generic-worker.sls b/etc/taskcluster/macos/states/generic-worker.sls index c7d628dc1d8..c10e0c54002 100644 --- a/etc/taskcluster/macos/states/generic-worker.sls +++ b/etc/taskcluster/macos/states/generic-worker.sls @@ -44,12 +44,27 @@ clientId: {{ pillar["client_id"] }} accessToken: {{ pillar["access_token"] }} livelogSecret: {{ pillar["livelog_secret"] }} + - watch_in: + - service: net.generic.worker {{ bin }}/generic-worker new-openpgp-keypair --file {{ home }}/key: cmd.run: - creates: {{ home }}/key - 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: file.managed: - mode: 644 @@ -64,10 +79,7 @@ <key>ProgramArguments</key> <array> - <string>{{ bin }}/generic-worker</string> - <string>run</string> - <string>--config</string> - <string>config.json</string> + <string>{{ home }}/run</string> </array> <key>KeepAlive</key> |