aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJessica Clarke <jrtc27@FreeBSD.org>2022-11-29 00:57:38 +0000
committerJessica Clarke <jrtc27@FreeBSD.org>2022-11-29 03:33:47 +0000
commit1843da3edb2fa64384d06698ffcd62a3bdff4f7f (patch)
tree9da3ba3a13a1e21dfb27e2af21129fe6085c003a
parentbc928800723b65daa9b005bec4ffd8ad8c781a09 (diff)
downloadsrc-1843da3edb2fa64384d06698ffcd62a3bdff4f7f.tar.gz
src-1843da3edb2fa64384d06698ffcd62a3bdff4f7f.zip
bsdinstall: Fix ntpd_sync_on_start service option
This installer option is currently totally useless, as it ends up creating an ntpd_sync_on_start_enable="YES" entry in rc.conf, not an ntpd_sync_on_start="YES" entry, as is the correct name. This can also be noticed by revisiting the services menu, which parses the previously written rc.conf.services file to set variables governing the default menu entry values so that selecting OK regenerates the same file, as the menu entry will use the correct variable name and thus think the entry was not selected last time, defaulting back to off and losing the setting. Thus, add a special case in the loop for this option. The only other entry that doesn't follow the *_enable pattern is dumpdev (even moused does, it just also sets a second variable), but that also deviates in terms of being explicitly set either way and using AUTO rather than YES, hence why ntpd_sync_on_start follows a different pattern here and is special-cased rather than introducing a whole new variable that governs behaviour outside the loop. Fixes: c153a35bfd71 ("bsdinstall: replace ntpdate by ntpd_sync_on_start")
-rwxr-xr-xusr.sbin/bsdinstall/scripts/services7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/bsdinstall/scripts/services b/usr.sbin/bsdinstall/scripts/services
index bfb3a07d48f0..44d7c5f138e6 100755
--- a/usr.sbin/bsdinstall/scripts/services
+++ b/usr.sbin/bsdinstall/scripts/services
@@ -68,7 +68,12 @@ havemouse=
for daemon in $DAEMONS; do
[ "$daemon" = "dumpdev" ] && havedump=1 continue
[ "$daemon" = "moused" ] && havemouse=1
- echo ${daemon}_enable=\"YES\" >> $BSDINSTALL_TMPETC/rc.conf.services
+ if [ "$daemon" = "ntpd_sync_on_start" ]; then
+ rcvar=${daemon}
+ else
+ rcvar=${daemon}_enable
+ fi
+ echo ${rcvar}=\"YES\" >> $BSDINSTALL_TMPETC/rc.conf.services
done
if [ ! "$havemouse" ]; then