Networking Forums

Networking Forums > Computer Networking > Linux Networking > Samba mounting problem

Reply
Thread Tools Display Modes

Samba mounting problem

 
 
Lawrence D¹Oliveiro
Guest
Posts: n/a

 
      01-17-2005, 10:52 PM
I have this Perl script that runs at system startup time to mount some
volumes via Samba off a Windows XP box. If it fails to mount the volumes
(presumably because the XP box is down), it requeues itself for
execution 60 seconds later via an at command. The relevant part of the
script is this:

for my $mount_point (keys %need_mounting)
{
# retry ones which haven't been done
my($settings, $status);
$settings = $need_mounting{$mount_point};
$status = system("/bin/mount", "-t", "smbfs", "-o",
$settings->{"options"}, $settings->{"share"}, $mount_point);
$status >>= 8;
if ($status == 0)
{
print $mount_point . " successfully mounted.\n";
delete $need_mounting{$mount_point};
} # if
} # for
if (scalar(keys %need_mounting) != 0)
{
# not all done, wait a while and try again
system "echo \"$0\" | at now +1 minutes";
} # if

This script always works fine if I invoke it manually. However, it never
seems to work at startup time. Instead, I get e-mail messages like this
from the at job:

SMB connection failed
5588: tree connect failed: ERRDOS - ERRnoaccess (Access denied.)
SMB connection failed
5590: tree connect failed: ERRDOS - ERRnoaccess (Access denied.)
SMB connection failed
5592: tree connect failed: ERRDOS - ERRnoaccess (Access denied.)
SMB connection failed
5594: tree connect failed: ERRDOS - ERRnoaccess (Access denied.)
warning: commands will be executed using (in order) a) $SHELL b) login
shell c)
/bin/sh
job 9911 at 2005-01-18 12:45

Now, can anyone tell me, what's different about the at-job execution
environment that causes the script to fail?

Thanks in advance for any suggestions.
 
Reply With Quote
 
 
 
 
Allen McIntosh
Guest
Posts: n/a

 
      01-17-2005, 11:22 PM

> This script always works fine if I invoke it manually.


If you were running this su'ed to root, try logging in as root instead
(use a console window). When you do this, your environment is different
(USER and USERNAME, for starters).
 
Reply With Quote
 
Lawrence D¹Oliveiro
Guest
Posts: n/a

 
      01-18-2005, 05:07 AM
In article <tLYGd.7672$(E-Mail Removed)>,
Allen McIntosh <(E-Mail Removed)> wrote:

>> This script always works fine if I invoke it manually.

>
>If you were running this su'ed to root, try logging in as root instead
>(use a console window).


I was logged in directly as root.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting NFS on Samba share snovgorodsky@gmail.com Linux Networking 1 03-26-2009 11:59 PM
Problem with mounting using eth0 addr Srinivasa T N Linux Networking 4 12-16-2008 01:14 PM
problem with samba mounting Radek R. Linux Networking 1 04-21-2005 03:41 PM
Problem mounting a Linux share in OS X Timur Tabi Linux Networking 3 12-20-2003 07:21 AM
Win XP/Samba problem p cooper Linux Networking 3 09-13-2003 09:10 AM



1 2 3 4 5 6 7 8 9 10 11