LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-17-2012, 10:41 PM   #1
tailinlinux
Member
 
Registered: Oct 2010
Location: Paudpod, Botolan, Zambales, Philippines
Distribution: Mandriva, Ubuntu, Mint, Open Suse, Meego
Posts: 390
Blog Entries: 3

Rep: Reputation: 25
How to add script on mandriva to restart samba when boot up?


How to add script on mandriva to restart samba when boot up?

I was wondering how do I make a bash script that automatically restarts samba after all the services are running? The reason I ask is because mandriva 2010.2 has a bug where smb is conflicting with nmbd and if I restart smb at boot it fixes the problem. So I just need it where the system automatically restarts smb. Thank you.
 
Old 04-18-2012, 03:51 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
you need to go into /etc/rcX.d and look for samba service. that should be something like this S<number>samba (this is a symbolic link). You can make a copy of it as S99samba2 or whatever and it will try to start smbd again.
 
Old 04-18-2012, 04:05 AM   #3
tailinlinux
Member
 
Registered: Oct 2010
Location: Paudpod, Botolan, Zambales, Philippines
Distribution: Mandriva, Ubuntu, Mint, Open Suse, Meego
Posts: 390
Blog Entries: 3

Original Poster
Rep: Reputation: 25
Quote:
Originally Posted by pan64 View Post
you need to go into /etc/rcX.d and look for samba service. that should be something like this S<number>samba (this is a symbolic link). You can make a copy of it as S99samba2 or whatever and it will try to start smbd again.
There's no /etc/rcX.d file.
 
Old 04-18-2012, 04:07 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
you need to replace X with a number, which is your actual runlevel. it is usually 2 or 3, but I'm not sure.
 
Old 04-18-2012, 08:08 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Normally a major service like that would be defined in /etc/init.d & linked from the relevant startup dir eg /etc/rc3.d
 
Old 04-26-2012, 03:49 AM   #6
tailinlinux
Member
 
Registered: Oct 2010
Location: Paudpod, Botolan, Zambales, Philippines
Distribution: Mandriva, Ubuntu, Mint, Open Suse, Meego
Posts: 390
Blog Entries: 3

Original Poster
Rep: Reputation: 25
Quote:
Originally Posted by pan64 View Post
you need to go into /etc/rcX.d and look for samba service. that should be something like this S<number>samba (this is a symbolic link). You can make a copy of it as S99samba2 or whatever and it will try to start smbd again.
I found S91smb@
is this the one you mention.
 
Old 04-26-2012, 03:52 AM   #7
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
yes, probably
 
Old 04-26-2012, 09:46 PM   #8
tailinlinux
Member
 
Registered: Oct 2010
Location: Paudpod, Botolan, Zambales, Philippines
Distribution: Mandriva, Ubuntu, Mint, Open Suse, Meego
Posts: 390
Blog Entries: 3

Original Poster
Rep: Reputation: 25
Quote:
Originally Posted by pan64 View Post
yes, probably
Okay thanks i will try it.
 
Old 05-01-2012, 11:36 PM   #9
tailinlinux
Member
 
Registered: Oct 2010
Location: Paudpod, Botolan, Zambales, Philippines
Distribution: Mandriva, Ubuntu, Mint, Open Suse, Meego
Posts: 390
Blog Entries: 3

Original Poster
Rep: Reputation: 25
This is not working. Ive tried to copy and rename S91smb to S91smb2
but nothings happen.
 
Old 05-02-2012, 12:02 PM   #10
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
would be better to try S99smb2 and also would be nice to look into the log files.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why samba restart is needed at the first time when boot up dongbo Linux - Newbie 3 08-21-2009 01:44 AM
Unable to add Samba share mount point with Mandriva 2008.1 Clived Mandriva 6 05-19-2008 04:31 PM
Samba restart when add new user? Jose Rivas Fedora 6 10-27-2006 01:18 PM
add reload and restart options to the firewall script cccc Debian 2 09-27-2006 05:11 AM
Samba server ok at boot, later fails to bind to IP. smbd restart doesn't help. tisource Linux - Networking 1 04-09-2005 09:16 AM


All times are GMT -5. The time now is 12:46 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration