>Number:         181625
>Category:       conf
>Synopsis:       [patch] add rc.d/ script for freebsd-update
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 28 19:30:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Nikolai Lifanov
>Release:        FreeBSD 9.1-RELEASE-p5 amd64
>Organization:
>Environment:
System: FreeBSD mail.lifanov.com 9.1-RELEASE-p5 FreeBSD 9.1-RELEASE-p5 #0: Sat 
Jul 27 01:14:23 UTC 2013 
[email protected]:/usr/obj/usr/src/sys/GENERIC amd64

>Description:
Add /etc/rc.d/freebsd_update script:

If 'freebsd_update_enable="YES"' is set, the script installs already-fetched 
updates on boot, but before securelevel is raised. This makes updating trivial:
  # freebsd-update fetch (or freebsd-update upgrade ...)
  # reboot               (and if it's an upgrade, another reboot)
This is trivial, but it makes raising securelevel in rc.conf much more 
attractive. Updates can be fetched by cron and a simple reboot installs them 
without the administrator having to drop into single-user mode or lower 
securelevel temporarily.

freebsd_update_enable defaults to "NO"

>How-To-Repeat:
Apply the attached patch and set 'freebsd_update_enable="YES"' in rc.conf.
If there are updates available to install during boot, they will be installed.

>Fix:

--- freebsd_update.diff begins here ---
Index: etc/defaults/rc.conf
===================================================================
--- etc/defaults/rc.conf        (revision 254996)
+++ etc/defaults/rc.conf        (working copy)
@@ -84,6 +84,7 @@
 #geli_mirror_home_flags="-k /etc/geli/home.keys"
 
 root_rw_mount="YES"    # Set to NO to inhibit remounting root read-write.
+freebsd_update_enable="NO" # Set to YES to run 'freebsd-update install' on boot
 fsck_y_enable="NO"     # Set to YES to do fsck -y if the initial preen fails.
 fsck_y_flags=""                # Additional flags for fsck -y
 background_fsck="YES"  # Attempt to run fsck in the background where possible.
Index: etc/rc.d/Makefile
===================================================================
--- etc/rc.d/Makefile   (revision 254999)
+++ etc/rc.d/Makefile   (working copy)
@@ -38,6 +38,7 @@
        dmesg \
        dumpon \
        faith \
+       freebsd_update \
        fsck \
        ftp-proxy \
        ftpd \
Index: etc/rc.d/freebsd_update
===================================================================
--- etc/rc.d/freebsd_update     (revision 0)
+++ etc/rc.d/freebsd_update     (working copy)
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: freebsd_update
+# REQUIRE: FILESYSTEMS
+# BEFORE:  securelevel
+
+. /etc/rc.subr
+
+name="freebsd_update"
+rcvar="freebsd_update_enable"
+start_cmd="freebsd_update_install"
+stop_cmd=":"
+
+freebsd_update_install()
+{
+       /usr/sbin/freebsd-update install || :
+}
+
+run_rc_command "$1"

Property changes on: etc/rc.d/freebsd_update
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
--- freebsd_update.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to