Electronic Entertainment Community: Remote Autosend of UD Agent Work Units - Electronic Entertainment Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Remote Autosend of UD Agent Work Units Changes to the Work Units prompt rewrite.

#1 User is offline   Dick_Dastardly 

  • Mini Poster
  • PipPip
  • Group: Valued Member
  • Posts: 99
  • Joined: 07-March 06

Posted 23 August 2007 - 10:22 AM

For those who are running a remote autosend of the UD Agent from offline machines:

There has been a change in the Work Units that might cause the updates to hang. The problem stems from the tkcp.ud~ files that once signaled that the work unit had been saved. These are no longer being generated at a useable time, if at all. A workaround is to use the tklg.ud file, which shows that the new work unit has been downloaded.

For those who would like to run a remote autosend of the UD Agent:

This system has been successfully running in Grid.org and/or WCG since 2004. The changes to the work units on or about August 17, 2007 have prompted a minor rewrite.

This assumes you’ve already made a “Sneakernet” version of the UD Agent and just want to automatically transfer the Work Units to the internet instead of running back and forth with a thumb drive.

You’ll need PSTools. http://www.microsoft...es/PsTools.mspx It’s free from Microsoft. There’s a EULA issue that can be a pain. Here’s a discussion on that and a potential fix. I use an older version that doesn’t have the problem, so I don’t know if it’s been completely fixed…
http://forum.sysinte.......D=8783&PN=7

NOTE: PSTools, and therefore this setup, will not work with XP Home. You will need Windows NT, 2k or XP Pro.

The computers are set up as follows:

PC1 is the local machine that runs the batch file. It doesn’t have internet access.

PC2 and PC3 are on networks that don’t have internet access, but can be seen from the local machine.

PC4 is the internet connected machine and can be seen from the local machine. It only runs the UD Agent while transferring the completed work units. Its primary WCG program is BOINC. It should not run its own UD Agent or there will be conflicts.

USERNAME is a user with admin access. PASSWORD is that user’s password.

You can change the drive or directories, but make sure you change them everywhere if you do.

Basic instructions follow, then the batch files in a seperate reply to keep things organized.
Posted Image
0

#2 User is offline   Dick_Dastardly 

  • Mini Poster
  • PipPip
  • Group: Valued Member
  • Posts: 99
  • Joined: 07-March 06

Posted 23 August 2007 - 10:23 AM

On All Computers:

Put UD.Bat in the Windows\System32 folder.
Ensure that the Admin$ share is enabled. See the discussion in the PSTools forum http://forum.sysinte.......;PN=1&TPN=1 if needed.
Create a user with admin privileges and a password.

On All Computers Except PC4:

Create a shared folder named UD on C: and put your working United Devices folder into it. The administrator that you created should have at least “change” access to the UD folder.

Create a shortcut for UD.exe and rename it UD. Put the shortcut into the UD folder and the startup folder.

On PC4:

Create a shared folder called UD. Create a subfolder inside that one called United Devices. The administrator that you created should have at least “change” access to the UD folder.

On PC1:

Create a folder. Put UDRemote.bat, PSExec and PSKill in the folder.

Create a new Scheduled Task that runs UDRemote.Bat once every 4 minutes.
Posted Image
0

#3 User is offline   Dick_Dastardly 

  • Mini Poster
  • PipPip
  • Group: Valued Member
  • Posts: 99
  • Joined: 07-March 06

Posted 23 August 2007 - 10:24 AM

The batch files:


UD.bat:

C:\UD\UD.lnk
exit


UDRemote.Bat:

If exist "PC4\C\UD\United Devices\result*.*" exit

if exist UD1busy goto UDNew1
if exist UD2busy goto UDNew2
if exist UD3busy goto UDNew3

if exist "C:\UD\United Devices\result*.*" goto UDDone1
if exist "\\PC2\C\UD\United Devices\result*.*" goto UDDone2
if exist "\\PC3\C\UD\United Devices\result*.*" goto UDDone3
exit

:UDDone1
MD UD1busy
pskill ud.exe
ping 127.0.0.1
pskill \\PC4 -u USERNAME -p PASSWORD ud.exe
ping 127.0.0.1
ping 127.0.0.1
move "C:\UD\United Devices\*.* " "\\PC4\C\UD\United Devices"
ping 127.0.0.1
ping 127.0.0.1
ping 127.0.0.1
psexec \\PC4 -u USERNAME -p PASSWORD -d ud.bat
exit

