LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Do anyone knows how to autorun samba when pc start up? (https://www.linuxquestions.org/questions/linux-newbie-8/do-anyone-knows-how-to-autorun-samba-when-pc-start-up-918605/)

tailinlinux 12-13-2011 08:19 PM

Do anyone knows how to autorun samba when pc start up?
 
I have a linux machine and i have a printer shared on it.When i reboot the computer shared printer is missing when im connecting again using windows machine, so i need to run command in terminal [CODE]samba restart[/CODE.
after running this command shared printer(SMB) is visible.

Thank in advance please help.

Aries

fukawi1 12-13-2011 10:37 PM

You dont say what distribution you are using, but your profile box says Mandriva, and a quick google suggests to me that Mandriva uses the same init method as CentOS, ie: chkconfig

So to answer your thread title..
Code:

# chkconfig samba on
should do it.

I would imagine that the problem is that samba isn't starting on reboot. But when you restart samba, you would likely be getting a [Fail] on stopping it, since it isn't already running.

coolsg5636 12-13-2011 10:55 PM

If you have "ntsysv" tool installed then you can manage all the services at the same time. You can decide which service should start after boot and which service shouldn't.

Command is ,

# ntsysv

tailinlinux 12-14-2011 12:52 AM

Quote:

Originally Posted by fukawi1 (Post 4549363)
You dont say what distribution you are using, but your profile box says Mandriva, and a quick google suggests to me that Mandriva uses the same init method as CentOS, ie: chkconfig

So to answer your thread title..
Code:

# chkconfig samba on
should do it.

I would imagine that the problem is that samba isn't starting on reboot. But when you restart samba, you would likely be getting a [Fail] on stopping it, since it isn't already running.

Yes your right im using mandriva.. still problem occurred when i turn off my pc and power on it again.

zQUEz 12-14-2011 05:31 AM

OP, you didn't say what happened when you ran
Code:

chkconfig samba on
? If Mandriva is like RHEL based distros, then you likely got an error. Did you?
Under RHEL it will be
Code:

chkconfig smb on
Also, take a look at your /var/log/messages to see if you are getting startup errors for samba during startup. (or it might be /var/log/samba/smb.log)

Satyaveer Arya 12-15-2011 03:29 AM

Hello,

Please run the following script manually and check for error messages:

# /etc/rc.d/init.d/smb stop

(to make sure it's not running)
# /etc/rc.d/init.d/smb start

If it does not start up, check the logs, specifically /var/log/syslog and
/var/log/samba/logsmbd and /var/log/samba/log.nmbd. If you do not see much
there , increase the logging level by putting:
log level = 3
(or even higher)in the global section of /etc/smb.conf

Once you have got the script starting manually, you should manipulate the
start-up scripts with chkconfig (rather than making the links yourself). One
possible problem is that the script checks to see if networking is up,
otherwise it exits. If you have got smb starting before network, then this
could be your problem. If you use chkconfig it will get the order correct.

# chkconfig smb on


All times are GMT -5. The time now is 10:45 PM.