Commit 840a78d
authored
Provide More Intuitive Behaviour for Launchd Services (#40)
* fix: use correct logic for launchd restart policies
For the `OnSuccess` case, the logic was actually inverted, so the service was restarting when the
exit was *not* successful. This has now been corrected.
The logic we were previously using for the `OnSuccess` case has now been applied to the `OnFailure`
case, so we now support that scenario rather than emitting a warning saying we don't support it.
A comment clarifies that when the `SuccessfulExit` construct is *not* used, this is effectively the
`Always` policy.
* feat: prevent launchd services starting when keepalive is used
When the service definition includes the `KeepAlive` setting it causes services to automatically
start when `launchctl load` is used. This is quite unintuitive and is not how services behave on
other platforms.
We now make use of the `Disabled` setting to prevent the service starting automatically and make it
behave like service managers on other platforms. This is desirable when you want to add many
services first and not have them all start at the same time, which is the case for our application.
It also seems to be the behaviour most of our users expect and I personally think makes most sense.
* chore(release): bump to version 0.10.01 parent 6eba67e commit 840a78d
File tree
5 files changed
+94
-18
lines changed- src
- system-tests/tests
5 files changed
+94
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
10 | 26 | | |
11 | 27 | | |
12 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
| |||
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
156 | | - | |
157 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
158 | 201 | | |
159 | 202 | | |
160 | 203 | | |
| |||
312 | 355 | | |
313 | 356 | | |
314 | 357 | | |
| 358 | + | |
| 359 | + | |
315 | 360 | | |
316 | 361 | | |
317 | 362 | | |
| |||
321 | 366 | | |
322 | 367 | | |
323 | 368 | | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
329 | 375 | | |
330 | 376 | | |
331 | 377 | | |
| |||
334 | 380 | | |
335 | 381 | | |
336 | 382 | | |
337 | | - | |
338 | | - | |
| 383 | + | |
| 384 | + | |
339 | 385 | | |
340 | | - | |
| 386 | + | |
341 | 387 | | |
342 | 388 | | |
343 | 389 | | |
| |||
378 | 424 | | |
379 | 425 | | |
380 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
381 | 440 | | |
382 | 441 | | |
383 | 442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
| |||
133 | 132 | | |
134 | 133 | | |
135 | 134 | | |
136 | | - | |
| 135 | + | |
137 | 136 | | |
138 | 137 | | |
139 | 138 | | |
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
143 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
151 | | - | |
| 152 | + | |
152 | 153 | | |
153 | | - | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
0 commit comments