Bug 279025 - net/ptpd2: rc script has no defaults
Summary: net/ptpd2: rc script has no defaults
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Steven Kreuzer
URL:
Keywords:
: 279026 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-05-16 09:41 UTC by Ekkehard 'Ekki' Gehm
Modified: 2024-05-27 13:27 UTC (History)
0 users

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:31 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 Mark Linimon freebsd_committer freebsd_triage 2024-05-17 13:00:26 UTC
*** Bug 279026 has been marked as a duplicate of this bug. ***
Comment 2 Ekkehard 'Ekki' Gehm 2024-05-17 14:35:04 UTC
The Configfile should be named ptpd2.conf... my fault...
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-05-26 13:31:52 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=099516e24bd625aeb524c5f9364b394c78af82b2

commit 099516e24bd625aeb524c5f9364b394c78af82b2
Author:     Steven Kreuzer <skreuzer@FreeBSD.org>
AuthorDate: 2024-05-26 13:28:27 +0000
Commit:     Steven Kreuzer <skreuzer@FreeBSD.org>
CommitDate: 2024-05-26 13:31:38 +0000

    net/ptpd2: Add default configfile to rc script

    Add a default configfile to the rc script to allow ptpd2 to start up

    PR:             279025
    Reported by:    Ekkehard 'Ekki' Gehm <gehm@sudoers.net>

 net/ptpd2/Makefile       |  2 +-
 net/ptpd2/files/ptpd2.in | 14 ++++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)
Comment 4 Steven Kreuzer freebsd_committer freebsd_triage 2024-05-27 13:27:07 UTC
port has been updated. thanks!