:UDDone2
MD UD2busy
pskill \\PC2 -u USERNAME -p PASSWORD ud.exe
ping 127.0.0.1
pskill \\PC4 -u USERNAME -p PASSWORD ud.exe
ping 127.0.0.1
ping 127.0.0.1
move "\\PC2\C\UD\United Devices\*.*" "\\PC4\C\UD\United Devices"
ping 127.0.0.1
ping 127.0.0.1
ping 127.0.0.1
psexec \\PC4 -u USERNAME -p PASSWORD -d ud.bat
exit

:UDDone3
MD UD3busy
pskill \\PC3 -u USERNAME -p PASSWORD ud.exe
ping 127.0.0.1
pskill \\PC4 -u USERNAME -p PASSWORD ud.exe
ping 127.0.0.1
ping 127.0.0.1
move "\\PC3\C\UD\United Devices\*.*" "\\PC4\C\UD\United Devices"
ping 127.0.0.1
ping 127.0.0.1
ping 127.0.0.1
psexec \\PC4 -u USERNAME -p PASSWORD -d ud.bat
exit

:UDNew1
If not exist "\\PC4\C\UD\United Devices\tklg.ud" exit
pskill \\PC4 -u USERNAME -p PASSWORD ud.exe
ping 127.0.0.1
pskill ud.exe
ping 127.0.0.1
ping 127.0.0.1
move "\\PC4\C\UD\United Devices\*.*" "C:\UD\United Devices"
ping 127.0.0.1
ping 127.0.0.1
ping 127.0.0.1
psexec \\PC1 -u USERNAME -p PASSWORD -d ud.bat
rd UD1busy
exit

:UDNew2
If not exist "\\PC4\C\UD\United Devices\tklg.ud" exit
if not exist "\\PC2\C\UD\United Devices" exit
pskill \\PC4 -u USERNAME -p PASSWORD ud.exe
ping 127.0.0.1
pskill \\PC2 -u USERNAME -p PASSWORD ud.exe
ping 127.0.0.1
ping 127.0.0.1
move "\\PC4\C\UD\United Devices\*.*" "\\PC2\C\UD\United Devices"
ping 127.0.0.1
ping 127.0.0.1
ping 127.0.0.1
psexec \\PC2 -u USERNAME -p PASSWORD -d ud.bat
rd UD2busy
exit

:UDNew3
If not exist "\\PC4\C\UD\United Devices\tklg.ud" exit
if not exist "\\PC3\C\UD\United Devices" exit
pskill \\PC4 -u USERNAME -p PASSWORD ud.exe
ping 127.0.0.1
pskill \\PC3 -u USERNAME -p PASSWORD ud.exe
ping 127.0.0.1
ping 127.0.0.1
move "\\PC4\C\UD\United Devices\*.*" "\\PC3\C\UD\United Devices"
ping 127.0.0.1
ping 127.0.0.1
ping 127.0.0.1
psexec \\PC3 -u USERNAME -p PASSWORD -d ud.bat
rd UD3busy
exit
Posted Image
0

#4 User is offline   Johnny Cool 

  • Johnny Cool
  • Icon
  • Group: Moderators
  • Posts: 13,451
  • Joined: 26-May 03

Posted 23 August 2007 - 11:05 AM

Dick_Dastardly, that is very informative and impressive. Thank you! Posted Image
 Posted Image  
0

#5 User is offline   Dick_Dastardly 

  • Mini Poster
  • PipPip
  • Group: Valued Member
  • Posts: 99
  • Joined: 07-March 06

Posted 23 August 2007 - 11:35 AM

Thanks, and no prob, JC. :)

BTW, for those who see the inefficiency of running the link from an embedded batch file from a remote command, there's a reason to do it that way.

PSExec won't release itself once called until the associated remote program ends. If you call the link or the exe directly, PSExec will latch and become unuseable. It also has a nasty habit of leaving artifacts behind when it does that. By calling the batch, PSExec sees it end immediately and exits, ready to be called in 4 minutes.

The link keeps the program parameters straight and being a step away from the Work Unit ensures that it survives an update.

There are also other seemingly inefficient steps, but each one serves an anti-bug or stability purpose. :)
Posted Image
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic