From dca1d8b52c778f4189a08060736c80987a854966 Mon Sep 17 00:00:00 2001 From: GottemHams Date: Sun, 3 Jul 2022 15:56:49 +0200 Subject: [PATCH] Added session type to macOS service plist --- Library/Homebrew/service.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Library/Homebrew/service.rb b/Library/Homebrew/service.rb index 6ba9919862..25b57cd319 100644 --- a/Library/Homebrew/service.rb +++ b/Library/Homebrew/service.rb @@ -376,6 +376,13 @@ module Homebrew base[:StartCalendarInterval] = @cron.reject { |_, value| value == "*" } end + # Adding all session types has as the primary effect that if you initialise it through e.g. a Background session and you later "physically" + # sign in to the owning account (Aqua session), things shouldn't flip out. + # Also, we're not checking @process_type here because that is used to indicate process priority and not necessarily if it should run in a + # specific session type. Like database services could run with ProcessType Interactive so they have no resource limitations enforced + # upon them, but they aren't really interactive in the general sense. + base[:LimitLoadToSessionType] = ["Aqua", "Background", "LoginWindow", "StandardIO", "System"] + base.to_plist end