Bug 279026 - net/ptpd2: rc script has no defaults
Summary: net/ptpd2: rc script has no defaults
Status: Closed DUPLICATE of bug 279025
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Steven Kreuzer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-16 09:41 UTC by Ekkehard 'Ekki' Gehm
Modified: 2024-05-17 13:00 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (skreuzer)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ekkehard 'Ekki' Gehm 2024-05-16 09:41:40 UTC
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"
Comment 1 Ekkehard 'Ekki' Gehm 2024-05-16 09:47:19 UTC
:1,$:s/ptpd.conf/ptpd2.conf/g

sorry
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2024-05-17 13:00:26 UTC

*** This bug has been marked as a duplicate of bug 279025 ***