diff --git a/Library/Homebrew/service.rb b/Library/Homebrew/service.rb
index 1fba85547d..5b4245cde5 100644
--- a/Library/Homebrew/service.rb
+++ b/Library/Homebrew/service.rb
@@ -303,7 +303,7 @@ module Homebrew
}
base[:KeepAlive] = @keep_alive if @keep_alive == true
- base[:LaunchOnlyOnce] = @launch_only_once if @launch_only_once == false
+ base[:LaunchOnlyOnce] = @launch_only_once if @launch_only_once == true
base[:LegacyTimers] = @macos_legacy_timers if @macos_legacy_timers == true
base[:TimeOut] = @restart_delay if @restart_delay.present?
base[:ProcessType] = @process_type.to_s.capitalize if @process_type.present?
diff --git a/Library/Homebrew/test/service_spec.rb b/Library/Homebrew/test/service_spec.rb
index da1c8ec20d..b1d10b74a2 100644
--- a/Library/Homebrew/test/service_spec.rb
+++ b/Library/Homebrew/test/service_spec.rb
@@ -102,6 +102,7 @@ describe Homebrew::Service do
root_dir var
working_dir var
keep_alive true
+ launch_only_once true
process_type :interactive
restart_delay 30
interval 5
@@ -127,6 +128,8 @@ describe Homebrew::Service do
\t
\tLabel
\thomebrew.mxcl.formula_name
+ \tLaunchOnlyOnce
+ \t
\tLegacyTimers
\t
\tProcessType