Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Sep 2025 06:04:10 GMT
From:      Lexi Winter <ivy@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 2507698b630d - main - bsdinstall: Only offer to enable services which are installed
Message-ID:  <202509300604.58U64A6B077755@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by ivy:

URL: https://cgit.FreeBSD.org/src/commit/?id=2507698b630db3d88b0aab12c348873f827255a2

commit 2507698b630db3d88b0aab12c348873f827255a2
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2025-09-30 06:02:51 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2025-09-30 06:02:51 +0000

    bsdinstall: Only offer to enable services which are installed
    
    With pkgbase, users may decide to install a minimal set of packages
    that's missing some daemons.  Check which services are installed, and
    only include the ones which are present in the dialogue.
    
    MFC after:      1 day
    Reviewed by:    cperciva
    Differential Revision:  https://reviews.freebsd.org/D52646
---
 usr.sbin/bsdinstall/scripts/services | 49 ++++++++++++++++++++++++++----------
 1 file changed, 36 insertions(+), 13 deletions(-)

diff --git a/usr.sbin/bsdinstall/scripts/services b/usr.sbin/bsdinstall/scripts/services
index 93282effbb3f..110b6f321ed1 100755
--- a/usr.sbin/bsdinstall/scripts/services
+++ b/usr.sbin/bsdinstall/scripts/services
@@ -40,21 +40,44 @@ fi
 
 echo -n > $BSDINSTALL_TMPETC/rc.conf.services
 
+DAEMON_OPTIONS=""
+
+if [ -x "${BSDINSTALL_CHROOT}/etc/rc.d/sshd" ]; then
+	DAEMON_OPTIONS="$DAEMON_OPTIONS \
+	    sshd \"Secure shell daemon\" ${sshd_enable:-off}"
+fi
+
+if [ -x "${BSDINSTALL_CHROOT}/etc/rc.d/ntpd" ]; then
+	DAEMON_OPTIONS="$DAEMON_OPTIONS \
+	    ntpd \"Synchronize system and network time\" ${ntpd_enable:-off} \
+	    ntpd_sync_on_start \"Sync time on ntpd startup, even if offset is high\" \
+		${ntpd_sync_on_start:-off}"
+fi
+
+if [ -x "${BSDINSTALL_CHROOT}/etc/rc.d/local_unbound" ]; then
+	DAEMON_OPTIONS="$DAEMON_OPTIONS \
+	    local_unbound \"Local caching validating resolver\" \
+		${local_unbound_enable:-off}"
+fi
+
+if [ -x "${BSDINSTALL_CHROOT}/etc/rc.d/powerd" ]; then
+	DAEMON_OPTIONS="$DAEMON_OPTIONS \
+	    powerd \"Adjust CPU frequency dynamically if supported\" \
+		${powerd_enable:-off}"
+fi
+
+if [ -x "${BSDINSTALL_CHROOT}/etc/rc.d/moused" ]; then
+	DAEMON_OPTIONS="$DAEMON_OPTIONS \
+	    moused \"PS/2 mouse pointer on console\" ${moused_enable:-off}"
+fi
+
 exec 5>&1
-DAEMONS=$( bsddialog --backtitle "$OSNAME Installer" \
-    --title "System Configuration" --no-cancel --separate-output \
-    --checklist "Choose the services you would like to be started at boot:" \
+DAEMONS=$(eval bsddialog --backtitle \"$OSNAME Installer\" \
+    --title \"System Configuration\" --no-cancel --separate-output \
+    --checklist \"Choose the services you would like to be started at boot:\" \
     0 0 0 \
-	local_unbound "Local caching validating resolver" \
-		${local_unbound_enable:-off} \
-	sshd	"Secure shell daemon" ${sshd_enable:-off} \
-	moused	"PS/2 mouse pointer on console" ${moused_enable:-off} \
-	ntpd	"Synchronize system and network time" ${ntpd_enable:-off} \
-	ntpd_sync_on_start	"Sync time on ntpd startup, even if offset is high" \
-		${ntpd_sync_on_start:-off} \
-	powerd	"Adjust CPU frequency dynamically if supported" \
-		${powerd_enable:-off} \
-	dumpdev "Enable kernel crash dumps to /var/crash" ${dumpdev:-on} \
+	$DAEMON_OPTIONS \
+	dumpdev \"Enable kernel crash dumps to /var/crash\" ${dumpdev:-on} \
 2>&1 1>&5 )
 retval=$?
 exec 5>&-



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202509300604.58U64A6B077755>