service: systemd launch_only_once
Set the type of service to oneshot if launch_only_once is provided; otherwise, simple.
This commit is contained in:
parent
9f4949c8c6
commit
12bf07a6ba
@ -334,11 +334,14 @@ module Homebrew
|
|||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
|
||||||
ExecStart=#{command.join(" ")}
|
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
|
# command needs to be first because it initializes all other values
|
||||||
|
cmd = command.join(" ")
|
||||||
|
|
||||||
options = []
|
options = []
|
||||||
|
options << "Type=#{@launch_only_once == true ? "oneshot" : "simple"}"
|
||||||
|
options << "ExecStart=#{cmd}"
|
||||||
options << "Restart=always" if @keep_alive == true
|
options << "Restart=always" if @keep_alive == true
|
||||||
options << "RestartSec=#{restart_delay}" if @restart_delay.present?
|
options << "RestartSec=#{restart_delay}" if @restart_delay.present?
|
||||||
options << "WorkingDirectory=#{@working_dir}" if @working_dir.present?
|
options << "WorkingDirectory=#{@working_dir}" if @working_dir.present?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user