Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Using Samba
Prev Home Next

2.5.2.2 System V Unix

With System V, things can get a little more complex. System V typically uses scripts to start and stop daemons on the system. Hence, you need to instruct Samba how to operate when it starts and when it stops. You can modify the contents of the /etc/rc.local directory and add something similar to the following program entitled smb :


#!/bin/sh

# Contains the "killproc" function on Red Hat Linux
./etc/rc.d/init.d/functions

PATH="/usr/local/samba/bin:$PATH"

case $1 in 
	'start')
		echo "Starting smbd..."
		smbd -D
		echo "Starting nmbd..."
		nmbd -D
		;;
	'stop')
		echo "Stopping smbd and nmbd..."
		killproc smbd
		killproc nmbd
		rm -f /usr/local/samba/var/locks/smbd.pid
		rm -f /usr/local/samba/var/locks/nmbd.pid
		;;
	*)
		echo "usage: smb {start|stop}"
		;;
esac

With this script, you can start and stop the SMB service with the following commands:


# /etc/rc.local/smb start
Starting smbd...
Starting nmbd...
# /etc/rc.local/smb stop
Stopping smbd and nmbd...
Using Samba
Prev Home Next

 
 
  Published under the terms of the Creative Commons License Design by Interspire