Sun Dec 29 22:19:13 2019 UTC ()
Make sure rc, rc.subr, and rc.shutdown are properly updated.

Currently there is no info which rc* files should be updated
or not on upgrade (at least rc.conf and rc.local shouldn't),
so put back an explicit list in the postinstall script.
"Go for it" by christos@ in PR/54741.

Should be pulled up to netbsd-9.


(tsutsui)
diff -r1.11 -r1.12 src/usr.sbin/postinstall/postinstall.in

cvs diff -r1.11 -r1.12 src/usr.sbin/postinstall/postinstall.in (expand / switch to unified diff)

--- src/usr.sbin/postinstall/postinstall.in 2019/12/22 18:41:36 1.11
+++ src/usr.sbin/postinstall/postinstall.in 2019/12/29 22:19:13 1.12
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# $NetBSD: postinstall.in,v 1.11 2019/12/22 18:41:36 christos Exp $ 3# $NetBSD: postinstall.in,v 1.12 2019/12/29 22:19:13 tsutsui Exp $
4# 4#
5# Copyright (c) 2002-2015 The NetBSD Foundation, Inc. 5# Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
6# All rights reserved. 6# All rights reserved.
7# 7#
8# This code is derived from software contributed to The NetBSD Foundation 8# This code is derived from software contributed to The NetBSD Foundation
9# by Luke Mewburn. 9# by Luke Mewburn.
10# 10#
11# Redistribution and use in source and binary forms, with or without 11# Redistribution and use in source and binary forms, with or without
12# modification, are permitted provided that the following conditions 12# modification, are permitted provided that the following conditions
13# are met: 13# are met:
14# 1. Redistributions of source code must retain the above copyright 14# 1. Redistributions of source code must retain the above copyright
15# notice, this list of conditions and the following disclaimer. 15# notice, this list of conditions and the following disclaimer.
16# 2. Redistributions in binary form must reproduce the above copyright 16# 2. Redistributions in binary form must reproduce the above copyright
@@ -1405,26 +1405,34 @@ do_pwd_mkdb() @@ -1405,26 +1405,34 @@ do_pwd_mkdb()
1405 msg "Can't update format of passwd database" 1405 msg "Can't update format of passwd database"
1406 failed=1 1406 failed=1
1407 else 1407 else
1408 msg "Updated format of passwd database" 1408 msg "Updated format of passwd database"
1409 fi 1409 fi
1410 1410
1411 return ${failed} 1411 return ${failed}
1412} 1412}
1413 1413
1414# 1414#
1415# rc 1415# rc
1416# 1416#
1417 1417
 1418# There is no info in src/distrib or /etc/mtree which rc* files
 1419# can be overwritten unconditionally on upgrade. See PR/54741.
 1420rc_644_files="
 1421rc
 1422rc.subr
 1423rc.shutdown
 1424"
 1425
1418rc_obsolete_vars=" 1426rc_obsolete_vars="
1419amd amd_master 1427amd amd_master
1420btcontrol btcontrol_devices 1428btcontrol btcontrol_devices
1421critical_filesystems critical_filesystems_beforenet 1429critical_filesystems critical_filesystems_beforenet
1422mountcritlocal mountcritremote 1430mountcritlocal mountcritremote
1423network ip6forwarding 1431network ip6forwarding
1424network nfsiod_flags 1432network nfsiod_flags
1425sdpd sdpd_control 1433sdpd sdpd_control
1426sdpd sdpd_groupname 1434sdpd sdpd_groupname
1427sdpd sdpd_username 1435sdpd sdpd_username
1428sysctl defcorename 1436sysctl defcorename
1429" 1437"
1430 1438
@@ -1500,28 +1508,29 @@ do_rc() @@ -1500,28 +1508,29 @@ do_rc()
1500 [ -n "$1" ] || err 3 "USAGE: do_rc fix|check" 1508 [ -n "$1" ] || err 3 "USAGE: do_rc fix|check"
1501 local op="$1" 1509 local op="$1"
1502 local failed=0 1510 local failed=0
1503 local generated_scripts="" 1511 local generated_scripts=""
1504 local etcsets=$(getetcsets) 1512 local etcsets=$(getetcsets)
1505 if [ "${MKX11}" != "no" ]; then 1513 if [ "${MKX11}" != "no" ]; then
1506 generated_scripts="${generated_scripts} xdm xfs" 1514 generated_scripts="${generated_scripts} xdm xfs"
1507 fi 1515 fi
1508 1516
1509 # Directories of external programs that have rc files (in bsd) 1517 # Directories of external programs that have rc files (in bsd)
1510 local rc_external_files="blacklist nsd unbound" 1518 local rc_external_files="blacklist nsd unbound"
1511 1519
1512 # rc* files in /etc/ 1520 # rc* files in /etc/
1513 local rc_444_files="$(select_set_files /etc/rc \ 1521 # XXX: at least rc.conf and rc.local shouldn't be updated. PR/54741
1514 "/etc/\(rc[^[:space:]/]*\)" ${etcsets})" 1522 #local rc_644_files="$(select_set_files /etc/rc \
 1523 # "/etc/\(rc[^[:space:]/]*\)" ${etcsets})"
1515 1524
1516 # no-obsolete rc files in /etc/rc.d 1525 # no-obsolete rc files in /etc/rc.d
1517 local rc_555_files="$(select_set_files /etc/rc.d/ \ 1526 local rc_555_files="$(select_set_files /etc/rc.d/ \
1518 "/etc/rc\.d/\([^[:space:]]*\)" ${etcsets} | \ 1527 "/etc/rc\.d/\([^[:space:]]*\)" ${etcsets} | \
1519 exclude ${rc_external_files})" 1528 exclude ${rc_external_files})"
1520 1529
1521 # obsolete rc file in /etc/rc.d 1530 # obsolete rc file in /etc/rc.d
1522 local rc_obsolete_files="$(select_obsolete_files /etc/rc.d/ \ 1531 local rc_obsolete_files="$(select_obsolete_files /etc/rc.d/ \
1523 "\([^[:space:]]*\)" etc)" 1532 "\([^[:space:]]*\)" etc)"
1524 1533
1525 compare_dir "${op}" "${SRC_DIR}/etc" "${DEST_DIR}/etc" 644 \ 1534 compare_dir "${op}" "${SRC_DIR}/etc" "${DEST_DIR}/etc" 644 \
1526 ${rc_644_files} 1535 ${rc_644_files}
1527 failed=$(( ${failed} + $? )) 1536 failed=$(( ${failed} + $? ))