rc.d/ggated: Simplify service script

- Use the standard *_flags variable for additional flags.
- Style: do not create unnecessary variables
- Do not set the defaults in the service script. This is what
  /etc/defaults/rc.conf is for.
- Do not set additional flags via commands_args. ggated_flags are
  already included in the final invocation. See rc.subr(8) for details.
- Document the meaning of ggated_config in /etc/defaults/rc.conf.

Approved by:	eugen (src)
Fixes:		c068632981 Add ggated rc script
Differential Revision:	https://reviews.freebsd.org/D34439
This commit is contained in:
Mateusz Piotrowski 2022-03-04 15:53:01 +01:00
parent dd74471e49
commit c1a76c0486
2 changed files with 4 additions and 6 deletions

View File

@ -297,8 +297,8 @@ hastd_enable="NO" # Run the HAST daemon (YES/NO).
hastd_program="/sbin/hastd" # path to hastd, if you want a different one.
hastd_flags="" # Optional flags to hastd.
ggated_enable="NO" # Run the ggate daemon (YES/NO).
ggated_config="/etc/gg.exports"
ggated_params="" # Extra parameters like which port to bind to.
ggated_config="/etc/gg.exports" # ggated(8) exports file.
ggated_flags="" # Extra parameters like which port to bind to.
ctld_enable="NO" # CAM Target Layer / iSCSI target daemon.
local_unbound_enable="NO" # Local caching resolver
local_unbound_tls="NO" # Use DNS over TLS

View File

@ -12,10 +12,8 @@ command="/sbin/${name}"
pidfile="/var/run/${name}.pid"
load_rc_config $name
params="${ggated_params}"
config="${ggated_config:-/etc/gg.exports}"
required_files="${config}"
required_files="${ggated_config}"
command_args="${params} ${config}"
command_args="${ggated_config}"
run_rc_command "$1"