Win95 logon scripts, profiles, etc

Simon Hyde shyde at poboxes.com
Thu Oct 9 16:30:31 GMT 1997


On Thu, 9 Oct 1997 11:38:24 +1000, you wrote:

>Gerald W. Carter wrote:
>> Louis Mandelstam wrote:
>> > 
>> > It would seem that the Win95 login routine doesn't start until after
>> > the preexec script has completed.  Presumed that the two processes
>> > would happen in parallel and that it was just a case of the server
>> > process being much quicker causing the .REG to be ready by the time
>> > the login script expects it.
>> > 
>>
>> Actually the login script starts and when the homes shared is mounted,
>> Samba runs the preexec script before allowing the client to mount the
>> share.
>
>> > 
>> > Are my assumptions correct?
>> >
>> > If yes, the only locking problem I need to worry about is when the
>> > same username tries to log in at two client stations at the same time
>> > - it could be possible that the one instance's preexec process could
>> > trample on the other's.
>
>> I don't think this is a problem normally.  Unless you preexec cript
>> locks files and has a possible deadlock condition.
>
>> ...
>
>I didn't see a description in the various messages of where the file actually
>is written.  If it is written to the \\server\netlogon directory, don't you
>get a locking problem with two or more users loggin in?  I mean, if you have
>a slow client logging on with one user, and a moment later, another user
>logging on another client.  If the file is actually changed before the first
>client gets to the point in its netlogon.bat script where it is using the
>reg file, does the first machine then create a registration entry that puts
>user1 in user2's profile location?  Is this a problem?
>
He was passing the username into the preexec script and storing the
registry file in that user's home directory, therefore only creating a
conflict if a user tries to logon simultaneously on 2 machines.

Perhaps the script should check to see if there already is a registry
file there before writing one, and only re-write it if it's say more
than a day old, that way you don't get conflicts of changing a file
before a full read is done by the 95 machine. I think even windows 95
takes less than a day to load, unless you enjoy waiting and have
installed it on the min spec (a 386 with 8mb ram I believe) :-). This
does of course assume that the registry file is only user dependant
and not machine dependant....perhaps if it were going to be machine
dependant a special 'registry' share could be created, something like
the following:

[registry]
    path = /home/registry/%m
    preexec = /home/registry/registry_create %m %u
    postexec = /home/registry/registry_remove %m %u

the preexec and postexec scripts creating/deleting the
/home/registry/%m directory and a registry file within it.
That way you would never get conflicts with multiple creates
simultaneously, unless of course someone manages to get windows95 to
allow multiple users to login at the same time on the same machine
:-).

This method may actually be better than the earlier suggested day old
check since it doesn't need as much work and doesn't have the problem
of another instance of the preexec checking the file date between your
file date check and re-write. If your not too bothered about having a
directory and file on the samba system for every win95 client then you
could even by-pass the time wasted in the postexec deleting
everything, and the time for the directory create in the preexec would
only need to be wasted if it isn't already there.


More information about the samba mailing list