sidux.com
Menu

News

Give back
Last 3 Contributions
30-11-2008 20.00
25-11-2008 100.00
25-11-2008 20.00

Donate


Sponsor
hetzner.de

Languages
Preferred language:



Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
diddy1234
Post subject: request for a script that will restart samba  PostPosted: Jul 15, 2008 - 03:14 PM



Joined: Feb 01, 2007
Posts: 399
Location: Hertfordshire, England
Status: Offline
unfortunately I do not have enough scripting experience, but I was wondering if anyone can help me with a script that does the following :-

If the user has mapped locations to samba shares and the sharing server is rebooted then the mount will never unmount locally.
the only way around this is to restart the samba service.

could this be done automaticly ?

i.e a small script runs that checks the mounts and if there is no response then stop and restart samba and then remount each mount.

_________________
ich weiß nicht
 
 View user's profile Send private message  
Reply with quote Back to top
h2
Post subject: RE: request for a script that will restart samba  PostPosted: Jul 15, 2008 - 06:03 PM



Joined: Nov 28, 2006
Posts: 4302

Status: Offline
To restart samba: as root: /etc/init.d/samba start

Re the testing, I'm not sure how you test a service that is technically running but isn't actually working or connected, that might be a useful thing I agree, but to do it automatically and be useful, the script would need to fire automatically every 5 minutes or so.

_________________
sidux Maintenance script: dist-upgrade, kernel install, general utilities: smxi
Backup script [using rdiff-backup]: rd-h2.sh
 
 View user's profile Send private message  
Reply with quote Back to top
op4latino
Post subject: RE: request for a script that will restart samba  PostPosted: Jul 16, 2008 - 12:20 AM



Joined: Dec 02, 2006
Posts: 1046
Location: East Coast
Status: Offline
I didn't quite understand the problem, but a test for samba could be

Code:
smbclient -L localhost -N >/dev/null && echo "yes" || echo "no"

The script returns "yes" if samba server is working.

to restart samba would be
Code:
/etc/init.d/samba restart
 
 View user's profile Send private message  
Reply with quote Back to top
diddy1234
Post subject: RE: request for a script that will restart samba  PostPosted: Jul 17, 2008 - 10:54 AM



Joined: Feb 01, 2007
Posts: 399
Location: Hertfordshire, England
Status: Offline
op4latino, what I was getting at was a script that looks at the active mounts to another pc and if there is no reply then to restart samba and then remount the various network mount points again.

i.e. build in some redundancy to samba

_________________
ich weiß nicht
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
 
Logos and trademarks are the property of their respective owners, comments are property of their posters, the rest is © 2006-2008 by sidux e.V., 10407 Berlin, Kniprodestr. 104. sidux e.V. is a Berlin, Germany based non-profit foundation. Consult Impressum and Legal Terms for details. sidux™ is Free Software released under the GNU/GPL license and other compatible licenses.
powered by Zikula & Zafenio