Index: trunk/server/common/oursrc/tokensys/configure.in
===================================================================
--- trunk/server/common/oursrc/tokensys/configure.in	(revision 1693)
+++ trunk/server/common/oursrc/tokensys/configure.in	(revision 2066)
@@ -24,4 +24,13 @@
 REQUIRE_PATH(aklog)
 
+AC_ARG_WITH(fs,
+[  --with-fs[=PATH]          fs is located at PATH],[
+  if test "$withval" != "no" -a "$withval" != "yes"; then
+    fs_path="$withval"
+  fi
+])
+REQUIRE_PATH(fs)
+
 AC_OUTPUT(Makefile)
 AC_OUTPUT(renew)
+AC_OUTPUT(scripts-afsagent-startup)
Index: trunk/server/common/oursrc/tokensys/crontab
===================================================================
--- trunk/server/common/oursrc/tokensys/crontab	(revision 1693)
+++ 	(revision )
@@ -1,2 +1,0 @@
-@reboot	afsagent /home/afsagent/renew
-0 */3 * * * afsagent /home/afsagent/renew
Index: trunk/server/common/oursrc/tokensys/renew.in
===================================================================
--- trunk/server/common/oursrc/tokensys/renew.in	(revision 1693)
+++ trunk/server/common/oursrc/tokensys/renew.in	(revision 2066)
@@ -2,5 +2,5 @@
 
 # This script renews afsagent's tickets and tokens.
-# It is called by afsagent's crontab every 8 hours.
+# It is called by systemd on a regular schedule.
 
 export KRB5CCNAME=/home/afsagent/krb5cc
Index: trunk/server/common/oursrc/tokensys/scripts-afsagent-startup.in
===================================================================
--- trunk/server/common/oursrc/tokensys/scripts-afsagent-startup.in	(revision 2066)
+++ trunk/server/common/oursrc/tokensys/scripts-afsagent-startup.in	(revision 2066)
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+/sbin/sysctl -q afs.GCPAGs=0
+@fs_path@ setcrypt on
+@fs_path@ sysname 'amd64_fedora15_scripts' 'amd64_fedora13_scripts' 'amd64_fedora11_scripts' 'amd64_fedora9_scripts' 'amd64_fedora7_scripts' 'scripts' 'amd64_fedora15' 'amd64_fedora13' 'amd64_fedora11' 'amd64_fedora9' 'amd64_fedora7' 'amd64_linux26' 'i386_deb60' 'i386_deb50' 'i386_deb40' 'i386_rhel4' 'i386_rhel3' 'i386_rh9' 'i386_linux26' 'i386_linux24' 'i386_linux22' 'i386_linux3' 'i386_linux2'
+
+@fs_path@ setcell -nosuid -c athena
Index: trunk/server/common/oursrc/tokensys/scripts-afsagent-startup.service
===================================================================
--- trunk/server/common/oursrc/tokensys/scripts-afsagent-startup.service	(revision 2066)
+++ trunk/server/common/oursrc/tokensys/scripts-afsagent-startup.service	(revision 2066)
@@ -0,0 +1,12 @@
+[Unit]
+Description=Scripts AFS Configuration Service
+After=syslog.target openafs-client.service
+Before=crond.service
+Requires=openafs-client.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/local/libexec/scripts-afsagent-startup
+
+[Install]
+WantedBy=multi-user.target remote-fs.target crond.service
Index: trunk/server/common/oursrc/tokensys/scripts-afsagent.service
===================================================================
--- trunk/server/common/oursrc/tokensys/scripts-afsagent.service	(revision 2066)
+++ trunk/server/common/oursrc/tokensys/scripts-afsagent.service	(revision 2066)
@@ -0,0 +1,13 @@
+[Unit]
+Description=Scripts afsagent Service
+After=syslog.target openafs-client.service
+Before=crond.service
+Requires=openafs-client.service
+
+[Service]
+Type=oneshot
+ExecStart=/home/afsagent/renew
+User=afsagent
+
+[Install]
+WantedBy=multi-user.target remote-fs.target crond.service
Index: trunk/server/common/oursrc/tokensys/scripts-afsagent.timer
===================================================================
--- trunk/server/common/oursrc/tokensys/scripts-afsagent.timer	(revision 2066)
+++ trunk/server/common/oursrc/tokensys/scripts-afsagent.timer	(revision 2066)
@@ -0,0 +1,9 @@
+[Unit]
+Description=Scripts afsagent periodic renew
+
+[Timer]
+Unit=scripts-afsagent.service
+OnUnitActiveSec=3h
+
+[Install]
+WantedBy=multi-user.target remote-fs.target
