[Samba] Samba 3.0.0.-2 logon script not running!

Peter Atkin peter at computer-facilities.com
Thu Oct 23 17:22:15 GMT 2003


I've struggled with this for a few weeks and can't get anywhere.  I'd like for someone to point me in the right 
direction, if possible.

I have laid out below my complete samba setting in the hope that 
1) Someone can find a solution to my current problem 
2) It might help someone else, as I overcame a few problems with these settings myself, under samba 2.2.8a.. please note 
some settings are for Samba 3 only I do have the samba 2.2.8a  scripts archived for anyone that wants, that is fully 
working with no bugs that I know of.

I been running samba server now for almost a year with very few problems, although to be fair i don't use most of the 
features, I really just use it for authentication and managing the domain, all the user files are stored on 2 500GB NAS 
devices POP4500 series, their a little slow and bit problematic but works mostly. 

I felt the need to upgrade, as I could not get the NAS devices to join my domain running under Samba 2.2.8a. But that is 
another problem and story for later.

I’ve managed to get Samba 3.0.0-2 almost working, I removed all of the Samba 2.2.8a RPM’s 3 of them client, server and 

I should state that all was working very well until I installed the new Samba 3 RPM., Because of the errors I suspect 
something to do with the RPC but I am really not sure..

-I can join the domain from any win9x, W2K and XP machine
-I can view and use the samba Directories as required.
-all seems to work well except to logon scripts.

I then installed the single RPMS, samba-3.0.0-2_rh8.i386.rpm and then setup my smbfs mount points so they would work
can do everything but run my logon scripts, when I view my set variables on a W2K machine I get:

