From owner-svn-src-all@freebsd.org Thu Sep 10 06:55:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E44AA00E58; Thu, 10 Sep 2015 06:55:29 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F8541CA0; Thu, 10 Sep 2015 06:55:29 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8A6tTvt040104; Thu, 10 Sep 2015 06:55:29 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8A6tTDw040103; Thu, 10 Sep 2015 06:55:29 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201509100655.t8A6tTDw040103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 10 Sep 2015 06:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287614 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2015 06:55:29 -0000 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