diff options
author | zi <zi@FreeBSD.org> | 2015-02-05 07:26:28 +0800 |
---|---|---|
committer | zi <zi@FreeBSD.org> | 2015-02-05 07:26:28 +0800 |
commit | 7342eed19c83bc0c74df991b7529b01f86c97ae4 (patch) | |
tree | e37264e26934fa6ebe72bb69ab053a004ec51452 /security | |
parent | de8edb55988addb09919f06c55312fe144f363f1 (diff) | |
download | freebsd-ports-gnome-7342eed19c83bc0c74df991b7529b01f86c97ae4.tar.gz freebsd-ports-gnome-7342eed19c83bc0c74df991b7529b01f86c97ae4.tar.zst freebsd-ports-gnome-7342eed19c83bc0c74df991b7529b01f86c97ae4.zip |
- Add rc script w/multi-instance support
- Bump PORTREVISION
Diffstat (limited to 'security')
-rw-r--r-- | security/kstart/Makefile | 2 | ||||
-rw-r--r-- | security/kstart/files/kstart.in | 60 |
2 files changed, 62 insertions, 0 deletions
diff --git a/security/kstart/Makefile b/security/kstart/Makefile index d0af6e19d9f9..eb3b62bef3db 100644 --- a/security/kstart/Makefile +++ b/security/kstart/Makefile @@ -3,12 +3,14 @@ PORTNAME= kstart DISTVERSION= 4.1 +PORTREVISION= 1 CATEGORIES= security MASTER_SITES= http://archives.eyrie.org/software/kerberos/ MAINTAINER= zi@FreeBSD.org COMMENT= Automated Kerberos ticket cache and keytab management utilities +USE_RC_SUBR= ${PORTNAME} HAS_CONFIGURE= yes PLIST_FILES= bin/k5start bin/krenew \ man/man1/k5start.1.gz man/man1/krenew.1.gz diff --git a/security/kstart/files/kstart.in b/security/kstart/files/kstart.in new file mode 100644 index 000000000000..01059f1d1c85 --- /dev/null +++ b/security/kstart/files/kstart.in @@ -0,0 +1,60 @@ +#!/bin/sh +# $FreeBSD$ + +# PROVIDE: kstart +# REQUIRE: DAEMON LOGIN +# KEYWORD: shutdown + +# Add the following lines to /etc/rc.conf to enable kstart: +# kstart_enable (bool): Set to YES to enable kstart +# Default: NO +# kstart_flags (str): Extra flags passed to kstart +# Default: -LUFK 120 +# kstart_keytab (str): Default keytab file to use +# Default: /etc/krb5.keytab +# +# To enable multi-instance support, use: +# kstart_instances="name1 name2" +# kstart_name1_keytab="/path/to/keytab" + + +. /etc/rc.subr + +name="kstart" +rcvar=kstart_enable + +command="%%PREFIX%%/bin/k5start" +pidfile="/var/run/kstart.pid" + +load_rc_config $name + +[ -z "$kstart_enable" ] && kstart_enable="NO" +[ -z "$kstart_keytab" ] && kstart_keytab="/etc/krb5.keytab" +[ -z "$kstart_flags" ] && kstart_flags="-LUFK 120" + +if [ -n "$kstart_instances" ]; then + _1=$1 + if [ $# -gt 1 ]; then shift; kstart_instances=$*; fi + kstart_keytab="" + kstart_flags="" + rc=0 + for i in ${kstart_instances}; do + eval _keytab=\$kstart_${i}_keytab + if [ -z "$_keytab" ]; then + _keytab="/etc/krb5.keytab" + fi + eval _flags=\$kstart_${i}_flags + if [ -z "$_flags" ]; then + _flags="-LUFK 120" + fi + eval pidfile="/var/run/kstart_${i}.pid" + command_args="-bf $_keytab $_flags -p $pidfile" + run_rc_command "$_1" + if [ $? -ne 0 ]; then rc=1; fi + unset _pidcmd _rc_restart_done + done + exit $rc +else + command_args="-bf $kstart_keytab $kstart_flags -p $pidfile" + run_rc_command "$1" +fi |