to test the installation "smbclient -L //smb_server"
Password: xxxx

        Sharename      Type      Comment
        ---------      ----      -------
        netlogon       Disk      Network Logon Service
        smbdiags       Disk      temp diag directory
        Samba Logs     Disk      RedHat8 Samba 3.0.0 user log directory

        Server               Comment
        ---------            -------
        CORE                 POPnetserver (
        SMB_SERVER           Samba 3.0.0 File Server
        TOSHIBA-USER         Tasha Laptop

        Workgroup            Master
        ---------            -------
        CFU                  SMB_SERVER
        XXX                  BACKUP

I belive according to the documenation this is a good indication that  Samba is fully working and install correctly? I 

Now to my problem...

USERPROFILE=C:\Documents and Settings\peter.CFU

The thing to note here is that the HOMEDRIVE is no longer H: it now has a bit of the 
HOMEPATH stuck in it, and then the HOMEPATH has the remainder.

What is should look like is this:

When I check the smb.conf file all seems well, even when I do a “testparm –v” I can find no 

Can anyone help, this all worked well on Samba 2.2.8a, I assume I have not done somthing correctly, looking through the 
news groups shine no light on the subject.

smb.conf script
# Computer Facilities
# currently and always under delvelopment using samba 3.0.0 on linux 8 
# /etc/samba/smb.conf
# last edit date was 12/10/2003 (D/M/Y)


        # to allow a SAMBA server to look and act like a windows PDC server
        # Basic domain and machine name settings
        workgroup = cfu
        netbios name = SMB_Server
        server string = Samba %v File Server
        name resolve order = wins lmhosts bcast
        smb ports = 139 445

        domain logons = yes
        domain master = yes
        dns proxy = No
        preferred master = yes
        local master = yes
        os level = 250
        security = user
        admin users  = @admins

        # If you run your samba server on a machine that has a valid IP address to the Internet, or
        # an an untrusted LAN,  you'll probably want to limit who can connect to your Samba shares.
        # Assuming your server runs on,
        # your netmask is and you wish to deny access to a host in your network on
        # which in this case is my internet, nas and mail server just as an example.
        hosts allow = EXCEPT
        hosts deny =
        remote announce =

        # Speedup options for database use: Whether you are using Microsoft Access, 
        # FoxPro, Quickbooks or CA-Clipper, with any multi-user fileserver database 
        # application there are configurations. Please note to use the 95 and NT client 
        # side program ccreg.zip can be found under //nas_server/Source/Linux/samba/clientfix
        # Please note that I have experianced problems with onboard and or cheaper 
        # networkcards when playing with "socket options" (22/10/03)

        socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192
        ;socket options = TCP_NODELAY SO_SNDBUF=20480 SO_RCVBUF=20480 IPTOS_LOWDELAY # for database work
        lock spin time = 15
        lock spin count = 100
        level2 oplocks = no
        oplocks = no
        getwd cache = yes

        # this creates a log file e.g peter-reception.log in the directory /samba/logs/ this
        # is very usfull, it not only tells you the user but also the machine, so if their are
        # any SAMBA errors they can be quickly found, I hope. (I found these lines to be the most
        # usfull for debugging)
        log level = 1
        log file = "/etc/samba/logs/%U-%m.log"
        max log size = 100

        # The following two lines disable roaming profiles for windows clients
        # to enable put in the logon home and path
        logon path =
        logon home =

        # Assign users there logon home drive and unique script
        # %U session  user  name  (the  user name that the client wanted, not
        # necessarily the same as the one they got).
        # %u user name of the current service, if any.
        # %H  the home directory of the user given by %u.
        logon drive = H:
        logon home = \\core\%u
        logon script = %u.bat

        # Prevent browsing by default
        browseable = no

        # Default case of files that are created
        default case = lower

        # controls whether filenames are case sensitive.  If  they  aren't
        # then  Samba must do a filename search and match on passed names.
        # Default no. 
        case sensitive = no

        # controls  if new files are created with the case that the client
        # passes, or if they are forced to be the "default" case.  Default
        # yes.
        preserve case = no

        # Encrypt all passwords stored in /etc/samba/smbpasswd
        encrypt passwords = yes

        password level = 8
        username level = 8

        # if the user has logged on and no files are open then after 15min the user will be 
        # logged out.
        deadtime = 15

        # so the SAMBA server can also act as a time server
        time server = yes

        # Files that have their Linux permissions set to prevent access shouldn't even appear
        hide unreadable = yes

        # It's also useful to limit the interfaces on which Samba will run, if you have a multihomed
        # (more than one IP address) server. 
        # A common mistake is to set the interfaces line to the specific IP address of the box, when
        # it is actually the IP subnet 
        # that your interface is on that you want to use. Assuming your server runs on and 
        # your netmask is
        interfaces =
        bind interfaces only = Yes

        # Make smbuser account root with same password as linux root
        # (smbadduser root:root)
        # Make account for netlogon
        # (mkdir --mode=0775 /home/netlogon)
        # (chown root.admin /home/netlogon)
        # ("chmod" is for the -mode- (read, write or execute) and "chown" is for -ownership-)
        # (group add machines) so the add user script works when you log a new windows machine onto 
        # the network (/etc/rc.d/init.d/smb restart) restart the samba server for changes to be 
        # implementated:
        unix password sync = true
        passwd program = /usr/bin/passwd %u
        passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n 
        add user script = /usr/sbin/useradd -d /dev/null \
                                -d /dev/null  \
                                -g machines   \
                                -s /bin/false \
                                -M %u

        # setting for RAV antivirus
        # update process is controlled by /etc/opt/rav/ravfsdupdate.conf. This script 
        # must be executed periodically in order to have the latest version of virus signaures
        # I would recommend running ravfsdupdate.conf via a cron jobevery day.
        # The configuration for RAV AntiVirus for Unices File Servers is located in 
        # /etc/opt/rav/ravfsd.conf.
        ;comment = Rav Antivirus Settings
        ;vfs object = /opt/rav/lib/ravsamba.so

        comment = Users network home directory
        path = /mnt/nas/users/u%
        ;read only = no
        ;create mode = 0600
        ;directory mode = 0700

        comment = Network Logon Service 
        path = /mnt/nas/logon
        write list = @admin
        guest ok = no
        browseable = yes

        comment = temp diag directory
        path = /etc/samba/scripts/
        browseable = yes
        root preexec = echo " \"T %T \" \"d %d \" \"v %v \" \"h %h \" \"L %L \" \"N %N \" \"p %p \" \"R %R \" \"S %S \" 
\"P %P \" \"U %U \" \"G
 %G \" \"u %u \" \"g %g \" \"H %H \" \"I %I \" \"M %M \" \"m %m \" \"a %a \"" | xargs -n1 /etc/samba/scripts/samba-
smbinfo; smbclient -U %L -M 
%m </etc/samba/scripts/smbinfo;\
        cp -f /etc/samba/scripts/smbinfo /mnt/nas/users/%U;\
        rm -f /etc/samba/scripts/smbinfo &

        comment = RedHat9 Linux RPM's
        path = /usr/RPMS/
        write list = @admin
        guest ok = no
        directory mode = 0700

[Samba Logs]
        comment = RedHat8 Samba %v user log directory
        path = /etc/samba/logs/
        browseable = yes
        guest ok = no
        read only = yes

rc.local script
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

# Samba 2.2.8a
# mount -t smbfs -o username=xxxx,password=xxxx //core/users /mnt/nas/users
# mount -t smbfs -o username=xxxx,password=xxxx //core/backup /mnt/nas/backup
# mount -t smbfs -o username=xxxx,password=xxxx //core/logon /mnt/nas/logon
# mount -t smbfs -o username=xxxx,password=xxxx //core/source /mnt/nas/source

# Samba 3
mount -t smbfs -o credentials=/etc/samba/service.conf,port=139,ttl=10000 //core/users /mnt/nas/users
mount -t smbfs -o credentials=/etc/samba/service.conf,port=139,ttl=10000 //core/backup /mnt/nas/backup
mount -t smbfs -o credentials=/etc/samba/service.conf,port=139 //core/logon /mnt/nas/logon
mount -t smbfs -o credentials=/etc/samba/service.conf,port=139,ttl=10000 //core/source /mnt/nas/source
mount -t smbfs -o credentials=/etc/samba/service.conf,port=139 //core/quickbooks /mnt/nas/quickbooks


username = xxxx
password = xxxx

More information about the samba mailing list