Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Dec 2013 05:34:43 +0000 (UTC)
From:      Colin Percival <cperciva@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r335864 - in head/sysutils/firstboot-pkgs: . files
Message-ID:  <201312080534.rB85YhJ3009845@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cperciva
Date: Sun Dec  8 05:34:43 2013
New Revision: 335864
URL: http://svnweb.freebsd.org/changeset/ports/335864

Log:
  If firstboot_pkgs installs a package which contains an rc.d script,
  request a reboot so that any newly-installed daemons will be launched.

Modified:
  head/sysutils/firstboot-pkgs/Makefile
  head/sysutils/firstboot-pkgs/files/firstboot_pkgs.in
  head/sysutils/firstboot-pkgs/pkg-descr

Modified: head/sysutils/firstboot-pkgs/Makefile
==============================================================================
--- head/sysutils/firstboot-pkgs/Makefile	Sun Dec  8 04:11:54 2013	(r335863)
+++ head/sysutils/firstboot-pkgs/Makefile	Sun Dec  8 05:34:43 2013	(r335864)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
 PORTNAME=	firstboot-pkgs
-PORTVERSION=	1.0
+PORTVERSION=	1.1
 CATEGORIES=	sysutils
 MASTER_SITES=	# none
 DISTFILES=	# none

Modified: head/sysutils/firstboot-pkgs/files/firstboot_pkgs.in
==============================================================================
--- head/sysutils/firstboot-pkgs/files/firstboot_pkgs.in	Sun Dec  8 04:11:54 2013	(r335863)
+++ head/sysutils/firstboot-pkgs/files/firstboot_pkgs.in	Sun Dec  8 05:34:43 2013	(r335864)
@@ -27,6 +27,9 @@ stop_cmd=":"
 firstboot_pkgs_run()
 {
 
+	# Count rc.d scripts
+	nscriptso=`ls /usr/local/etc/rc.d | wc -l`
+
 	# Bootstrap if necessary
 	if ! pkg -N 2>/dev/null; then
 		env ASSUME_ALWAYS_YES=YES pkg bootstrap
@@ -36,6 +39,15 @@ firstboot_pkgs_run()
 	if ! [ -z "$firstboot_pkgs_list" ]; then
 		env ASSUME_ALWAYS_YES=YES pkg install $firstboot_pkgs_list
 	fi
+
+	# Count rc.d scripts again
+	nscriptsn=`ls /usr/local/etc/rc.d | wc -l`
+
+	# If we have more scripts, request a reboot
+	if [ $nscriptso -ne $nscriptso ]; then
+		echo "Requesting reboot after installing packages with rc.d scripts."
+		touch ${firstboot_sentinel}-reboot
+	fi
 }
 
 load_rc_config $name

Modified: head/sysutils/firstboot-pkgs/pkg-descr
==============================================================================
--- head/sysutils/firstboot-pkgs/pkg-descr	Sun Dec  8 04:11:54 2013	(r335863)
+++ head/sysutils/firstboot-pkgs/pkg-descr	Sun Dec  8 05:34:43 2013	(r335864)
@@ -1,6 +1,7 @@
 When the system first boots, install the pkg(8) tools (if not already
 installed) and packages listed in the $firstboot_pkgs_list rc.conf
-variable.
+variable.  If the installed packages added new rc.d scripts, request
+a reboot.
 
 Obviously, this port is not useful after a system is already running; it is
 intended to be included as part of the installation or disk image building



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