| Author |
Message |
|
|
Post subject: request for a script that will restart samba
Posted: Jul 15, 2008 - 04:14 PM
|
|

Joined: Feb 01, 2007
Posts: 390
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
|
| |
|
|
|
 |
|
|
Post subject: RE: request for a script that will restart samba
Posted: Jul 15, 2008 - 07:03 PM
|
|
Joined: Nov 28, 2006
Posts: 4197
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
|
| |
|
|
|
 |
|
|
Post subject: RE: request for a script that will restart samba
Posted: Jul 16, 2008 - 01:20 AM
|
|

Joined: Dec 02, 2006
Posts: 986
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
|
|
|
| |
|
|
|
 |
|
|
Post subject: RE: request for a script that will restart samba
Posted: Jul 17, 2008 - 11:54 AM
|
|

Joined: Feb 01, 2007
Posts: 390
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
|
| |
|
|
|
 |
|
|
|
|