1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-21 08:42:23 +00:00

rc script spring cleaning -- now passes rclint

Previously it would try to launch even if there were no rc.conf entries

Reviewed by:	garga
Sponsored by:	SupraNet Communications, Inc
This commit is contained in:
Mark Felder 2014-05-05 14:38:17 +00:00
parent 31860b6625
commit da5531d24c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=353008
8 changed files with 63 additions and 71 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= clamav
PORTVERSION= 20140107
PORTREVISION= 1
CATEGORIES= security
MASTER_SITES= http://www.clamav.net/snapshot/ \
LOCAL/garga/clamav-devel

View File

@ -3,7 +3,7 @@
# $FreeBSD$
#
# PROVIDE: clamd
# PROVIDE: clamav_clamd
# REQUIRE: LOGIN
# BEFORE: mail
# KEYWORD: shutdown
@ -22,30 +22,27 @@
name=clamav_clamd
rcvar=clamav_clamd_enable
# read settings, set default values
load_rc_config "$name"
: ${clamav_clamd_enable:=NO}
: ${clamav_clamd_socket="%%CLAMAV_CLAMD_SOCKET%%"}
command=%%PREFIX%%/sbin/clamd
required_dirs=%%DBDIR%%
required_files=%%PREFIX%%/etc/clamd.conf
# read settings, set default values
load_rc_config "$name"
: ${clamav_clamd_enable="NO"}
: ${clamav_clamd_socket="%%CLAMAV_CLAMD_SOCKET%%"}
start_precmd=clamav_clamd_precmd
extra_commands=reload
reload_cmd="%%PREFIX%%/bin/clamdscan --reload"
clamav_clamd_precmd() {
#clamav .93 won't start without a valid main.c[vl]d file
clamav_clamd_precmd()
{
if [ ! -f %%DBDIR%%/main.cvd -a ! -f %%DBDIR%%/main.cld ];then
echo "Missing %%DBDIR%%/*.cvd or *.cld files. You must run freshclam first"
exit 1
fi
}
extra_commands="reload"
reload_cmd=clamd_reload
clamd_reload()
{
%%PREFIX%%/bin/clamdscan --reload
}
run_rc_command "$1"

View File

@ -3,7 +3,7 @@
# $FreeBSD$
#
# PROVIDE: freshclam
# PROVIDE: clamav_freshclam
# REQUIRE: LOGIN clamd
# BEFORE: mail
# KEYWORD: shutdown
@ -22,14 +22,14 @@
name=clamav_freshclam
rcvar=clamav_freshclam_enable
load_rc_config ${name}
: ${clamav_freshclam_enable:=NO}
command=%%PREFIX%%/bin/freshclam
pidfile=%%RUNDIR%%/freshclam.pid
command_args="--daemon -p ${pidfile}"
required_dirs=%%DBDIR%%
required_files=%%PREFIX%%/etc/freshclam.conf
# read settings, set default values
load_rc_config "$name"
: ${clamav_freshclam_enable="NO"}
run_rc_command "$1"

View File

@ -3,7 +3,7 @@
# $FreeBSD$
#
# PROVIDE: clamav-milter
# PROVIDE: clamav_milter
# REQUIRE: LOGIN clamd
# BEFORE: mail
# KEYWORD: shutdown
@ -11,7 +11,7 @@
#
# Add the following lines to /etc/rc.conf to enable clamav-milter:
#
#clamav_milter_enable="YES"
# clamav_milter_enable="YES"
#
# See clamav-milter(1) for flags
#
@ -21,6 +21,18 @@
name=clamav_milter
rcvar=clamav_milter_enable
load_rc_config $name
: ${clamav_milter_enable:=NO}
: ${clamav_milter_socket="%%CLAMAV_MILTER_SOCKET%%"}
: ${clamav_milter_flags="-c ${conf_file}"}
: ${clamav_milter_socktimeout=60}
: ${clamav_milter_socket_mode=777}
: ${clamav_milter_socket_user=%%CLAMAVUSER%%}
: ${clamav_milter_socket_group=%%CLAMAVGROUP%%}
: ${clamav_clamd_enable:=NO}
: ${clamav_clamd_socket="%%CLAMAV_CLAMD_SOCKET%%"}
conf_file=%%PREFIX%%/etc/clamav-milter.conf
command=%%PREFIX%%/sbin/clamav-milter
required_dirs=%%DBDIR%%
@ -89,17 +101,4 @@ start_postcmd()
fi
}
# read settings, set default values
load_rc_config $name
: ${clamav_milter_enable="NO"}
: ${clamav_milter_socket="%%CLAMAV_MILTER_SOCKET%%"}
: ${clamav_milter_flags="-c ${conf_file}"}
: ${clamav_milter_socktimeout="60"}
: ${clamav_milter_socket_mode="777"}
: ${clamav_milter_socket_user="%%CLAMAVUSER%%"}
: ${clamav_milter_socket_group="%%CLAMAVGROUP%%"}
: ${clamav_clamd_socket="%%CLAMAV_CLAMD_SOCKET%%"}
: ${clamav_clamd_enable="NO"}
run_rc_command "$1"

