[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Condor-users] How is registry created for condor-reuse-vm1 (Windows XP)?



The following message is pending review by list moderators due to its
size (zip file attached), so I'm resubmitting it without the attachment
for the benefit of those following the thread of messages!
(Reply to this message by Colin Stolley pre-dates this message...
because he was cc'ed to the original)
Sorry for the confusion!

---------- Forwarded message ----------
Date: Wed, 6 Apr 2005 13:32:25 +0100 (BST)
From: SG Wilkinson <sw8511@xxxxxxxxxxxxx>
To: Condor-Users Mail List <condor-users@xxxxxxxxxxx>
Cc: stolley@xxxxxxxxxxx
Subject: How is registry created for condor-reuse-vm1 (Windows XP)?

In a previous message to this list (31st March 2005 - User profile for
condor-reuse-vm1 in Windows XP) I explained problems I had running Opera
through Condor. The problem appeared to be due to a registry entry which
is not set for condor-reuse-vm1 - the absence of this registry key will
prevent Opera from running.

I followed Colin Stolley's suggestion to attempt to create the
necessary registry key for condor-reuse-vm1 by importing it into the
registry, but unfortunately that didn't seem to work. Below is an
explanation of how I proceeded, for reference. Does anybody know how the
registry which condor-reuse-vm1 sees is created? (From my
investigations, I concluded that it does not use the registry that a
normally logged-on user obtains, not even the one of the default profile
- if I am wrong, then I the tests I describe below must be flawed and I
would appreciate if anyone could point out my mistakes!)

Here is how I proceeded:

Let's assume I'm looking for a key under
HKEY_CURRENT_USER\Software\Vector Fields (abbreviated as
HKCU\Software\Vector Fields) - similar tests can be carried out for a
different key if necessary.

First of all, I must be able to read the registry key to check for its
presence - I've used the command:
C:\Windows\system32\reg.exe EXPORT "HKCU\Software\Vector Fields"
dump.reg
(attempts to use C:\Windows\regedit.exe /e "HKCU\Software\Vector Fields"
dump.reg and Kixtart's savekey command were unsuccessful)
Entering this command in a .bat file and submitting this to a condor
machine returned a dump.reg file which did not contain the key of
interest.

So the next step is to import the key, which is stored is a registry
file called vf.reg reproduced below:

REGEDIT4

[HKEY_CURRENT_USER\Software\Vector Fields]

[HKEY_CURRENT_USER\Software\Vector Fields\general]
"country"="UK"

I can import the key from this file into the registry with the command:
C:\windows\regedit /s vf.reg
The switch /s means silent - which means it doesn't run the regedit GUI,
but also does not report as to whether it was successful or not... but I
can find out whether it worked by reading back the registry as described
above.

So, in a batch file I enter the following commands and submit the job
to a condor machine:
C:\windows\regedit.exe /s vf.reg
C:\windows\system32\reg.exe EXPORT "HKCU\Software\Vector Fields"
dump.reg

But the dump.reg file does not contain the keys which the first command
should have added to the registry.

Following Colin Stolley's suggestions of adding the key to the
HKEY_USERS\ branch with the SID of condor-reuse-vm1, a friend helped me
created an executable which dynamically (i.e. on the fly) modifies the
vf.reg file from what is listed above to:

REGEDIT4

[HKEY_USERS\<SID>\Software\Vector Fields]

[HKEY_USERS\<SID>\Software\Vector Fields\general]
"country"="UK"

where <SID> is replaced with the SID for condor-reuse-vm1, obtained with
psgetsid.exe (from www.sysinternals.com).

Now the batch file run by the condor machine contains:
REM Get SID
psgetsid condor-reuse-vm1 > psgout.txt
REM executable which reads psgout.txt and creates sidvf.reg on
REM the fly from vf.reg is run here
sidreg.exe
REM Import sidvf.reg
C:\windows\regedit.exe /s sidvf.reg
REM Read the registry back out
C:\windows\system32\reg.exe EXPORT HKU\ dump1.reg
C:\windows\system32\reg.exe EXPORT HKCU\Software\ dump2.reg

This time, I've exported the entire HKEY_USERS subtree, but that still
doesn't contain the Vector Fields subkeys - and neither does HKCU. The
imported subkey is nowhere!

The possibilities are that regedit.exe /s has failed. Although regedit
/s will inherently not produce any output, I added the following line in
the batch file (immediately after the C:\Windows\regedit.exe /s
sidvf.reg line)
if NOT ERRORLEVEL 1 echo regedit.exe /s completed successfully
And this appears in the stdout file returned by condor. (This only means
that the previous command, regedit.exe /s did not report an error - not
than an error did not occur though!)

So my conclusion is that condor-reuse-vm1 has its own copy of the
registry, which is not the same as the registry which a normally logged
on user will have, and more worryingly which can not be modified using
regedit.exe /s
But maybe I could get opera to work if I can find out where the registry
is created and stored, and edit that file.

I attach condor.zip which contains:
* condor.sub - the condor submit file used in my tests (will need
tweaking to work on other condor pools)
* wrapper.bat - the batch file run on the remote machine to extract the
necessary files and run the necessary commands
* stuff.exe - a self extracting file containing the necessary
executables to run on the remote machine:
 -> sidreg.exe: a program which takes vf.reg and procudes sidvf.reg
based on the result of psgetsid.exe (stored in psgout.txt)
 -> psgetsid.exe: from www.sysinternals.com, gets the sid of a user
 ->  vf.reg: the template reg file
 -> perl58.dll: needed to run sigreg.exe

Any suggestions welcome.
Thanks,
Steve

On Thu, 31 Mar 2005, Colin Stolley wrote:

>
> >With help from the IT managers in the department, we've managed to link
> >the problem to the fact that the program (Opera) looks for a registry
> >key in HKEY_CURRENT_USER\Software to determine the licensing mechanism
> >(dongle or network). If no key is found, the program assumes (wrongly)
> >that a local dongle is being used.
> >
> >
> You're running Opera under Condor? I'd be curious to know what for.
>
> >We would like to create the necessary key in the registry for use by
> >condor-reuse-vm1 (the owner of the jobs on the remote machines), but it
> >seems that Condor doesn't have a user profile (as can be shown by
> >running a simple batch script which runs "cmd /c set > dump.txt" on the
> >remote machines)
> >
> >
> The only way I know of that user profiles are created is when the user
> first logs in interactively. Since the condor-reuse-vm1 account doesn't
> ever get logged in this way, the profile never gets created.
>
> One crazy idea might be to create the keys yourself. If you download
> pstools.zip from www.sysinternals.com, you'll get a tool called
> psgetsid. If you run 'psgetsid condor-reuse-vm1', that'll tell you what
> the account's SID is. For example, on my machine, I'd create a key called:
>
> HKEY_USERS\S-1-5-21-3534332583-3104622409-368686465-1027
>
> Then you can put whatever profile-specific registry settings you want
> under that key.
>
> Sounds like a lot of work, but you could probably automate it somehow.
>
> Good Luck,
>
> Colin
> _______________________________________________
> Condor-users mailing list
> Condor-users@xxxxxxxxxxx
> https://lists.cs.wisc.edu/mailman/listinfo/condor-users
>
>