World Websites | Internet Advertising | Debt Consolidation | Consolidation | Loan
Samba Startup Script [Archive] - PCMech Forums

PDA

View Full Version : Samba Startup Script


TDub
10-08-2000, 11:42 PM
I just installed Samba on my SPARC-20 running Solaris 8. I am trying to write a script to start nmbd and smbd during bootup. This is my first attempt at writing a shell script. This is my file /etc/init.d/startsmb.
#!/sbin/sh
echo "Starting Samba...."
/usr/local/samba/bin/smbd -D
/usr/local/samba/bin/nmbd -D
echo "done"

Here are the permissions.
# ls -al startsmb
-rwxr--r-- 1 root sys 210 Oct 8 02:21 startsmb
According to the "file" command it is an executable script.
# file startsmb
startsmb: executable /sbin/sh script

I cannot get this script to work and must start the daemons manually. Is there something that I am missing?

Statica
10-10-2000, 09:14 AM
Where are you calling the script from?
Make the file /etc/rc.d/startsmb with the same contents as you have.
Then call it from within /etc/rc.d/rc.local

What I'd do is make the file startsmb in /etc/rc.d/startsmb without the <b>#!/sbin/sh</b> [it isnt needed]

edit <b>/etc/rc.d/rc.local</b>
and add <b>bash /etc/rc.d/startsmb</b> to the end.

PS: why not use your favourite runlevel editor to start samba?

TDub
10-10-2000, 11:29 PM
Thanks Static! That was the missing piece. I moved my Samba script to /etc/init.d, created a link to /etc/rc2.d, rebooted and the daemons now start on bootup!