ports/169380: [security/sshguard] no startup script for sshguard
Garrett Wollman
wollman at csail.mit.edu
Sun Jun 24 17:50:08 UTC 2012
>Number: 169380
>Category: ports
>Synopsis: [security/sshguard] no startup script for sshguard
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sun Jun 24 17:50:07 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Garrett Wollman
>Release: FreeBSD 8.3-RELEASE-p1 amd64
>Organization:
MIT Computer Science & Artificial Intelligence Laboratory
>Environment:
not really relevant
>Description:
Since the release of version 1.5, sshguard is now capable of reading
directly from log files as a daemon rather than being started from
syslogd. It would be good to give users that optino by installing a
startup script.
>How-To-Repeat:
Install sshguard from ports.
>Fix:
Here's a total hack of a startup script.
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# sshguard
#
echo x - sshguard
sed 's/^X//' >sshguard << '221c5acbd2946333e46a21ddc354393f'
X#!/bin/sh
X#
X# based on: FreeBSD: ports/sysutils/monit/files/monit.sh.in,v 1.5 2012/01/14 08:57:02 dougb Exp
X#
X
X# PROVIDE: sshguard
X# REQUIRE: SERVERS
X# BEFORE: LOGIN
X# KEYWORD: shutdown
X
X#
X# Add the following lines to /etc/rc.conf to enable sshguard:
X# sshguard_enable (bool): Set to "NO" by default.
X# Set it to "YES" to enable sshguard
X# sshguard_flags (str): Flags passed to sshguard on startup.
X# Default is "-l /var/log/auth.log".
X#
X. /etc/rc.subr
X
Xname="sshguard"
Xrcvar=sshguard_enable
X
X: ${sshguard_enable:="NO"}
X: ${sshguard_flags:="-l /var/log/auth.log"}
X
Xload_rc_config $name
X
Xcommand="/usr/local/sbin/sshguard"
Xcommand_args="-i /var/run/sshguard.pid"
Xpidfile="/var/run/sshguard.pid"
Xstart_cmd="dostart"
X
X# Grrr... boilerplate copied from rc.subr so that we can call daemon(8)
X# to daemonize this ill-behaved daemon.
Xdostart() {
X if [ -z "$rc_fast" -a -n "$rc_pid" ]; then
X echo 1>&2 "${name} already running? (pid=$rc_pid)."
X return 1
X fi
X
X check_startmsgs && echo "Starting ${name}."
X if ! _run_rc_doit "daemon $command $rc_flags $command_args"; then
X warn "failed to start ${name}"
X return 1
X fi
X return 0
X}
X
Xrun_rc_command "$1"
221c5acbd2946333e46a21ddc354393f
exit
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list