[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: smbfs & automount



Hello Patrick.

        As I remembered... the automount do not work with the smb shares. 
However...what I did is that I edited my script on the startup so it mounts
them automatically and you can remount it or unmount them with this script
which I hacked.

It is located at /etc/init.d/samba file and it worked like a charm.

---Start of the script

#!/bin/sh
#
# Start/stops the Samba daemons (nmbd and smbd).
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/samba/bin:
DEBIAN_CONFIG=/etc/samba/debian_config

# Sanity check: see if Samba has been configured on this system.
if [ ! -f $DEBIAN_CONFIG ]; then
       echo "The file $DEBIAN_CONFIG does not exist! There is something wrong"
       echo "with the installation of Samba on this system. Please re-install"
       echo "Samba. I can't continue!!!"
       exit 1
fi

# Read current Samba configuration
$DEBIAN_CONFIG

# If Samba is running from inetd then there is nothing to do (and we _can't_
#       do anything stupid like starting the Samba daemons because inetd is in
#       charge).
if [ "$run_mode" = "from_inetd" ]; then
        # Commented out to close bug #26884 (startup message is rather long). I
        #       have yet to think how to let the user know that if he/she is
        #       running
        #       Samba from inetd, he can't just "/etc/init.d/samba stop" to stop
        #       the Samba daemons.
       echo "Warning: Samba is not running as daemons. Daemons not
restarted/stopped."
       echo "Daemons will start automatically by inetd (if you wanted to start
Samba)."
       echo "If you want to stop Samba, get the PID's of all nmbd and smbd
processes"
       echo "and send them a SIGTERM signal but keep in mind that inetd could
restart them."
        exit 0
fi

# See if the daemons are there

test -x /usr/sbin/nmbd -a -x /usr/sbin/smbd || exit 0

case "$1" in
       start)
               echo -n "Starting Samba daemons:"

               echo -n " nmbd"
               start-stop-daemon --start --quiet --exec /usr/sbin/nmbd -- -D -a

               echo -n " smbd"
               start-stop-daemon --start --quiet --exec /usr/sbin/smbd -- -D
                
               sleep 20

               echo -n " Mounting Cyrix's Share"
                start-stop-daemon --start --quiet --oknodo  --exec
/usr/bin/smbmount //CYRIXM2/C /Cyrixm2 -- -I 192.168.0.5 -P
 password

               sleep 20
               echo -n " Mounting God Server's Share"
               start-stop-daemon --start --quiet --oknodo --exec
/usr/bin/smbmount //GOD_SERVER/C_GV2 /GodServer -- -I 192.168.0.1 -P password


               echo "."
               ;;
       stop)
               echo -n "Stopping Samba daemons:"

               echo -n " Unmounting Cyrix C Share"
               start-stop-daemon --stop --quiet --oknodo --exec
/usr/bin/smbumount /Cyrixm2
               sleep 15
               echo -n " Unmounting God Server C Share"
               start-stop-daemon --stop --quiet --oknodo --exec
/usr/bin/smbumount /GodServer
               sleep 15
               echo -n " nmbd"
               start-stop-daemon --stop --quiet --exec /usr/sbin/nmbd -- -D -a

               echo -n " smbd"
               start-stop-daemon --stop --quiet --exec /usr/sbin/smbd -- -D

               echo "."
               ;;
       restart|force-reload)
               echo -n "Restarting Samba daemons:"
               echo -n " Unmounting Cyrixm2 Share"
               start-stop-daemon --stop --quiet --oknodo --exec
/usr/bin/smbumount /Cyrixm2
               sleep 20
               echo -n " Unmounting GodServer Share"
               start-stop-daemon --stop --quiet --oknodo --exec
/usr/bin/smbumount /GodServer
               sleep 30
               echo -n " nmbd"
               start-stop-daemon --stop --quiet --exec /usr/sbin/nmbd -- -D -a
               sleep 2
               start-stop-daemon --stop --quiet --exec /usr/sbin/smbd -- -D

               echo -n " smbd"
               start-stop-daemon --start --quiet --exec /usr/sbin/nmbd -- -D -a
               sleep 2
               start-stop-daemon --start --quiet --exec /usr/sbin/smbd -- -D
               sleep 20
               echo -n " Mounting CyrixM2 C Share"
               start-stop-daemon --start --quiet --oknodo --exec
/usr/bin/smbmount //CYRIXM2/C /Cyrixm2 -- -I 192.168.0.5 -P password
               sleep 20
               echo -n " Mounting God Server C Share"
               start-stop-daemon --start --quiet --oknodo --exec
/usr/bin/smbmount //GOD_SERVER/C_GV2 /GodServer -- -I 192.168.0.1 -P password

               echo "."
               ;;
       *)
               echo "Usage: /etc/init.d/samba {start|stop|restart}"
               exit 1
               ;;
esac

exit 0

---- End of the Script ----

On 15-Mar-99 Patrick wrote:
> 
> does someone has succeeded in mounting remote smb shares with automount ?
> 
> i have a debian 2.1 with smbfsx and samba
> but when trying i have in my log only:
> automount[25275]: cannot find mount method for filesystem smbfs
> 
> what am i missing ?
> 
> thanks for your help.
> 
> Patrick
> 
> 
> -- 
> Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org <
> /dev/null

----------------------------------
Date: 15-Mar-99          Time:14:14:01
Russell Rademacher
Grapevine2 Technical Support Specialist
Pager: 800-480-9498 #1041
Phone: 716-214-5644
Fax: 716-214-5642
TDD: 716-214-5643
ICQ: 10663810
AIM: ElikCyber
----------------------------------


Reply to: