preexec and postexec problem

ben ben at postman.co.za
Wed Feb 13 01:30:14 GMT 2002


Hi there,

I have successfully (i hope) installed and configured samba-2.2.3a.tar.gz as
a domain controller on Linux Redhat 6.0,
for 15 98 pc's.

my ./configure line was

--------------Snip------------------------[configuring Samba]------------

./configure \
        --prefix=/usr/local/samba \
        --sysconfdir=/usr/local/samba/etc \
        --localstatedir=/usr/local/samba/var \
        --with-privatedir=/usr/local/samba/private \
        --with-swatdir=/usr/local/samba/swat \
        --with-automount \
        --with-smbmount \
        --with-pam_smbpass \
        --with-syslog \
        --with-utmp \
        --with-vfs \
        --with-libsmbclient \
        --with-logfilebase=/usr/local/samba/var/log \
        --with-lockdir=/usr/local/samba/var/locks

--------End of Snip----------------------------[configuring
Samba]-------------

Win98 machines are successfully doing domain logins on it.

My problem is that when ever a successful domain logon or domain logoff
occurs on the Samba server, from one of the win98 machines, 
both the preexec and postexec lines gets executed.

It doesn't matter if the preexec and postexec lines are in the [netlogon] or [global] section.

I need to control this internet cafee so all i want samba 2 do is 2 run a start_time script (that writes the start_time fo that user to a file)
after succesfull login and another one at logof time(that writes the end_time of that user 2 a file).
then we know how much to bill the person.
If i put preexec in the [netlogon] section it also gets executed when some one 
doubleclick on the share in netw. neighbourhood.

where can i put the preexec and post exec lines to execute only once ?

Thanx in advance for any help.


~ben


any help would be appreciated.

Enjoy the day

-------------Snip------------------------[.../smb.conf]---------------------
--------------

[global]
    preexec = echo "%u connected to %S from %m (%I) on %T %d" >>
/tmp/log_started
    postexec = echo "%u disconnected from %S from %m (%I) on %T %d" >>
/tmp/log_finished

    ; Basic server settings
    netbios name = computeriaserv
    workgroup = computeriad

    ; we should act as the domain and local master browser
    os level = 64
    preferred master = yes
    domain master = yes
    local master = yes

    ; security settings (must user security = user)
    security = user

    ; encrypted passwords are a requirement for a PDC
    encrypt passwords = yes

    ; support domain logons
    domain logons = yes

    ; where to store user profiles?
    logon path = \\%N\profiles\%u

    ; where is a user's home directory and where should it
    ; be mounted at?
    logon drive = H:
    logon home = \\homeserver\%u

    ; specify a generic logon script for all users
    ; this is a relative **DOS** path to the [netlogon] share
    logon script = logon.cmd

; necessary share for domain controller
[netlogon]
    path = /var/samba/users/netlogon/%U
    ;preexec = echo "%u connected to %S from %m (%I) on %T %d" >>
/tmp/log_started
    writeable = no
    write list = ntadmin
    ;postexec = echo "%u disconnected from %S from %m (%I) on %T %d" >>
/tmp/log_finished

; share for storing user profiles
[profiles]
    path = /var/samba/users/profiles/%U
    writeable = yes
    create mask = 0600
    directory mask = 0700
-----------------------------------end of snip
[.../smb.conf]-------------------------------



~Dreams are free,
avoid reality at all costs.
benat_sign_herepostman.co.za


-------------- next part --------------
HTML attachment scrubbed and removed


More information about the samba-technical mailing list