aboutsummaryrefslogtreecommitdiff
path: root/sysutils/firstboot-pkgs
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2013-12-08 05:34:43 +0000
committerColin Percival <cperciva@FreeBSD.org>2013-12-08 05:34:43 +0000
commita10cfe706f844a0d6210b5c353467b98950126f9 (patch)
tree1ee9bc784c7463d3e0a14736eab37667f864ff56 /sysutils/firstboot-pkgs
parentc010f08a5821d6aa0e4a00f0ee8e5bfee3cfed28 (diff)
downloadports-a10cfe706f844a0d6210b5c353467b98950126f9.tar.gz
ports-a10cfe706f844a0d6210b5c353467b98950126f9.zip
If firstboot_pkgs installs a package which contains an rc.d script,
request a reboot so that any newly-installed daemons will be launched.
Notes
Notes: svn path=/head/; revision=335864
Diffstat (limited to 'sysutils/firstboot-pkgs')
-rw-r--r--sysutils/firstboot-pkgs/Makefile2
-rw-r--r--sysutils/firstboot-pkgs/files/firstboot_pkgs.in12
-rw-r--r--sysutils/firstboot-pkgs/pkg-descr3
3 files changed, 15 insertions, 2 deletions
diff --git a/sysutils/firstboot-pkgs/Makefile b/sysutils/firstboot-pkgs/Makefile
index 1909688efffe..911e7c82cf61 100644
--- a/sysutils/firstboot-pkgs/Makefile
+++ b/sysutils/firstboot-pkgs/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
PORTNAME= firstboot-pkgs
-PORTVERSION= 1.0
+PORTVERSION= 1.1
CATEGORIES= sysutils
MASTER_SITES= # none
DISTFILES= # none
diff --git a/sysutils/firstboot-pkgs/files/firstboot_pkgs.in b/sysutils/firstboot-pkgs/files/firstboot_pkgs.in
index ba3b9ffbfcef..e44e8e3e680d 100644
--- a/sysutils/firstboot-pkgs/files/firstboot_pkgs.in
+++ b/sysutils/firstboot-pkgs/files/firstboot_pkgs.in
@@ -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
diff --git a/sysutils/firstboot-pkgs/pkg-descr b/sysutils/firstboot-pkgs/pkg-descr
index 0dfc37e7ddf2..9beeed9d360b 100644
--- a/sysutils/firstboot-pkgs/pkg-descr
+++ b/sysutils/firstboot-pkgs/pkg-descr
@@ -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