ALT Linux repositórios
S: | 4.17.11-alt1 |
5.0: | 3.0.33-alt4 |
4.1: | 3.0.30-alt3 |
4.0: | 3.0.33-alt1.M40.1 |
+updates: | 3.0.33-alt1.M40.1 |
3.0: | 3.0.14a-alt2 |
+backports: | 3.0.28-alt1 |
Group :: Sistema/Servidores
RPM: samba
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
#!/bin/sh
#
# chkconfig: - 91 35
# description: Starts and stops the Samba smbd and nmbd daemons \
# used to provide SMB network services.
# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
SourceIfNotEmpty /etc/sysconfig/network
# Check that smb.conf exists.
[ -s /etc/samba/smb.conf ] || exit
#
# msg_
#
export TMPDIR=/tmp
LOCKFILE=/var/lock/subsys/smb
RETVAL=0
start()
{
is_yes "$NETWORKING" || return 0
echo -n "Starting CIFS services: "
echo -n " NetBIOS over TCP/IP server,"
start-stop-daemon --start --quiet --exec /usr/sbin/nmbd -- -D
RETVAL=$?
echo -n " Samba server"
start-stop-daemon --start --quiet --exec /usr/sbin/smbd -- -D
RETVAL2=$?
if [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] ; then
success "CIFS startup"
touch "$LOCKFILE"
else
RETVAL=1
failure "CIFS startup"
fi
echo
return $RETVAL
}
stop()
{
echo -n "Shutting down CIFS services: "
echo -n " Samba server,"
# before shutting down the server, force share closing.
# This way the client will be notified about change of server state
smbcontrol smbd shutdown >/dev/null 2>&1
RETVAL=$?
echo -n " NetBIOS over TCP/IP server"
nmbpid=`cat /var/lock/nmbd.pid 2>/dev/null`
if [ -z $nmbpid ]; then
nmbpid="nmbd"
fi
smbcontrol $nmbpid shutdown >/dev/null 2>&1
RETVAL2=$?
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && success "CIFS shutdown"
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] || failure "CIFS shutdown"
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f "$LOCKFILE"
echo
return $RETVAL
}
restart()
{
stop
start
}
reload()
{
echo -n "Reloading smb.conf file: "
echo -n " NetBIOS over TCP/IP server,"
nmbpid=`cat /var/lock/nmbd.pid 2>/dev/null`
if [ -z $nmbpid ]; then
nmbpid="nmbd"
fi
smbcontrol $nmbpid reload-config >/dev/null 2>&1
RETVAL2=$?
echo -n " Samba server"
smbcontrol smbd reload-config >/dev/null 2>&1
RETVAL=$?
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && success "CIFS shutdown"
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] || failure "CIFS shutdown"
echo
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
status)
status smbd
RETVAL=$?
status nmbd
RETVAL2=$?
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] ||
RETVAL=1
;;
*)
msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|status}"
RETVAL=1
esac
exit $RETVAL