Date: Thu, 13 Apr 2006 17:34:48 GMT From: Jo Rhett <jrhett@svcolo.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/95708: freebsd startup script for sec port Message-ID: <200604131734.k3DHYm8T078585@www.freebsd.org> Resent-Message-ID: <200604131740.k3DHeIbx069205@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 95708 >Category: ports >Synopsis: freebsd startup script for sec port >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Thu Apr 13 17:40:18 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Jo Rhett >Release: 6.0-REL >Organization: Silicon Valley Colocation >Environment: FreeBSD arran 6.0-RELEASE FreeBSD 6.0-RELEASE #4: Fri Nov 11 13:29:33 PST 2005 >Description: This is a startup script for the 'sec' port. It uses rc.conf variables to start up a customizable number of sec instances. >How-To-Repeat: >Fix: #!/bin/sh # # Add the following lines to /etc/rc.conf to enable sec: # sec_enable (bool): Set to "NO" by default. # Set it to "YES" to enable sec. # # These flags control the first (or only) instance of sec. # sec_flags (str): Set to "" by default. # sec_configfile (str): Set to "/usr/local/etc/sec.conf" by default. # # To handle multiple instances you can also define # sec_instances="main auth" (list): define the instances (any string) which should be started/stopped # sec_instance_main_flags (str): define the invocation options for the first instance # sec_instance_main_configfile (str): define the config file for the first instance # sec_instance_auth_flags (str): define the invocation options for the second instance # sec_instance_auth_configfile (str): define the config file for the second instance # ...etc # . /etc/rc.subr name="sec" rcvar=`set_rcvar` command="/usr/local/bin/sec" command_args="-detach" command_interpreter="/usr/bin/perl" extra_commands="reload" pidfile="/var/run/sec.pid" start_precmd="sec_checkconfig" reload_precmd="sec_checkconfig" restart_precmd="sec_checkconfig" sig_reload=HUP load_rc_config "${name}" [ -z "${sec_enable}" ] && sec_enable="NO" [ -z "${sec_flags}" ] && sec_flags="-log=/var/log/sec.log" [ -z "${sec_configfile}" ] && sec_configfile="/usr/local/etc/sec.conf" [ -z "${sec_instances}" ] && sec_instances="" sec_checkconfig() { if [ -z $instance ] then echo -n "Performing sanity check of sec configuration: " else echo -n "Performing sanity check of sec_${instance} configuration: " fi ${command} -debug=1 -testonly -conf=${sec_configfile} 2>&1 >/dev/null if [ $? != 0 ]; then echo "FAILED" ${command} -testonly -conf=${sec_configfile} return 1 else echo "OK" fi } required_files="${sec_configfile}" sec_flags="-conf=${sec_configfile} -pid=${pidfile} ${sec_flags}" run_rc_command "$1" # Are we handling multiple instance mode? if [ ! -z "${sec_instances}" ] then for instance in $sec_instances do # Iterate through all instances name="sec_${instance}" pidfile="/var/run/sec_${instance}.pid" eval required_files=\$sec_${instance}_configfile eval sec_${instance}_flags="\"-conf=\$sec_${instance}_configfile -pid=\$pidfile \$sec_${instance}_flags\"" run_rc_command "$1" done fi >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604131734.k3DHYm8T078585>