[OpenAFS] help with AFS/Windows 2000 server/batch jobs

Rodney M Dyer rmdyer@uncc.edu
Mon, 12 May 2003 12:59:15 -0400


Mr. Thommes,

We do this all the time.  It works just fine.  We don't however use OpenAFS 
yet.  We are still using Transarc's version of the AFS client.  I have 
however used OpenAFS on several test machines and it appears to function 
properly.  The AFS client should not have anything to do with the task 
scheduler.  The task scheduler is just a service that fires off periodic 
processes.

The task scheduler runs as user SYSTEM.  You must therefore have a drive 
that was mounted by user SYSTEM.  To do this you can use the AFS client 
global drive configuration, or alternatively mount the drive as user system 
from a task script.

For example, if you setup the following task...

c:\>at 13:00 /interactive cmd /c "net use n: \\%computername%-afs\all & pause"

This will mount a n: drive to the top of the AFS tree at 1:00pm as user 
SYSTEM.  Unless the AFS service dies, the n: drive should exist until the 
machine is rebooted.  The AFS service doesn't have a reputation for 
stability on Windows systems however.  We often have to schedule background 
watchdog AFS service checks.  I have an example script on my site...

http://www.coe.uncc.edu/~rmdyer/afscheck.cmd_txt

We schedule this script to run hourly with the following command...

c:\>afscheck.cmd sched

This script does three things...

1.  At 4:00am it shuts down the AFS service and clears the cached.
2.  Checks to see if the client service is running and restarts it if it isn't.
3.  Check to see that the global n: drive is mounted and remounts it if it 
isn't.

You would need to modify the following in the script for your site...

set afscheckpath=c:\temp\afscheck.cmd

... this is the location of the script.


set afschecklog=c:\temp\afscheck.log

... this is the log output for the script...if you don't need to log then 
change it to...

set afschecklog=con


set afs_global_drive=n:

... this is the sort of obvious.

set afs_cell_path=\uncc

... this is your cell directory...

To test this script you can do the following...

1.  Change the neccessary environment variables described above.

         for debugging, change the log file to...

         set afschecklog=con


2.  Startup a shell as user system...

c:\>at xx:xx /interactive cmd.exe /k

where xx:xx is one minute ahead of whatever your current time is.

3.  Run the script.  The script should detect that your service is 
running.  The script should detect that the global drive is mounted.  If 
the service isn't running, or the global drive isn't mounted it will 
remount them.  If you set your machine time to 4:00am for testing, the 
script will shutdown the afs service, restart it, then remount the drive.


Once you've got a global drive mounted as user SYSTEM, and you've got a 
watchdog script to check for failures.  You can use the drive for batch 
type jobs.  We use ours for example to backup local files into AFS.  We 
have our server IP addresses on the ACL's of directories in AFS that they 
can write into.  We also read information out of AFS periodically.

BTW, you notice above that I didn't use the MS Task Scheduler GUI.  I never 
use that.  It's probably because I know how to use the command line AT so 
well.  I just don't like the GUI very much.

That is about it.  Any questions?

Rodney

Rodney M. Dyer
Windows Systems Programmer
Mosaic Computing Group
William States Lee College of Engineering
University of North Carolina at Charlotte
Email rmdyer@uncc.edu
Phone (704)687-3518
Help Desk Line (704)687-3150
FAX (704)687-2352
Office  267 Smith Building






At 09:17 AM 5/12/2003 -0500, you wrote:
>Hi All,
>     I have been trying to get AFS (probably the last 4 released versions, 
> up to 1.2.8a), Windows 2000 server, and batch jobs (no one logged in 
> interactively) which access AFS files  to run successfully with no 
> luck.  AFS appears to periodically hose the Windows task scheduler 
> (mstask.exe), maybe a couple of times a day.    Is anyone currently 
> running this combination successfully?  If so, can you indicate which AFS 
> version you are using and detail the steps taken to accomplish the 
> successful running of AFS batch jobs?  Thanks for any replies!
>
>Mike Thommes
>Argonne National Laboratory
>_______________________________________________
>OpenAFS-info mailing list
>OpenAFS-info@openafs.org
>https://lists.openafs.org/mailman/listinfo/openafs-info