Results 1 to 3 of 3
Hi, not sure if this is in the right section as i am a serious newbie!
It's more of a windows xp question really but i thouhgt u guys might ...
- 06-21-2005 #1Just Joined!
- Join Date
- Jun 2005
- Posts
- 2
logging on to samba using windows xp
Hi, not sure if this is in the right section as i am a serious newbie!
It's more of a windows xp question really but i thouhgt u guys might have tried to do this in the past and might av some answers for me.
Basicly we are logging onto mandrake 10 running the samba server using a windows xp and are having problems with it hanging on the log on script, does anyone know why this is?
Also it loads each users space on the home directory as two drives, (H: which is speciafied in the logon script, and Z: )
Also the folders in these drives have one blue corner on the bottom left with a white arrow on them, does anyone know what this means?
any help would be greatly appriciated as we are really struggling!
Thanks
Ben
- 06-21-2005 #2
Could you post the login script and your smb.conf file?
The little white arrow may just be for offline synchronization, by the way.There are two major products that come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence.
- Jeremy S. Anderson
- 06-22-2005 #3Just Joined!
- Join Date
- Jun 2005
- Posts
- 2
logon and smb.conf
That's what i thought, do you know of any way of compleatly disabling synchronization?
This is the logon.sh file:
#!/bin/sh
user=$1
group=`groups $user | sed "s/.*: //g" | cut -f1 -d' '`
groups=`groups $user | sed -e "s/.*: //g" -e "s/ /,/g"`
machine=$2
server=`hostname | cut -f1 -d.`
domain=`dnsdomainname`
logon=/home/netlogon/$user$machine.bat
sed /usr/local/logon/data/logon.tmpl -e "s/%GROUPS%/$groups/g" -e "s/%USER%/$user/g" -e "s/%GROUP%/$group/g" -e "s/%MACHINE%/$machine/g" -e "s/%SERVER%/$server/g" -e "s/wensleydale.school/$domain/g" > $logon
chown admin $logon
chgrp staff $logon
chmod 755 $logon
This is the logon.pl perl file:
# The start up script for all PCs.
# 10/1/2000: XCOPY screws up Perl STDIN so $dummy=<> won't work - in fact it hangs!
use File::Copy;
use File::Path;
my $host = $ENV{"NETHOST"};
my $user = $ENV{"NETUSER"};
my $server = $ENV{"NETSERVER"};
my $domain = $ENV{"NETDOMAIN"};
my $group = $ENV{"NETGROUP"};
my @groups = split /,/,$ENV{"NETGROUP"};
my $debug = 0;
if (-f "//$server/netlogon/logon/data/debug")
{
$debug = 1;
}
if ($debug) {
print "Host: $host\n";
print "User: $user\n";
print "Server: $server\n";
print "Domain: $domain\n";
print "Group: $group\n";
print "Groups: @groups\n";
}
my $room = getRoom ($host);
if ($room eq "")
{
print "Cannot work out room from hostname $host.\n" if ($debug == 1);
}
else
{
print "$host is in room = $room\n" if ($debug == 1);
}
print "Executing per group and room scripts...\n" if ($debug == 1);
callPerRoom ($room);
print "Press RETURN\n" if ($debug == 1);
$dummy = <> if ($debug == 1);
print "Managing password files...\n" if ($debug == 1);
resetPWLFiles ($user);
print "Press RETURN\n" if ($debug == 1);
$dummy = <> if ($debug == 1);
print "Copying desktop...\n" if ($debug == 1);
copyDesktop ($room);
print "Press RETURN\n" if ($debug == 1);
print "Downloading files...\n" if ($debug == 1);
downloadFiles ();
print "Press RETURN\n" if ($debug == 1);
# Execute per-room batch files if they exist
sub callPerRoom # (room)
{
my ($room) = @_;
if (-f "//$server/netlogon/logon/data/global.bat") {
print "\tGlobal batch file exists.\n" if ($debug == 1);
system ("\\\\$server\\netlogon\\logon\\data\\global.bat") ;
} else {
print "\tNo global batch file exists.\n" if ($debug == 1);
}
print "User $user has no groups.\n" if ($#groups == -1 && $debug == 1);
foreach (@groups) {
if (-f "//$server/netlogon/logon/data/$_.bat") {
print "\tBatch file for group $_ exists.\n" if ($debug == 1);
system ("\\\\$server\\netlogon\\logon\\data\\$_.bat $server $room $user");
} else {
print "\tNo batch file for group $_ exists.\n" if ($debug == 1);
}
}
if (-f "//$server/netlogon/logon/data/$room.bat")
{
print "\tPer room batch file exists.\n" if ($debug == 1);
system ("\\\\$server\\netlogon\\logon\\data\\$room.BAT $server $room $user");
}
else
{
print "\tNo per room batch file.\n" if ($debug == 1);
}
}
# Download any files
sub downloadFiles
{
if (! -f "//$server/netlogon/logon/data/downloads.txt") {
print ("No downloads.txt, synchronisation disabled.") if ($debug == 1);
} else {
open (files, "//$server/netlogon/logon/data/downloads.txt");
while (<files>)
{
chomp;
my ($from, $to) = /(.*),(.*)/;
print "Synchronising $from with $to\n" if ($debug == 1);
if (!-d $from && -d $to)
{
print "\t$to is a folder. You must specify a filename.\n" if ($debug == 1);
}
else
{
my @temp = stat ($from);
$frommtime = $temp[9];
@temp = stat ($to);
$tomtime = $temp[9];
$sfrommtime = localtime ($frommtime);
$stomtime = localtime ($tomtime);
if ($debug == 1)
{
print "\t$from modified on $sfrommtime\n";
print "\t$to modified on $stomtime\n" if ($tomtime ne "");
}
if (($frommtime > $tomtime) || ($tomtime eq ""))
{
if (-d $from)
{
print "\tUpdating.\n" if ($debug == 1);
if (-d $to)
{
system ("DELTREE /Y $to");
}
system ("MKDIR $to");
system ("XCOPY $from $to /E /I");
}
else
{
print "\tUpdating.\n" if ($debug == 1);
copy ($from, $to) || warn "Copy failed.";
}
}
else
{
print "\tIn sync.\n" if ($debug == 1);
}
}
}
close (files);
}
}
#Copy desktop profiles and start menu
sub copyDesktop # ($room)
{
my ($room) = @_;
if ($room eq "")
{
print "Not copying desktop, room not worked out from hostname\n" if ($debug == 1);
}
else
{
my $roomDir = "\\\\$server\\MP\\r$room";
my $desktop="$roomDir\\Desktop";
my $programsMenu="$roomDir\\StartMenu\\Programs";
if (-d $desktop)
{
print "DELTREE /Y C:\\WINDOWS\\DESKTOP\n" if ($debug == 1);
system ("DELTREE /Y C:\\WINDOWS\\DESKTOP");
print "XCOPY $desktop C:\\WINDOWS\\DESKTOP /E /I\n" if ($debug == 1);
system ("XCOPY $desktop C:\\WINDOWS\\DESKTOP /E /I");
}
else
{
print "No desktop ($desktop) for $room\n" if ($debug == 1);
}
if (-d $programsMenu)
{
print "Copying program meny from $programsMenu to C:\\WINDOWS\Start Menu\Programs\n";
system ("DELTREE /Y \"C:\\WINDOWS\\Start Menu\\Programs\"");
system ("XCOPY $programsMenu \"C:\\WINDOWS\\Start Menu\\Programs\" /E /I");
}
else
{
print "No program menu ($programsMenu) for $room\n" if ($debug == 1);
}
}
print "copyDesktop () complete\n" if ($debug == 1);
}
# Copy the PWL files
sub resetPWLFiles # (user)
{
my ($user) = @_;
# We use system () here because File::Copy::copy doesn't seem to work with filenames with spaces in
system ('ATTRIB -R "C:\\WINDOWS\\START MENU\\Change Password.bat"');
system ('ERASE "C:\\WINDOWS\\START MENU\\Change Password.bat"');
system ("COPY \"\\\\$server\\netlogon\\logon\\data\\Change Password.lnk\" \"C:\\WINDOWS\\START MENU\\Change Password.lnk\"");
}
# Work out the room name - if it doesn't match r<room><host> then open C:\room.txt
# and use the hostname found in there
sub getRoom # (host)
{
my ($host) = @_;
my ($room) = $host =~ /r(.*?).\./;
if ($room eq "")
{
if (-f "C:/room.txt")
{
open (hostdef, "<C:/room.txt");
$fakehost = <hostdef>;
chomp $fakehost;
close (hostdef);
print "Using hostname from C:/room.txt [ $fakehost ] since hostname [ $host ] isn't in the form r<room>.domain.name\n" if ($debug == 1);
($room) = $fakehost =~ /r(.*)./;
}
else
{
print "Using hostname from C:/room.txt since hostname [ $host ] isn't in the form r<room>.domain.name - room.txt does not exist.\n" if ($debug == 1);
$room = "";
}
}
return $room;
}
This is the smb.conf file:
# Global parameters
workgroup = WENSLEYDALE
netbios name = server1
server string = WENSLEYDALE File Server
encrypt passwords = 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*success fully*
unix password sync = Yes
log file = /var/log/samba/log.%m
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
logon script = %U%m.bat
domain logons = Yes
domain master = Yes
local master = yes
preferred master = Yes
dns proxy = no
wins support = yes
hosts allow = 191.168. 127. 192.168.1.
interfaces = 191.168.0.1/255.255.252.0
printing = cups
printcap = cups
root preexec = /usr/local/logon/bin/logon.sh %U %m
add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u
delete user script = /usr/sbin/userdel -r %u
add machine script = /usr/local/bin/addmachine -d /dev/null -g 100 -s /bin/false -M %u
os level = 35
log level = 3
security = user
smb passwd file = /etc/samba/smbpasswd
username map = /etc/samba/smbusers
# smb ports = 445
[homes]
comment = Personal folders
browseable = No
create mask = 0700
read only = No
[netlogon]
path = /home/netlogon
comment = NT Domain Logon Files
browseable = No
create mask = 0755
directory mask = 0755
write list = admin
read list = @staff,admin,@pupils,@office
[mp]
path = /home/mp
comment = Standard machine profile
browseable = No
create mask = 0755
directory mask = 0755
write list = admin
read list = admin,@staff,@pupils,@office
[winlock]
path = /home/winlock
comment = WinLock files
browseable = No
create mask = 0755
directory mask = 0755
write list = admin
read list = @staff,admin,@pupils,@office
[ispy]
path = /home/ispy
comment = Ispy network files
browseable = No
create mask = 0755
directory mask = 0755
write list = admin
read list = @staff,admin,@pupils,@office
[ispyup]
path = /home/ispyup
comment = Ispy logs pending processing
browseable = No
create mask = 0777
directory mask = 0777
write list = admin,@staff,@pupils,@office
read list = @staff,admin,@pupils,@office
[office]
path = /home/office
comment = Read/Write by Office Staff only
browseable = No
create mask = 0770
directory mask = 0770
write list = @office
read list = @office
[multiplex]
path = /home/multiplex
comment = Multiplex network files
browseable = No
create mask = 0755
directory mask = 0755
write list = admin
read list = admin,@staff,@pupils,@office
[apps]
path = /home/apps
comment = Applications
browseable = No
create mask = 0755
directory mask = 0755
write list = admin
read list = admin,@staff,@pupils,@office
[shared]
path = /home/shared
comment = Shared files
browseable = No
create mask = 0777
directory mask = 0777
write list = admin,@staff,@pupils,@office
read list = admin,@staff,@pupils,@office
[cd_archive]
path = /home/cd_archive
comment = CD Archive
browseable = Yes
create mask = 0755
directory mask = 0755
write list = admin
read list = admin,@staff,@pupils,@office
[classmaterial]
path = /home/classmaterial
comment = Class Materials
browseable = Yes
create mask = 0775
directory mask = 0775
write list = admin,@staff
read list = admin,@staff,@pupils,@office
[public]
path = /home/public
comment = Shared files (cleared out every night)
browseable = Yes
create mask = 0777
directory mask = 0777
write list = admin,@staff,@pupils,@office
read list = admin,@staff,@pupils,@office
[staff]
path = /home/staff
comment = Shared files for staff
browseable = No
create mask = 0770
directory mask = 0770
write list = @staff
read list = @staff
[LASERC03]
create mask = 0777
printable = yes
comment = LASER Room C03
printer = laserc03
path = /var/spool/samba
[COLOURC03]
printer = colourc03
create mask = 0777
comment = Colour Room C03
valid users = @staff,@office
printable = yes
path = /var/spool/samba
[LASERB10]
path = /var/spool/samba
printer = laserb10
comment = Laser Room B10
printable = yes
create mask = 0777
[LASERC09]
create mask = 0777
printable = yes
comment = Laser Room C09
printer = laserc09
path = /var/spool/samba
[COLOURC09]
printer = colourc09
create mask = 0777
comment = Colour Room C09
valid users = @staff,@office
printable = yes
path = /var/spool/samba
[COLOURSTAFF]
printer = colourstaff
create mask = 0777
comment = Colour Staff room
valid users = @staff,@office
printable = yes
path = /var/spool/samba
[LASERSTAFF]
create mask = 0777
printer = laserstaff
comment = Laser Staff room
printable = yes
valid users = @staff,@office
path = /var/spool/samba
[LASEROFFICE]
printer = laseroffice
create mask = 0777
comment = Laser Office
valid users = @staff,@office
printable = yes
path = /var/spool/samba
[COLOUROFFICE]
printer = colouroffice
create mask = 0777
comment = Colour Office
valid users = @staff,@office
printable = yes
path = /var/spool/samba
[LASERC10]
create mask = 0777
printable = yes
comment = Laser Library
printer = laserc10
path = /var/spool/samba
[COLOURC10]
create mask = 0777
printable = yes
comment = Colour Library
printer = colourc10
path = /var/spool/samba
[LASERE08]
path = /var/spool/samba
printer = lasere08
comment = Laser Room E08
printable = yes
create mask = 0777
[LASERF02]
create mask = 0777
printable = yes
comment = Laser Youth Hall
printer = laserf02
path = /var/spool/samba
[COLOURF02]
create mask = 0777
printable = yes
comment = Colour Youth Hall
printer = colourf02
path = /var/spool/samba
[COLOURB01]
printer = colourb01
create mask = 0777
comment = Colour ComEd Office
valid users = @staff,@office
printable = yes
path = /var/spool/samba
[LASERB23]
printer = laserb23
create mask = 0777
comment = Laser KS3 Office
valid users = @staff,@office
printable = yes
path = /var/spool/samba
[COLOURB03]
create mask = 0777
printer = colourb03
comment = Colour Fin&ComEd Office
printable = yes
valid users = @staff,@office
path = /var/spool/samba
[LASERC15]
create mask = 0777
printable = yes
comment = Laser SEN
printer = laserc15
path = /var/spool/samba
[COLOURC15]
path = /var/spool/samba
printer = colourc15
comment = Colour SEN
printable = yes
create mask = 0777
[LASERJ01]
create mask = 0777
printable = yes
comment = Laser Art
printer = laserj01
path = /var/spool/samba
[COLOURJ01]
create mask = 0777
path = /var/spool/samba
printer = colourj01
comment = Colour Art
printable = yes
[LASERSCI]
path = /var/spool/samba
printer = lasersci
comment = Laser Science
printable = yes
create mask = 0777
[COPIER1]
path = /var/spool/samba
printer = copier1
valid users = @office,@staff
comment = Copier Staff Room
printable = yes
create mask = 0777
[COLOURC01]
create mask = 0777
printer = colourc01
comment = A3 Colour Room C01
printable = yes
valid users = @staff,@office
path = /var/spool/samba
[COLOURJ05]
create mask = 0777
printer = colourj05
comment = Colour Room j05
printable = yes
path = /var/spool/samba
[COLOURA3J05]
create mask = 0777
printer = coloura3j05
comment = A3 Colour Room j05
printable = yes
path = /var/spool/samba
[COLOURPE]
create mask = 0777
printer = colourpe
comment = Colour Room G09
printable = yes
valid users = @staff,@office
path = /var/spool/samba
Thanks.
Ben


Reply With Quote
