Date: Thu, 10 Sep 2015 06:55:29 +0000 (UTC) From: Hiroki Sato <hrs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287614 - head/etc/rc.d Message-ID: <201509100655.t8A6tTDw040103@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hrs Date: Thu Sep 10 06:55:28 2015 New Revision: 287614 URL: https://svnweb.freebsd.org/changeset/base/287614 Log: - Add uid check. - Report delay<0 as a warning. MFC after: 3 days Modified: head/etc/rc.d/bgfsck Modified: head/etc/rc.d/bgfsck ============================================================================== --- head/etc/rc.d/bgfsck Thu Sep 10 06:47:23 2015 (r287613) +++ head/etc/rc.d/bgfsck Thu Sep 10 06:55:28 2015 (r287614) @@ -12,17 +12,24 @@ name="background_fsck" rcvar="background_fsck" start_cmd="bgfsck_start" +start_precmd="bgfsck_start_precmd" stop_cmd=":" +bgfsck_start_precmd() +{ + if [ $($ID -u) != 0 ]; then + err 1 "Must be root." + fi +} + bgfsck_start() { - if [ -z "${rc_force}" ]; then - background_fsck_delay=${background_fsck_delay:-0} - else + : ${background_fsck_delay=0} + if [ -n "${rc_force}" ]; then background_fsck_delay=0 fi if [ ${background_fsck_delay} -lt 0 ]; then - echo "Background file system checks delayed indefinitely" + warn "Background file system checks delayed indefinitely" return 0 fi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509100655.t8A6tTDw040103>