opnsense-src/libexec/rc/rc.d/newsyslog
Jose Luis Duran 325ebf37d8 Introduce startmsg and use it in rc scripts
startmsg is a new rc.subr(8) function function to be used instead of
echo(1) when for boot messages. It replaces the often forgotten

    check_startmsgs && echo ...

with

    startmsg ...

No functional change intended.

I adjusted the commit message and did some final clean-ups of the patch
before committing.

PR:		255207
Reported by:	Jose Luis Duran <jlduran@gmail.com>
Reviewed by:	imp, 0mp
Approved by:	imp (src)
Differential Revision:	https://reviews.freebsd.org/D34514
2022-03-13 18:57:29 +01:00

27 lines
429 B
Bash
Executable file

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: newsyslog
# REQUIRE: FILESYSTEMS mountcritremote
. /etc/rc.subr
name="newsyslog"
desc="Logfile rotation"
rcvar="newsyslog_enable"
required_files="/etc/newsyslog.conf"
command="/usr/sbin/${name}"
start_cmd="newsyslog_start"
stop_cmd=":"
newsyslog_start()
{
startmsg -n 'Creating and/or trimming log files'
${command} ${rc_flags}
startmsg '.'
}
load_rc_config $name
run_rc_command "$1"