[Bug 279026] net/ptpd2: rc script has no defaults

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 16 May 2024 09:41:40 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279026

            Bug ID: 279026
           Summary: net/ptpd2: rc script has no defaults
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: skreuzer@FreeBSD.org
          Reporter: gehm@sudoers.net
             Flags: maintainer-feedback?(skreuzer@FreeBSD.org)
          Assignee: skreuzer@FreeBSD.org

In a fresh install, ptpd2 won't start because of missing options.
The rc file has no configfile default.

Here is a fix:

#!/bin/sh

# PROVIDE: ptpd2
# REQUIRE: NETWORKING DAEMON
# KEYWORD: nojail
#
# Add the following lines to /etc/rc.conf to enable ptpd
#
# ptpd2_enable (bool):  Set to "NO" by default
#                       Set it to "YES" to enable ptpd
# ptp2_configfile (str): Set to "/usr/local/etc/ptpd2/ptpd.conf" by default

. /etc/rc.subr

name=ptpd2
rcvar=ptpd2_enable

load_rc_config "${name}"

: ${ptpd2_enable:=NO}
: ${ptpd2_configfile:=/usr/local/etc/ptpd2/ptpd.conf}

required_files="${ptpd2_configfile}"

command="/usr/local/sbin/${name}"
command_args="-c ${ptpd2_configfile}"

run_rc_command "$1"

-- 
You are receiving this mail because:
You are the assignee for the bug.