Keep track of the mirror target directory in an environment variable.
[mirror-admin] / bin / run-mirrors
index ec43009..9c24c7d 100755 (executable)
@@ -3,13 +3,14 @@
 set -e
 
 ## Make sure we're running as the right user.
-case "$USER" in
+case $(id -un) in
   mirror) ;;
   *) exec userv -fstdin=/dev/null mirror run ;;
 esac
 
 ## Set up a plausible environment.
-HOME=/mnt/ftp/mirror-admin; export HOME; cd
+HOME=/var/lib/mirror-admin; export HOME; cd
+MIRRORS=/mnt/mirrors; export MIRRORS
 PATH=$HOME/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin
 export PATH
 umask 002
@@ -19,6 +20,11 @@ case "${MIRROR_LOCKED-nil}" in
   nil) exec env MIRROR_LOCKED=t locking -f var/mirror.lock "$0" "$@" ;;
 esac
 
+## Hack for mad Kerberized NFS.
+if [ -r etc/krb5.keytab ]; then
+  kinit -k -t etc/krb5.keytab mirror
+fi
+
 ## Before we start, rotate the logs.  (Doing things this way means that we
 ## can be sure we don't lose new logs, even if the log rotation goes
 ## completely mental.