summaryrefslogtreecommitdiff
path: root/packaging/RedHat
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/RedHat')
-rw-r--r--packaging/RedHat/README12
-rwxr-xr-xpackaging/RedHat/findsmb145
-rw-r--r--packaging/RedHat/makerpms.sh.tmpl80
-rw-r--r--packaging/RedHat/samba2.spec.tmpl112
-rwxr-xr-xpackaging/RedHat/smb.init17
-rw-r--r--packaging/RedHat/winbind.init91
6 files changed, 240 insertions, 217 deletions
diff --git a/packaging/RedHat/README b/packaging/RedHat/README
index 210248fa35..646b10dbbb 100644
--- a/packaging/RedHat/README
+++ b/packaging/RedHat/README
@@ -1,11 +1,13 @@
-Preparation Date: Fri Aug 21, 1998
-Preparer: John H Terpstra <jht@samba.org>
+Preparer: Gerald Carter <jerry@samba.org>
-Instructions: Preparing Samba Packages for Red Hat Linux 5.X
+Instructions: Preparing Samba Packages for Red Hat Linux
===============================================================
-We provide support only for current versions of Red Hat Linux.
+We provide support only for the latest stable release of major
+branches (e.g 6.2, 7.3, and 8.0). The makerpms.sh script
+supports rpm version 2.x, 3.x, and 4.x
To produce the RPMS simply type:
- sh makerpms.sh
+
+ root# sh makerpms.sh
diff --git a/packaging/RedHat/findsmb b/packaging/RedHat/findsmb
deleted file mode 100755
index 04bc608050..0000000000
--- a/packaging/RedHat/findsmb
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/usr/bin/perl
-#
-# Prints info on all smb responding machines on a subnet.
-# This script needs to be run on a machine without nmbd running and be
-# run as root to get correct info from WIN95 clients.
-#
-# syntax:
-# findsmb [subnet broadcast address]
-#
-# with no agrument it will list machines on the current subnet
-#
-# There will be a "+" in front of the workgroup name for machines that are
-# local master browsers for that workgroup. There will be an "*" in front
-# of the workgroup name for machines that are the domain master browser for
-# that workgroup.
-#
-
-$SAMBABIN = "/usr/bin";
-
-for ($i = 0; $i < 2; $i++) { # test for -d option and broadcast address
- $_ = shift;
- if (m/-d|-D/) {
- $DEBUG = 1;
- } else {
- if ($_) {
- $BCAST = "-B $_";
- }
- }
-}
-
-sub ipsort # do numeric sort on last field of IP address
-{
- @t1 = split(/\./,$a);
- @t2 = split(/\./,$b);
- @t1[3] <=> @t2[3];
-}
-
-# look for all machines that respond to a name lookup
-
-open(NMBLOOKUP,"$SAMBABIN/nmblookup $BCAST '*'|") ||
- die("Can't run nmblookup '*'.\n");
-
-# get rid of all lines that are not a response IP address,
-# strip everything but IP address and sort by last field in address
-
-@ipaddrs = sort ipsort grep(s/ \*<00>.*$//,<NMBLOOKUP>);
-
-# print header info
-
-print "\nIP ADDR NETBIOS NAME WORKGROUP/OS/VERSION $BCAST\n";
-print "---------------------------------------------------------------------\n";
-
-foreach $ip (@ipaddrs) # loop through each IP address found
-{
- $ip =~ s/\n//; # strip newline from IP address
-
-# find the netbios names registered by each machine
-
- open(NMBLOOKUP,"$SAMBABIN/nmblookup -r -A $ip|") ||
- die("Can't get nmb name list.\n");
- @nmblookup = <NMBLOOKUP>;
- close NMBLOOKUP;
-
-# get the first <00> name
-
- @name = grep(/<00>/,@nmblookup);
- $_ = @name[0];
- if ($_) { # we have a netbios name
- if (/GROUP/) { # is it a group name
- ($name, $aliases, $type, $length, @addresses) =
- gethostbyaddr(pack('C4',split('\.',$ip)),2);
- if (! $name) { # could not get name
- $name = "unknown nis name";
- }
- } else {
-# The Netbios name can contain lot of characters also '<' '>'
-# and spaces. The follwing cure inside name space but not
-# names starting or ending with spaces
- /(.{1,15})\s+<00>\s+/;
- $name = $1;
- }
-
-# do an smbclient command on the netbios name.
-
- open(SMB,"$SAMBABIN/smbclient -N -L $name -I $ip -U% |") ||
- die("Can't do smbclient command.\n");
- @smb = <SMB>;
- close SMB;
-
- if ($DEBUG) { # if -d flag print results of nmblookup and smbclient
- print "===============================================================\n";
- print @nmblookup;
- print @smb;
- }
-
-# look for the OS= string
-
- @info = grep(/OS=/,@smb);
- $_ = @info[0];
- if ($_) { # we found response
- s/Domain=|OS=|Server=|\n//g; # strip out descriptions to make line shorter
-
- } else { # no OS= string in response (WIN95 client)
-
-# for WIN95 clients get workgroup name from nmblookup response
- @name = grep(/<00> - <GROUP>/,@nmblookup);
- $_ = @name[0];
- if ($_) {
-# Same as before for space and characters
- /(.{1,15})\s+<00>\s+/;
- $_ = "[$1]";
- } else {
- $_ = "Unknown Workgroup";
- }
- }
-
-# see if machine registered a local master browser name
- if (grep(/<1d>/,@nmblookup)) {
- $master = '+'; # indicate local master browser
- if (grep(/<1b>/,@nmblookup)) { # how about domain master browser?
- $master = '*'; # indicate domain master browser
- }
- } else {
- $master = ' '; # not a browse master
- }
-
-# line up info in 3 columns
-
- print "$ip".' 'x(16-length($ip))."$name".' 'x(14-length($name))."$master"."$_\n";
-
- } else { # no netbios name found
-# try getting the host name
- ($name, $aliases, $type, $length, @addresses) =
- gethostbyaddr(pack('C4',split('\.',$ip)),2);
- if (! $name) { # could not get name
- $name = "unknown nis name";
- }
- if ($DEBUG) { # if -d flag print results of nmblookup
- print "===============================================================\n";
- print @nmblookup;
- }
- print "$ip".' 'x(16-length($ip))."$name\n";
- }
-}
-
diff --git a/packaging/RedHat/makerpms.sh.tmpl b/packaging/RedHat/makerpms.sh.tmpl
index 44b89a45ec..4b01e13df3 100644
--- a/packaging/RedHat/makerpms.sh.tmpl
+++ b/packaging/RedHat/makerpms.sh.tmpl
@@ -1,25 +1,59 @@
#!/bin/sh
-# Copyright (C) John H Terpstra 1998
+# Copyright (C) John H Terpstra 1998-2002
# Updated for RPM 3 by Jochen Wiedmann, joe@ispsoft.de
# Changed for a generic tar file rebuild by abartlet@pcug.org.au
+# Changed by John H Terpstra to build on RH7.2 - should also work for earlier versions jht@samba.org
+
+# The following allows environment variables to override the target directories
+# the alternative is to have a file in your home directory calles .rpmmacros
+# containing the following:
+# %_topdir /home/mylogin/redhat
+#
+# Note: Under this directory rpm expects to find the same directories that are under the
+# /usr/src/redhat directory
+#
+if [ -x ~/.rpmmacros ]; then
+ TOPDIR=`awk '/topdir/ {print $2}' < ~/.rpmmacros`
+ if [ z$TOPDIR <> "z" ]; then
+ SPECDIR=${TOPDIR}/SPECS
+ SRCDIR=${TOPDIR}/SOURCES
+ fi
+fi
+
+SPECDIR=${SPECDIR:-/usr/src/redhat/SPECS}
+SRCDIR=${SRCDIR:-/usr/src/redhat/SOURCES}
+
+# At this point the SPECDIR and SRCDIR vaiables must have a value!
+
USERID=`id -u`
GRPID=`id -g`
VERSION='PVERSION'
-rm -f ../../samba2.*.spec
+RPMVER=`rpm --version | awk '{print $3}'`
+RPM="rpm"
+echo The RPM Version on this machine is: $RPMVER
-case `rpm --version | awk '{print $3}'` in
- 2.*)
- sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba2.spec > samba2.rpm2.spec
- cp samba2.rpm2.spec ../../
+case $RPMVER in
+ 2*)
+ echo Building for RPM v2.x
+ sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba2.spec > samba.spec
+ sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba2-devel.spec > samba-devel.spec
+ ;;
+ 3*)
+ echo Building for RPM v3.x
+ sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba2.spec > samba.spec
+ sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba2-devel.spec > samba-devel.spec
;;
- 3.*)
- sed -e "s/MANDIR_MACRO/\%\{prefix\}\/man/g" < samba2.spec > samba2.rpm3.spec
- cp samba2.rpm3.spec ../../
+ 4.1*)
+ echo Building for RPM v4.1
+ RPM="rpmbuild"
+ sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba2.spec > samba.spec
+ sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba2-devel.spec > samba-devel.spec
;;
- 4.*)
- sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba2.spec > samba2.rpm4.spec
- cp samba2.rpm4.spec ../../
+ 4*)
+ echo Building for RPM v4.x
+ sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba2.spec > samba.spec
+ sed -e "s/MANDIR_MACRO/\%\{_mandir\}/g" < samba2-devel.spec > samba-devel.spec
;;
*)
echo "Unknown RPM version: `rpm --version`"
@@ -29,10 +63,28 @@ esac
( cd ../../source; if [ -f Makefile ]; then make distclean; fi )
( cd ../../.. ; chown -R ${USERID}.${GRPID} samba-${VERSION} )
-( cd ../../.. ; tar --exclude=CVS -czvf samba-${VERSION}.tar.gz samba-${VERSION}/samba2.*.spec samba-${VERSION} )
-rpm -ta -v ../../../samba-${VERSION}.tar.gz
+# We do this to make sure that the package always has the current version in it''s name
+if [ z$1 = z"devel" ]; then
+ (cd ../../.. ; mv samba samba-${VERSION} )
+fi
+
+( cd ../../.. ; tar --exclude=CVS -cf - samba-${VERSION} | bzip2 > ${SRCDIR}/samba-${VERSION}.tar.bz2 )
+cp -av samba.spec ${SPECDIR}
+cp -av samba-devel.spec ${SPECDIR}
+if [ z$1 = "zdevel" ]; then
+ echo Restoring source samba directory name
+ ( cd ../../.. ; mv samba-${VERSION} samba )
+ echo Getting Ready to build Developmental Build
+ cd ${SPECDIR}
+ rpm -ba -v samba-devel.spec
+else
+ echo Getting Ready to build release package
+ cd ${SPECDIR}
+ rpm -ba -v --clean --rmsource samba.spec
+fi
+echo Done.
diff --git a/packaging/RedHat/samba2.spec.tmpl b/packaging/RedHat/samba2.spec.tmpl
index 0766653c23..4e38e66517 100644
--- a/packaging/RedHat/samba2.spec.tmpl
+++ b/packaging/RedHat/samba2.spec.tmpl
@@ -4,46 +4,35 @@ Version: PVERSION
Release: PRELEASE
Copyright: GNU GPL version 2
Group: Networking
-Source: ftp://samba.org/pub/samba/samba-%{version}.tar.gz
-Packager: John H Terpstra [Samba-Team] <jht@samba.org>
+Source: http://download.samba.org/samba/ftp/samba-%{version}.tar.bz2
+Packager: Gerald Carter [Samba-Team] <jerry@samba.org>
Requires: pam >= 0.72 kernel >= 2.2.1 glibc >= 2.1.2
Prereq: chkconfig fileutils
-Provides: samba = %{version}, samba-common = %{version}, samba-client = %{version}, samba-swat = %{version}
+Provides: samba = %{version}
+Obsoletes: samba-common, samba-client, samba-swat
BuildRoot: /var/tmp/samba
Prefix: /usr
%description
-Samba provides an SMB server which can be used to provide
-network services to SMB (sometimes called "Lan Manager")
-clients, including various versions of MS Windows, OS/2,
-and other Linux machines. Samba also provides some SMB
-clients, which complement the built-in SMB filesystem
-in Linux. Samba uses NetBIOS over TCP/IP (NetBT) protocols
-and does NOT need NetBEUI (Microsoft Raw NetBIOS frame)
-protocol.
-
-Samba-2.2 features working NT Domain Control capability and
-includes the SWAT (Samba Web Administration Tool) that
-allows samba's smb.conf file to be remotely managed using your
-favourite web browser. For the time being this is being
-enabled on TCP port 901 via inetd.
-
Users are advised to use Samba-2.2 as a Windows NT4
-Domain Controller only on networks that do NOT have a Windows
-NT Domain Controller. This release does NOT as yet have
-Backup Domain control ability.
+Samba provides an SMB/CIFS server which can be used to provide
+network file and print services to SMB/CIFS clients, including
+various versions of MS Windows, OS/2, and other Linux machines.
+Samba also provides some SMB clients, which complement the
+built-in SMB filesystem in Linux. Samba uses NetBIOS over TCP/IP
+(NetBT) protocols and does NOT need NetBEUI (Microsoft Raw NetBIOS
+frame) protocol.
Please refer to the WHATSNEW.txt document for fixup information.
-This binary release includes encrypted password support.
-Please read the smb.conf file and ENCRYPTION.txt in the
-docs directory for implementation details.
+%changelog
+* Thu Jun 6 2002 Gerald Carter <jerry@samba.org>
+ - add separate winbindd init script
+ - build and install libsmbclient
-NOTE: Red Hat Linux uses PAM which has integrated support
-for Shadow passwords and quotas. Do NOT recompile with the
-SHADOW_PWD option enabled
+* Sun Jun 2 2002 Gerald Carter <jerry@samba.org>
+ - include audit and recycle VFS modules in /usr/lib/samba
-%changelog
* Mon May 6 2002 Gerald Carter <jerry@samba.org>
- moved findsmb to a standard component in samba's
"make install". Removed from specfile.
@@ -150,6 +139,7 @@ SHADOW_PWD option enabled
%setup
%build
+## Build main Samba source
cd source
%ifarch ia64
@@ -169,15 +159,22 @@ CFLAGS="$RPM_OPT_FLAGS $EXTRA" ./configure \
--with-msdfs \
--with-smbmount \
--with-pam \
+ --with-pam_smbpass \
--with-syslog \
--with-utmp \
--with-sambabook=%{prefix}/share/swat/using_samba \
- --with-swatdir=%{prefix}/share/swat
+ --with-swatdir=%{prefix}/share/swat \
+ --with-libsmbclient
make -j${NUMCPU} proto
make -j${NUMCPU} all nsswitch/libnss_wins.so
make -j${NUMCPU} debug2html
make -j${NUMCPU} bin/smbspool
+## Build VFS modules
+cd ../examples/VFS
+make
+
+
%install
rm -rf $RPM_BUILD_ROOT
@@ -194,22 +191,25 @@ mkdir -p $RPM_BUILD_ROOT/var/cache/samba
mkdir -p $RPM_BUILD_ROOT/var/{log,run}/samba
mkdir -p $RPM_BUILD_ROOT/var/spool/samba
mkdir -p $RPM_BUILD_ROOT/lib/security
+mkdir -p $RPM_BUILD_ROOT%{prefix}/lib/samba/vfs
+mkdir -p $RPM_BUILD_ROOT%{prefix}/{lib,include}
# Install standard binary files
for i in nmblookup smbclient smbpasswd smbstatus testparm testprns \
- make_printerdef rpcclient smbspool smbcacls smbcontrol wbinfo
+ rpcclient smbspool smbcacls smbcontrol wbinfo smbmnt
do
-install -m755 source/bin/$i $RPM_BUILD_ROOT%{prefix}/bin
+ install -m755 source/bin/$i $RPM_BUILD_ROOT%{prefix}/bin
done
-for i in mksmbpasswd.sh smbtar
+
+for i in mksmbpasswd.sh smbtar findsmb
do
-install -m755 source/script/$i $RPM_BUILD_ROOT%{prefix}/bin
+ install -m755 source/script/$i $RPM_BUILD_ROOT%{prefix}/bin
done
# Install secure binary files
-for i in smbd nmbd swat smbmount smbumount smbmnt debug2html winbindd
+for i in smbd nmbd swat smbmount smbumount debug2html winbindd
do
-install -m755 source/bin/$i $RPM_BUILD_ROOT%{prefix}/sbin
+ install -m755 source/bin/$i $RPM_BUILD_ROOT%{prefix}/sbin
done
# we need a symlink for mount to recognise the smb and smbfs filesystem types
@@ -221,15 +221,16 @@ ln -sf %{prefix}/sbin/smbmount $RPM_BUILD_ROOT/sbin/mount.smb
cd source
make BASEDIR=$RPM_BUILD_ROOT/usr \
LIBDIR=$RPM_BUILD_ROOT/etc/samba \
+ VARDIR=$RPM_BUILD_ROOT/var \
SBINDIR=$RPM_BUILD_ROOT%{prefix}/sbin \
BINDIR=$RPM_BUILD_ROOT%{prefix}/bin \
MANDIR=$RPM_BUILD_ROOTMANDIR_MACRO \
SWATDIR=$RPM_BUILD_ROOT/usr/share/swat \
SAMBABOOK=$RPM_BUILD_ROOT/usr/share/swat/using_samba \
- installman installcp installswat
+ installman installswat
cd ..
-# Install the nsswitch library extension file
+# Install the nsswitch wins library
install -m755 source/nsswitch/libnss_wins.so $RPM_BUILD_ROOT/lib
# Make link for wins resolver
@@ -239,24 +240,41 @@ install -m755 source/nsswitch/libnss_wins.so $RPM_BUILD_ROOT/lib
install -m755 source/nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/lib
install -m755 source/nsswitch/pam_winbind.so $RPM_BUILD_ROOT/lib/security
+# Install pam_smbpass.so
+install -m755 source/bin/pam_smbpass.so $RPM_BUILD_ROOT/lib/security
+
+# Install the VFS modules
+install -m755 examples/VFS/recycle.so $RPM_BUILD_ROOT%{prefix}/lib/samba/vfs
+install -m755 examples/VFS/audit.so $RPM_BUILD_ROOT%{prefix}/lib/samba/vfs
+install -m755 examples/VFS/netatalk.so $RPM_BUILD_ROOT%{prefix}/lib/samba/vfs
+
+# clean out VFS directory since it will get installed as documentation later
+(cd examples/VFS; make clean)
+
+# libsmbclient
+install -m 755 source/bin/libsmbclient.so $RPM_BUILD_ROOT%{prefix}/lib/
+install -m 755 source/bin/libsmbclient.a $RPM_BUILD_ROOT%{prefix}/lib/
+install -m 644 source/include/libsmbclient.h $RPM_BUILD_ROOT%{prefix}/include/
+
# Install SWAT helper files
for i in swat/help/*.html docs/htmldocs/*.html
do
-install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/help
+ install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/help
done
for i in swat/images/*.gif
do
-install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/images
+ install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/images
done
for i in swat/include/*.html
do
-install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/include
+ install -m644 $i $RPM_BUILD_ROOT%{prefix}/share/swat/include
done
# Install the miscellany
install -m644 swat/README $RPM_BUILD_ROOT%{prefix}/share/swat
install -m755 packaging/RedHat/smbprint $RPM_BUILD_ROOT%{prefix}/bin
install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/etc/rc.d/init.d/smb
+install -m755 packaging/RedHat/winbind.init $RPM_BUILD_ROOT/etc/rc.d/init.d/winbind
install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT%{prefix}/sbin/samba
install -m644 packaging/RedHat/samba.log $RPM_BUILD_ROOT/etc/logrotate.d/samba
install -m644 packaging/RedHat/smb.conf $RPM_BUILD_ROOT/etc/samba/smb.conf
@@ -271,7 +289,9 @@ rm -rf $RPM_BUILD_ROOT
%post
/sbin/chkconfig --add smb
+/sbin/chkconfig --add winbind
/sbin/chkconfig smb off
+/sbin/chkconfig winbind off
echo "Looking for old /etc/smb.conf..."
if [ -f /etc/smb.conf -a ! -f /etc/samba/smb.conf ]; then
@@ -465,7 +485,7 @@ fi
%{prefix}/sbin/smbd
%{prefix}/sbin/nmbd
%{prefix}/sbin/swat
-%{prefix}/sbin/smbmnt
+%{prefix}/bin/smbmnt
%{prefix}/sbin/smbmount
%{prefix}/sbin/smbumount
%{prefix}/sbin/winbindd
@@ -480,9 +500,6 @@ fi
%{prefix}/bin/findsmb
%{prefix}/bin/smbstatus
%{prefix}/bin/nmblookup
-%{prefix}/bin/make_smbcodepage
-%{prefix}/bin/make_unicodemap
-%{prefix}/bin/make_printerdef
%{prefix}/bin/smbpasswd
%{prefix}/bin/smbtar
%{prefix}/bin/smbprint
@@ -490,6 +507,10 @@ fi
%{prefix}/bin/smbcacls
%{prefix}/bin/wbinfo
%attr(755,root,root) /lib/libnss_wins.s*
+%attr(755,root,root) %{prefix}/lib/samba/vfs/*.so
+%{prefix}/include/libsmbclient.h
+%{prefix}/lib/libsmbclient.a
+%{prefix}/lib/libsmbclient.so
%{prefix}/share/swat/help/*
%{prefix}/share/swat/images/*
%{prefix}/share/swat/include/header.html
@@ -501,16 +522,17 @@ fi
/etc/samba/samba.stack
/etc/samba/samba.xinetd
/etc/rc.d/init.d/smb
+/etc/rc.d/init.d/winbind
/etc/logrotate.d/samba
%config(noreplace) /etc/pam.d/samba
MANDIR_MACRO/man1/*
MANDIR_MACRO/man5/*
MANDIR_MACRO/man7/*
MANDIR_MACRO/man8/*
-%dir /etc/codepages/*
%attr(755,root,root) %dir /var/cache/samba
%dir /var/log/samba
%dir /var/run/samba
%attr(1777,root,root) %dir /var/spool/samba
%attr(-,root,root) /lib/libnss_winbind.so
%attr(-,root,root) /lib/security/pam_winbind.so
+%attr(-,root,root) /lib/security/pam_smbpass.so
diff --git a/packaging/RedHat/smb.init b/packaging/RedHat/smb.init
index 5419b2b9c6..f50da2c6b2 100755
--- a/packaging/RedHat/smb.init
+++ b/packaging/RedHat/smb.init
@@ -24,26 +24,27 @@ case "$1" in
echo -n "Starting SMB services: "
daemon smbd -D
daemon nmbd -D
- if [ "`grep -i 'winbind uid' /etc/samba/smb.conf | egrep -v [\#\;]`" ]; then
- daemon winbindd
- fi
echo
touch /var/lock/subsys/smb
;;
stop)
echo -n "Shutting down SMB services: "
- killproc smbd -TERM
+
+ ## we have to get all the smbd process here instead of just the
+ ## main parent (i.e. killproc) because it can take a long time
+ ## for an individual process to process a TERM signal
+ smbdpids=`ps guax | grep smbd | grep -v grep | awk '{print $2}'`
+ for pid in $smbdpids; do
+ kill -TERM $pid
+ done
+ ## nmbd is ok to kill using killproc()
killproc nmbd -TERM
- if [ "`ps -ef | grep winbind | grep -v grep`" ]; then
- killproc winbindd
- fi
rm -f /var/lock/subsys/smb
echo ""
;;
status)
status smbd
status nmbd
- status winbindd
;;
restart)
echo -n "Restarting SMB services: "
diff --git a/packaging/RedHat/winbind.init b/packaging/RedHat/winbind.init
new file mode 100644
index 0000000000..291c351df3
--- /dev/null
+++ b/packaging/RedHat/winbind.init
@@ -0,0 +1,91 @@
+#!/bin/sh
+#
+# chkconfig: 345 81 45
+# description: Starts and stops the Samba winbind daemon to provide \
+# user and group information from a domain controller to linux.
+
+# Source function library.
+if [ -f /etc/init.d/functions ] ; then
+ . /etc/init.d/functions
+elif [ -f /etc/rc.d/init.d/functions ] ; then
+ . /etc/rc.d/init.d/functions
+else
+ exit 0
+fi
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ ${NETWORKING} = "no" ] && exit 0
+
+# Check that smb.conf exists.
+[ -f /etc/samba/smb.conf ] || exit 0
+
+RETVAL=0
+
+
+start() {
+ echo -n "Starting Winbind services: "
+ RETVAL=1
+ if [ "`grep -i 'winbind uid' /etc/samba/smb.conf | egrep -v [\#\;]`" ]; then
+ daemon winbindd
+ RETVAL=$?
+ fi
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/winbind || \
+ RETVAL=1
+ return $RETVAL
+}
+stop() {
+ echo -n "Shutting down Winbind services: "
+ RETVAL=1
+ if [ "`grep -i 'winbind uid' /etc/samba/smb.conf | egrep -v [\#\;]`" ]; then
+ killproc winbindd
+ RETVAL=$?
+ fi
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/winbind
+ return $RETVAL
+}
+restart() {
+ stop
+ start
+}
+reload() {
+ export TMPDIR="/var/tmp"
+ echo -n "Checking domain trusts: "
+ killproc winbindd -HUP
+ RETVAL=$?
+ echo
+ return $RETVAL
+}
+mdkstatus() {
+ status winbindd
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ reload)
+ reload
+ ;;
+ status)
+ mdkstatus
+ ;;
+ condrestart)
+ [ -f /var/lock/subsys/winbindd ] && restart || :
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|status|condrestart}"
+ exit 1
+esac
+
+exit $?