[RFC] Split nextboot deletion from /etc/rc.d/root

Brooks Davis brooks at freebsd.org
Sat Mar 8 15:38:06 UTC 2008


On Fri, Mar 07, 2008 at 04:31:32PM -0800, Xin LI wrote:
> Hi,
> 
> Here is a patch that moves the nextboot deletion from /etc/rc.d/root to a 
> new script which would be fired after mountlate.  The reason behind this is 
> that /boot is not necessarily part of the /, and doing nextboot -D would 
> give an error if /boot is not mounted (i.e. in a typical setup of ZFS 
> root).
> 
> Objections?

This seems somewhat risky in that delaying removal of the nextboot file means
crashes under moderate load (like running rc.d) will be harder to recover from.
What about doing it both places?

-- Brooks

> Cheers,
> -- 
> Xin LI <delphij at delphij.net>	http://www.delphij.net/
> FreeBSD - The Power to Serve!

> Index: Makefile
> ===================================================================
> RCS file: /home/ncvs/src/etc/rc.d/Makefile,v
> retrieving revision 1.89
> diff -u -p -r1.89 Makefile
> --- Makefile	5 Mar 2008 18:32:58 -0000	1.89
> +++ Makefile	8 Mar 2008 00:14:00 -0000
> @@ -23,7 +23,7 @@ FILES=	DAEMON FILESYSTEMS LOGIN NETWORKI
>  	mixer motd mountcritlocal mountcritremote mountlate \
>  	mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \
>  	named natd netif netoptions \
> -	network_ipv6 newsyslog nfsclient nfsd \
> +	network_ipv6 newsyslog nextboot nfsclient nfsd \
>  	nfsserver nisdomain nsswitch ntpd ntpdate \
>  	othermta \
>  	pf pflog pfsync \
> Index: root
> ===================================================================
> RCS file: /home/ncvs/src/etc/rc.d/root,v
> retrieving revision 1.16
> diff -u -p -r1.16 root
> --- root	8 Dec 2007 07:20:22 -0000	1.16
> +++ root	8 Mar 2008 00:13:42 -0000
> @@ -30,12 +30,6 @@ root_start()
>  	esac
>  
>  	umount -a >/dev/null 2>&1
> -
> -	# If we booted a special kernel remove the record
> -	# so we will boot the default kernel next time.
> -	if [ -x /sbin/nextboot ]; then
> -		/sbin/nextboot -D
> -	fi
>  }
>  
>  load_rc_config $name
> Index: nextboot
> ===================================================================
> RCS file: nextboot
> diff -N nextboot
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ nextboot	8 Mar 2008 00:14:21 -0000
> @@ -0,0 +1,26 @@
> +#!/bin/sh
> +#
> +# $FreeBSD$
> +#
> +
> +# PROVIDE: nextboot
> +# REQUIRE: mountlate
> +# KEYWORD: nojail
> +
> +. /etc/rc.subr
> +
> +name="nextboot"
> +start_cmd="nextboot_start"
> +stop_cmd=":"
> +
> +nextboot_start()
> +{
> +	# If we booted a special kernel remove the record
> +	# so we will boot the default kernel next time.
> +	if [ -x /sbin/nextboot ]; then
> +		/sbin/nextboot -D
> +	fi
> +}
> +
> +load_rc_config $name
> +run_rc_command "$1"

> _______________________________________________
> freebsd-rc at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-rc
> To unsubscribe, send any mail to "freebsd-rc-unsubscribe at freebsd.org"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20080308/3ee5a932/attachment.pgp


More information about the freebsd-rc mailing list