LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   samba startup at boot (http://www.linuxquestions.org/questions/slackware-14/samba-startup-at-boot-101211/)

snocked 10-07-2003 10:15 AM

samba startup at boot
 
I'd like to know how to run these at boot, and how to start them both manually by executing a simple shell script if I decide to not have them at startup.

Two daemons for samba:
/usr/sbin/nmbd -D
/usr/sbin/smbd -D

I tried placing these commands in /etc/rc.d/rc.local but didn't work. I also tried writing a small shell script to execute manually.

#!/bin/sh
#
/usr/sbin/nmbd -D
/usr/sbin/smbd -D

Didn't work. I then tried adding the absolute path of the shell script to /etc/rc.d/rc.local. Still didn't work. If I type them in manually and check smbclient, I can see the hosts connected.

How would I do this? I'd like to know how to run these at boot, and how to start them both manually by executing a simple shell script if I decide to not have them at startup.

tangle 10-07-2003 10:25 AM

If you go to /etc/rc.d/rc.inet2 there is a section that starts samba, uncomment it.

Didi you get any errors when you ran that script that oy made?

itsjustme 10-07-2003 10:33 AM

Re: samba startup at boot
 
Quote:

Originally posted by snocked

#!/bin/sh
#
/usr/sbin/nmbd-D
/usr/sbin/smbd-D

Didn't work.

Uh... you need a space before the -D. Also, not sure about the implications of this, but, from the man pages:

"This switch is assumed if smbd is executed on the command line of a shell."

Also, check into:

chkconfig smb on

This turns on Samba service to start automatically in run levels 3, 4, or 5.

Edit: Oh, I just saw your "if I decide to not have them at startup."

frandalla 10-07-2003 10:56 AM

Re: Re: samba startup at boot
 
Quote:

Originally posted by itsjustme

Also, check into:

chkconfig smb on

This turns on Samba service to start automatically in run levels 3, 4, or 5.

Edit: Oh, I just saw your "if I decide to not have them at startup."

I'm using slackware and I didn't find this chkconfig... isn't it from another distribution or installed with some particular package?

Answering the original question, slackware has in its /etc/rc.d/ a script called rc.samba (at least Slack 8.1 - 9.1 has it). So, just chmod 755 this script and samba will run at startup. To turn the boot startup off just chmod 644 the script. If your Slackware don't have this script email me at: frandalla at netscape dot net and I'll gladly send you (Although I think you can find it on the net, just google for rc.samba)

itsjustme 10-07-2003 11:01 AM

Re: Re: Re: samba startup at boot
 
Quote:

Originally posted by frandalla
I'm using slackware and I didn't find this chkconfig... isn't it from another distribution or installed with some particular package?

Oh.. yeah, I'm still waking up. :o That was from my Red Hat 8 Bible.

But the space before the -D still stands.

Edit: Ok, I see the original poster edited his post to show the spaces before the -D's. As long as he did that in the actual script also.... ;)

snocked 10-07-2003 11:03 AM

No errors with the script.

Thanks for the /etc/rc.d/rc.inet2 and the /etc/rc.d option.


All times are GMT -5. The time now is 05:04 AM.