View File

@ -3,7 +3,7 @@
PORTNAME= clamav
PORTVERSION= 0.98.1
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= SF

View File

@ -3,7 +3,7 @@
# $FreeBSD$
#
# PROVIDE: clamd
# PROVIDE: clamav_clamd
# REQUIRE: LOGIN
# BEFORE: mail
# KEYWORD: shutdown
@ -22,31 +22,27 @@
name=clamav_clamd
rcvar=clamav_clamd_enable
# read settings, set default values
load_rc_config "$name"
: ${clamav_clamd_enable:=NO}
: ${clamav_clamd_socket="%%CLAMAV_CLAMD_SOCKET%%"}
command=%%PREFIX%%/sbin/clamd
required_dirs=%%DBDIR%%
required_files=%%PREFIX%%/etc/clamd.conf
# read settings, set default values
load_rc_config "$name"
: ${clamav_clamd_enable="NO"}
: ${clamav_clamd_socket="%%CLAMAV_CLAMD_SOCKET%%"}
start_precmd=clamav_clamd_precmd
extra_commands=reload
reload_cmd="%%PREFIX%%/bin/clamdscan --reload"
#clamav .93 won't start without a valid main.c[vl]d file
clamav_clamd_precmd() {
clamav_clamd_precmd()
{
if [ ! -f %%DBDIR%%/main.cvd -a ! -f %%DBDIR%%/main.cld ];then
echo "Missing %%DBDIR%%/*.cvd or *.cld files. You must run freshclam first"
exit 1
fi
}
extra_commands="reload"
reload_cmd=clamd_reload
clamd_reload()
{
%%PREFIX%%/bin/clamdscan --reload
}
run_rc_command "$1"

View File

@ -3,7 +3,7 @@
# $FreeBSD$
#
# PROVIDE: freshclam
# PROVIDE: clamav_freshclam
# REQUIRE: LOGIN clamd
# BEFORE: mail
# KEYWORD: shutdown
@ -22,14 +22,14 @@
name=clamav_freshclam
rcvar=clamav_freshclam_enable
load_rc_config ${name}
: ${clamav_freshclam_enable:=NO}
command=%%PREFIX%%/bin/freshclam
pidfile=%%RUNDIR%%/freshclam.pid
command_args="--daemon -p ${pidfile}"
required_dirs=%%DBDIR%%
required_files=%%PREFIX%%/etc/freshclam.conf
# read settings, set default values
load_rc_config "$name"
: ${clamav_freshclam_enable="NO"}
run_rc_command "$1"

View File

@ -3,7 +3,7 @@
# $FreeBSD$
#
# PROVIDE: clamav-milter
# PROVIDE: clamav_milter
# REQUIRE: LOGIN clamd
# BEFORE: mail
# KEYWORD: shutdown
@ -11,7 +11,7 @@
#
# Add the following lines to /etc/rc.conf to enable clamav-milter:
#
#clamav_milter_enable="YES"
# clamav_milter_enable="YES"
#
# See clamav-milter(1) for flags
#
@ -21,6 +21,18 @@
name=clamav_milter
rcvar=clamav_milter_enable
load_rc_config $name
: ${clamav_milter_enable:=NO}
: ${clamav_milter_socket="%%CLAMAV_MILTER_SOCKET%%"}
: ${clamav_milter_flags="-c ${conf_file}"}
: ${clamav_milter_socktimeout=60}
: ${clamav_milter_socket_mode=777}
: ${clamav_milter_socket_user=%%CLAMAVUSER%%}
: ${clamav_milter_socket_group=%%CLAMAVGROUP%%}
: ${clamav_clamd_enable:=NO}
: ${clamav_clamd_socket="%%CLAMAV_CLAMD_SOCKET%%"}
conf_file=%%PREFIX%%/etc/clamav-milter.conf
command=%%PREFIX%%/sbin/clamav-milter
required_dirs=%%DBDIR%%
@ -89,17 +101,4 @@ start_postcmd()
fi
}
# read settings, set default values
load_rc_config $name
: ${clamav_milter_enable="NO"}
: ${clamav_milter_socket="%%CLAMAV_MILTER_SOCKET%%"}
: ${clamav_milter_flags="-c ${conf_file}"}
: ${clamav_milter_socktimeout="60"}
: ${clamav_milter_socket_mode="777"}
: ${clamav_milter_socket_user="%%CLAMAVUSER%%"}
: ${clamav_milter_socket_group="%%CLAMAVGROUP%%"}
: ${clamav_clamd_socket="%%CLAMAV_CLAMD_SOCKET%%"}
: ${clamav_clamd_enable="NO"}
run_rc_command "$1"