web
|
Last change
on this file since f6f3e91 was
f6f3e91,
checked in by Jessica B. Hamrick <jhamrick@…>, 15 years ago
|
|
Preserve directory hierarchy (not sure what happened to it)
|
-
Property mode set to
100644
|
|
File size:
1.5 KB
|
| Line | |
|---|
| 1 | # Shell function library to start and stop remctld |
|---|
| 2 | # |
|---|
| 3 | # Written by Russ Allbery <rra@stanford.edu> |
|---|
| 4 | # Copyright 2009 Board of Trustees, Leland Stanford Jr. University |
|---|
| 5 | # |
|---|
| 6 | # See LICENSE for licensing terms. |
|---|
| 7 | |
|---|
| 8 | # Start remctld. Takes the path to remctld, which may be found via configure, |
|---|
| 9 | # and the path to the configuration file. |
|---|
| 10 | remctld_start () { |
|---|
| 11 | local keytab principal |
|---|
| 12 | rm -f "$BUILD/data/remctld.pid" |
|---|
| 13 | keytab='' |
|---|
| 14 | for f in "$BUILD/data/test.keytab" "$SOURCE/data/test.keytab" ; do |
|---|
| 15 | if [ -r "$f" ] ; then |
|---|
| 16 | keytab="$f" |
|---|
| 17 | fi |
|---|
| 18 | done |
|---|
| 19 | principal='' |
|---|
| 20 | for f in "$BUILD/data/test.principal" "$SOURCE/data/test.principal" ; do |
|---|
| 21 | if [ -r "$f" ] ; then |
|---|
| 22 | principal=`cat "$BUILD/data/test.principal"` |
|---|
| 23 | fi |
|---|
| 24 | done |
|---|
| 25 | if [ -n "$VALGRIND" ] ; then |
|---|
| 26 | ( "$VALGRIND" --log-file=valgrind.%p --leak-check=full "$1" -m \ |
|---|
| 27 | -p 14373 -s "$principal" -P "$BUILD/data/remctld.pid" -f "$2" -d \ |
|---|
| 28 | -S -F -k "$keytab" &) |
|---|
| 29 | [ -f "$BUILD/data/remctld.pid" ] || sleep 5 |
|---|
| 30 | else |
|---|
| 31 | ( "$1" -m -p 14373 -s "$principal" -P "$BUILD/data/remctld.pid" \ |
|---|
| 32 | -f "$2" -d -S -F -k "$keytab" &) |
|---|
| 33 | fi |
|---|
| 34 | [ -f "$BUILD/data/remctld.pid" ] || sleep 1 |
|---|
| 35 | if [ ! -f "$BUILD/data/remctld.pid" ] ; then |
|---|
| 36 | bail 'remctld did not start' |
|---|
| 37 | fi |
|---|
| 38 | } |
|---|
| 39 | |
|---|
| 40 | # Stop remctld and clean up. |
|---|
| 41 | remctld_stop () { |
|---|
| 42 | if [ -f "$BUILD/data/remctld.pid" ] ; then |
|---|
| 43 | kill -TERM `cat "$BUILD/data/remctld.pid"` |
|---|
| 44 | rm -f "$BUILD/data/remctld.pid" |
|---|
| 45 | fi |
|---|
| 46 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.