PBA bug - domain-settings/netlogon scripts not running

wierdo52
Posts: 5
Joined: Fri Jun 25, 2010 6:24 pm

PBA bug - domain-settings/netlogon scripts not running

Postby wierdo52 » Mon Feb 28, 2011 2:09 am

I have been trying to use the logon.bat script to mount user drives and apply Group Policy settings. However, the script shares.rb which generates smb.conf does not point to logon.bat, but rather %U.bat. Is this a bug?

Code: Select all

[global] domain logons = yes logon path = \\%L\profiles\%U logon drive = q: logon home = \\%N\%U logon script = %U.bat

I tried editing smb.conf first, but found that any changes I made in the [global] section were overwritten upon reboot by the shares.rb script. So I tried editing shares.rb but changes there were also overwritten on reboot. As a workaround, I wrote a shell script to copy logon.bat to %U.bat for each username - a clunky manual solution.

Basically, I think the code should default to logon script =logon.bat, or automatically create %U.bat files for each user.

User avatar
NeverSimple
Posts: 114
Joined: Sat Aug 21, 2010 4:26 pm
Location: The Netherlands

Re: PBA bug - domain-settings/netlogon scripts not running

Postby NeverSimple » Mon Feb 28, 2011 4:13 am

Hello,

I'm confused and/or don't understand you correctly. If you know how to write a shell script you probably know your way around Linux to some extent.
But then it would probably be obvious that, within the context of Samba, the %x are variables that are expanded:

%U is expanded to a username
%L is expanded to the NETBIOS name of the server
%N is expanded to the NIS home directory server, but it probably is the same as %L (or SAMBA should have been build with AUTOMOUNT support)

Richard

wierdo52
Posts: 5
Joined: Fri Jun 25, 2010 6:24 pm

Re: PBA bug - domain-settings/netlogon scripts not running

Postby wierdo52 » Mon Feb 28, 2011 6:59 pm

Yes, I am aware that %U means username. I used the variables as a shorthand form.

Most parts of the [global] settings are working correctly: user profiles are created at the correct location, the home folder for each user is mounted as Q: in Windows. What didn't work at first (until I fixed it by hand) was the logon scripts.

The smb.conf file is generated by the script "/var/hda/platform/html/app/models/share.rb" (see forum topic http://forums.amahi.org/viewtopic.php?f=6&t=1891). I edited shares.rb to change the logon drive from q: to t: but it was overwritten on reboot and didn't change smb.conf as I wanted. I couldn't figure out how to run shares.rb without rebooting.

The smb.conf defines the logon script as %U.bat but in the \\hda\netlogons folder (aka /var/hda/domain-settings/netlogons) the only file is logon.bat. When I first edited logon.bat to mount an additional network drive it didn't run. So I copied the contents of that file to seven different files, each named username1.bat, username2.bat, etc... Now the logon script works, but each time I make any changes I have to copy the script to each username. So I made a short shell script to do the job for me. I don't want to post it because it contains the usernames of each account on my hda.

I guess my question is: should we document this in the wiki as expected behavior or should it be filed as a bug that needs to be fixed? I guess the former, since most Amahi users won't need to use logon scripts at all.

Who is online

Users browsing this forum: No registered users and 8 guests