43 Commits

Author SHA1 Message Date
Mike McQuaid
85a1b79154
service: fix typo. 2023-04-03 08:41:21 +01:00
apainintheneck
39092fa629 service: handle string run cmd
This was not handled at all during deserialization.
The string argument gets turned into an array internally
but we skip that to preserve all args in the @run_params
variable. That means that we have to handle strings when
deserializing too.
2023-03-31 20:33:21 -07:00
apainintheneck
801ee5e474 Address feedback
- style nits
- better comments for tests that are not idempotent
- moved appdir placeholder constant to global.rb
2023-03-22 19:43:49 -07:00
apainintheneck
bc85857e13 service: make serialization non-recursive
This helps with type annotations and makes it easier to
reason about the code as well.
2023-03-21 23:20:49 -07:00
apainintheneck
db8d488db4 service: add info to API json and load from api
As a part of serializing the hash, certain path
placeholders are used for the HOMEBREW_PREFIX and $HOME
directories. Beyond that certain elements need to be
turned back into strings like cron and sockets and symbols
need to be preserved as well.

The run command accepts either an arg or kwargs so it
has to be treated specially here.
2023-03-19 00:09:10 -07:00
DenizUgur
f4ed502350 run_at_load set to true by default 2023-02-23 10:15:06 -08:00
DenizUgur
66fe6d4169 remove onActiveSec 2023-02-15 09:49:08 -08:00
DenizUgur
16b51d2a43 revert type check 2023-02-14 04:24:26 -08:00
DenizUgur
d80d94ab28 comments 2023-02-14 03:55:45 -08:00
DenizUgur
a9d1ee44c8 suggestion for linux compatibility 2023-02-14 02:24:20 -08:00
DenizUgur
ff748ea030 change the default run_at_load value 2023-02-14 01:04:34 -08:00
DenizUgur
7d19ef7070 dedicated 'RunAtLoad' property 2023-02-13 23:19:34 -08:00
Dawid Dziurla
0d0c98de29
Allow defining service run command per platform 2023-01-19 11:36:37 +01:00
Sean Molenaar
d477d1663a
Service: add method to define a root requirement 2022-11-06 13:52:53 +01:00
Sean Molenaar
d70d837687
service: use default.target on Linux 2022-10-07 20:22:12 +02:00
Mike McQuaid
59692b5bf4
service: provide formula accessor.
Use `f` because it's generally recognised as a formula and this
shouldn't be widely needed/used.
2022-08-16 08:35:33 +01:00
Mike McQuaid
6b697470fd
brew style --fix
For https://github.com/Homebrew/brew/pull/13671
2022-08-10 14:19:33 +01:00
GottemHams
dec8577d18 Comply with style checks 2022-07-03 16:24:05 +02:00
GottemHams
dca1d8b52c Added session type to macOS service plist 2022-07-03 15:56:49 +02:00
Mike McQuaid
2d5eab2e1c
brew style --fix 2022-06-30 08:56:21 +01:00
Sean Molenaar
3d5d12e8b9
service: add sockets and keepalive variants 2022-04-12 12:17:27 +02:00
apainintheneck
62de156c40 Added Service#keep_alive? method 2022-03-11 12:42:41 -08:00
NickHackman
12bf07a6ba service: systemd launch_only_once
Set the type of service to oneshot if launch_only_once is provided; otherwise, simple.
2022-02-12 17:26:09 -05:00
NickHackman
9f4949c8c6 service: LaunchOnlyOnce plist test 2022-02-11 14:46:47 -06:00
NickHackman
dbb23739b0 service(MacOS): launch only once 2022-02-04 11:37:29 -06:00
Sean Molenaar
302975829d
service: add basic cron support 2021-11-30 14:29:22 +01:00
Sean Molenaar
4cb8afeeef
service: add timer support for systemd 2021-11-30 11:05:11 +01:00
Sean Molenaar
25bc1d8860
Service: add interval support 2021-11-06 13:18:58 +01:00
valrus
698f4a8f69 Add process_type to service DSL
This enables mpd to be run with the "Interactive" value, which avoids
performance issues such as skipping when playing music. See this PR,
where this was done previously:
https://github.com/Homebrew/homebrew-core/pull/19410

The ProcessType plist key was lost in the conversion to the service DSL:
483ad1fdfa
2021-09-09 17:37:49 -07:00
Dawid Dziurla
9657303ed2
Merge pull request #11492 from SMillerDev/fix/service/add_linux_target
service: add install block to unit
2021-06-08 02:14:01 +02:00
Sean Molenaar
8250f73383
service: add install block to unit 2021-06-05 17:59:17 +02:00
Sean Molenaar
3ce5737425
service: ensure environment variables are strings 2021-05-25 20:52:51 +02:00
Sean Molenaar
4f013526cf
service: simplify Environment= creation
Co-authored-by: Bo Anderson <mail@boanderson.me>
2021-05-25 11:49:22 +02:00
Sean Molenaar
ef9c49c5b2
service: ensure environment variables are prefixed in command 2021-05-25 11:47:44 +02:00
Sean Molenaar
e29b2caee0
service: define paths as expecting Pathname or string
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
2021-05-24 14:20:46 +02:00
Sean Molenaar
fceaa2bb74
Service: add additional options 2021-05-22 18:17:36 +02:00
Nanda H Krishna
346621dd5b
service: delegate more path methods 2021-05-10 00:10:42 +05:30
Sean Molenaar
d4197835bb
services: fix array being flattened 2021-04-29 09:43:39 +02:00
Sean Molenaar
2ec4125178
Audit: make sure service commands exist 2021-04-27 09:36:36 +02:00
Sean Molenaar
0e93f728a6
Service: generate systemd unit file 2021-04-16 08:58:49 +02:00
Mike McQuaid
1ab2726e76
Cleanup service plist code. 2021-04-09 13:30:43 +01:00
Sean Molenaar
b927ecfd85
Fix formulae method loading
Co-authored-by: nandahkrishna <me@nandahkrishna.com>
2021-04-08 10:16:57 +02:00
Sean Molenaar
4427fa283f
formula: allow plists to be generated 2021-04-08 10:16:57 +02:00