[Samba] Re: Samba - root preexec & login scripts
John Benedetto
jbenedet at unm.edu
Wed Oct 30 20:12:00 GMT 2002
--On Wednesday, October 30, 2002 8:46 PM +0100 Walter Mautner
<rentuam_retlaw at hotmail.com> wrote:
>> Last night at home, and on a second system today at work, I
>> tried putting in the sample preexec statement contained in
>> the smb.conf man page to check it's effect on the domain
>> logons. Just like the preexec for the perl script it kills
>> domain logons. As that script is right in the smb.conf man
>> page I'd certainly expect that to work.
>>
>> As one final shot at this I'll post my smb.conf for some of
>> you to examine. I've removed all the comments in an effor to
>> minimize size. The preexec statement is in the netlogon section.
>>
>> Thanks.
>>
>> --
>> Mike Rambo
>> mrambo at lsd.k12.mi.us
>>
>>
>> # ======================= Global Settings
>> =====================================
>> [global]
>>
>> workgroup = IMCDOMAIN
>> netbios name = linuxts1
>> server string = Samba PDC %v
>> hosts allow = 192.168.3. 127.
>> printcap name = /etc/printcap
>> load printers = yes
>> log file = /var/log/samba/log.%m
>> log level = 5
>> max log size = 50
>> security = user
>> encrypt passwords = yes
>> smb passwd file = /etc/samba/smbpasswd
>> unix password sync = Yes
>> passwd program = /usr/bin/passwd %u
>> passwd chat = *New*UNIX*password* %n\n
>> *ReType*new*UNIX*password* %n\n
>> *passwd:*all*authentication*tokens*updated*successfully*
>> socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=8192
>> SO_SNDBUF=8192
>> interfaces = 192.168.3.1/24
>> os level = 63
>> domain master = yes
>> preferred master = yes
>> domain logons = yes
>> domain admin group = @adm
>> add user script = /usr/sbin/useradd -d /dev/null -g
>> machines -c 'Machine Account' -s /bin/false -M %u
>> logon script = %U.bat
>> logon path = \\%L\Profiles\%U
>> logon home = \\%L\%U\.profile
>> logon drive = L:
>> wins support = yes
>> dns proxy = no
>>
>> # ============================ Share Definitions
>> ============================== [homes]
>> comment = Home Directories
>> browseable = no
>> writable = yes
>> create mask = 0750
>> directory mask = 0750
>>
>> [netlogon]
>> comment = Network Logon Service
>> path = /home/netlogon
>> guest ok = yes
>> read only = yes
>> browseable = no
>> printable = no
>> write list = @adm
>> share modes = no
>> # root preexec = perl /home/netlogon/netlogon.pl %U
>> preexec = echo \"%u connected to %S from %m (%I)\" >> /tmp/log
>>
> Probably it's too simple: you have to supply absolute paths to
> your commands :)
>
I am worried about two things -
The first might be a typo, but you have a pound sign, commenting out the
"root preexec" line, and the other is: Do you need to preface your command
with "perl"? Why not specify it on the first line that you need perl?
Something like the traditional first line in script:
#!/usr/bin/perl
Which would make the root preexec line:
root preexec = /home/netlogon/netlogon.pl %U
???
- john
More information about the samba
mailing list