Introduce and use the rcvar_manpage variable, which contains the manual page
name where the user should look at for documentation about rcvar. It defaults to 'rc.subr(5)', as rc.subr is mainly used by rc.d scripts. This variable is useful to let the daily, weekly, monthly and security scripts tune the warning message shown when any of the variables they handle is not properly set. Closes PR misc/23908.
This commit is contained in:
parent
37135b824f
commit
3c8a1444d9
@ -1,6 +1,6 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# $NetBSD: daily,v 1.58 2004/03/29 02:17:26 mrg Exp $
|
||||
# $NetBSD: daily,v 1.59 2004/04/02 13:13:47 jmmv Exp $
|
||||
# @(#)daily 8.2 (Berkeley) 1/25/94
|
||||
#
|
||||
|
||||
@ -13,6 +13,7 @@ fi
|
||||
|
||||
host=`hostname`
|
||||
date=`date`
|
||||
rcvar_manpage='daily.conf(5)'
|
||||
|
||||
echo "To: ${MAILTO:-root}"
|
||||
echo "Subject: $host daily output for $date"
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# $NetBSD: monthly,v 1.8 2000/01/10 17:03:49 ad Exp $
|
||||
# $NetBSD: monthly,v 1.9 2004/04/02 13:13:47 jmmv Exp $
|
||||
# from: @(#)monthly 8.1 (Berkeley) 6/9/93
|
||||
#
|
||||
|
||||
@ -13,6 +13,7 @@ fi
|
||||
|
||||
host=`hostname`
|
||||
date=`date`
|
||||
rcvar_manpage='monthly.conf(5)'
|
||||
|
||||
echo "To: ${MAILTO:-root}"
|
||||
echo "Subject: $host monthly output for $date"
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: rc.subr,v 1.61 2004/01/06 00:52:24 lukem Exp $
|
||||
# $NetBSD: rc.subr,v 1.62 2004/04/02 13:13:47 jmmv Exp $
|
||||
#
|
||||
# Copyright (c) 1997-2002 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
@ -38,6 +38,8 @@
|
||||
# functions used by various rc scripts
|
||||
#
|
||||
|
||||
: ${rcvar_manpage:='rc.conf(5)'}
|
||||
|
||||
#
|
||||
# functions
|
||||
# ---------
|
||||
@ -62,7 +64,7 @@ checkyesno()
|
||||
return 1
|
||||
;;
|
||||
*)
|
||||
warn "\$${1} is not set properly - see rc.conf(5)."
|
||||
warn "\$${1} is not set properly - see ${rcvar_manpage}."
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
@ -1,11 +1,13 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# $NetBSD: security,v 1.88 2004/02/09 09:04:13 jdolecek Exp $
|
||||
# $NetBSD: security,v 1.89 2004/04/02 13:13:47 jmmv Exp $
|
||||
# from: @(#)security 8.1 (Berkeley) 6/9/93
|
||||
#
|
||||
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
|
||||
rcvar_manpage='security.conf(5)'
|
||||
|
||||
if [ -f /etc/rc.subr ]; then
|
||||
. /etc/rc.subr
|
||||
else
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# $NetBSD: weekly,v 1.17 2001/06/18 10:54:02 lukem Exp $
|
||||
# $NetBSD: weekly,v 1.18 2004/04/02 13:13:47 jmmv Exp $
|
||||
# from: @(#)weekly 8.2 (Berkeley) 1/2/94
|
||||
#
|
||||
|
||||
@ -13,6 +13,7 @@ fi
|
||||
|
||||
host=`hostname`
|
||||
date=`date`
|
||||
rcvar_manpage='weekly.conf(5)'
|
||||
|
||||
echo "To: ${MAILTO:-root}"
|
||||
echo "Subject: $host weekly output for $date"
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: rc.subr.8,v 1.12 2004/01/06 00:52:24 lukem Exp $
|
||||
.\" $NetBSD: rc.subr.8,v 1.13 2004/04/02 13:13:48 jmmv Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2002-2004 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
@ -34,7 +34,7 @@
|
||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
.\" POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd January 6, 2004
|
||||
.Dd April 2, 2004
|
||||
.Dt RC.SUBR 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -171,6 +171,13 @@ Otherwise, warn that
|
||||
.Ar var
|
||||
is not set correctly.
|
||||
The values are case insensitive.
|
||||
.Pp
|
||||
Note that the warning message shown by this function when
|
||||
.Ar var
|
||||
is not set references a manual page where the user can find more information.
|
||||
Its name is picked up from the
|
||||
.Sy rcvar_manpage
|
||||
variable.
|
||||
.It Xo
|
||||
.Ic check_pidfile
|
||||
.Ar pidfile
|
||||
@ -347,6 +354,14 @@ The value of
|
||||
is checked with
|
||||
.Ic checkyesno
|
||||
to determine if this method should be run.
|
||||
.It Sy rcvar_manpage
|
||||
The manual page where the user can look at for information about
|
||||
.Sy rcvar .
|
||||
It will be part of the warning message shown when
|
||||
.Sy rcvar
|
||||
is undefined.
|
||||
Defaults to
|
||||
.Xr rc.conf 5 .
|
||||
.It Sy command
|
||||
Full path to the command.
|
||||
Not required if
|
||||
|
Loading…
Reference in New Issue
Block a user