LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 10-12-2004, 02:05 AM   #1
DocNick
LQ Newbie
 
Registered: Oct 2004
Distribution: Fedora Core 2
Posts: 13

Rep: Reputation: 0
Autostart Samba & Running scripts at boot


I hope this is the right place to ask.

First, a basic question: Where can I put an executable script so that it will run at the start of ANY runlevel?

You can add commands to /etc/rc.local and they will run at the very end of the boot process, right? What if I want to run it towards the beginning of the boot sequence? Do I have to add a "S##name" link in each rc#.d folder or is there another place it looks for these files?

Second question: How can I get Samba to startup when the system boots so that I can add Samba shares to /etc/fstab (suggested by a couple websites)?

I tried adding a script that starts Samba ('/etc/rc.d/init.d/smb start') to the rc#.d folder and giving it a name that makes it start (I think) before fstab is read and executed upon, but the services failed to start. Since Samba's not running, the commands in fstab obviously fail.

I guess my end goal is to have Samba start when the sytem boots, and to have it mount a couple shares as soon as possible. What's the best way to do this?

Sorry for the "n00bish" post, but a newbie is what I am
 
Old 10-12-2004, 02:48 AM   #2
DocNick
LQ Newbie
 
Registered: Oct 2004
Distribution: Fedora Core 2
Posts: 13

Original Poster
Rep: Reputation: 0
Well, it looks like I got it to work.

I added both the lines to start Samba as well as to mount the drives to /etc/rc.d/rc.local. Seems to have done the trick.

Is there a better way to do it? Also, any answers to my previous questions would be much appreciated.

Thanks.
 
Old 10-21-2004, 08:52 PM   #3
ieeestd802
LQ Newbie
 
Registered: Sep 2004
Posts: 28

Rep: Reputation: 15
Can you post your answer here ?

Thanks.


Quote:
Originally posted by DocNick
Well, it looks like I got it to work.

I added both the lines to start Samba as well as to mount the drives to /etc/rc.d/rc.local. Seems to have done the trick.

Is there a better way to do it? Also, any answers to my previous questions would be much appreciated.

Thanks.
 
Old 10-21-2004, 11:06 PM   #4
DocNick
LQ Newbie
 
Registered: Oct 2004
Distribution: Fedora Core 2
Posts: 13

Original Poster
Rep: Reputation: 0
Not sure exactly what you want to know, but here's what I ended up doing:

First, I tried doing it all with the /etc/rc.d/rc.local file by adding the lines:

Code:
/etc/rcd./init.d/smb start
mount -t smbfs //remote_system/share /mnt/remote -o username=guest,password=""
But then I found the Services Manager and decided to do it that way instead. If while in X, as root run 'system-config-services' from the console, you should see a dialog that let's you choose what services start up for a given runlevel. Choose the runlevel you want (5 is the default and is what runs when start normally, as you probably know). Samba is listed as "smb" in the services list. Check that box.

Then, I went ahead and left the commands to map the network drives in rc.local, but removed the line to start Samba. I don't know if this is the best way, but it works, and from what I've seen in Linux so far that's what matters most

Was that what you were looking for or was there something else? I've been playing around with starting things automatically when booting to Linux (I'm setting up a standalone Freevo PVR) so maybe I've come across what you're trying do.
 
Old 11-08-2004, 08:19 PM   #5
Scrotonomous
LQ Newbie
 
Registered: Jan 2003
Posts: 15

Rep: Reputation: 0
now this will be a pretty noobie-ish post as well...

I like what you're doing with the automounting of samba shares, do i need to add code in a script anywhere that unmounts the remote folders? Or is that done automatically when smb is shutdown?

Thanks,

Jacob
 
Old 11-09-2004, 06:02 AM   #6
knutove1728
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Redhat FC2
Posts: 44

Rep: Reputation: 15
I think its done automatically. Else you can do it in the halt file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
running scripts at boot... thedp Suse/Novell 2 10-17-2005 09:21 AM
running scripts at boot viniosity Ubuntu 3 07-19-2005 09:52 PM
Installing Samba & Running kerryblue19 Linux - Software 3 02-16-2005 07:01 PM
My box hangs when running boot scripts elkrammer Linux - Distributions 5 03-31-2003 08:02 PM
Running scripts at boot time saintt Linux - Software 1 08-09-2002 06:03 AM


All times are GMT -5. The time now is 06:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration