LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 09: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, 02:51 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,843

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
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, 03:05 AM   #3
tailinlinux
Member
 
Registered: Oct 2010
Location: Paudpod, Botolan, Zambales, Philippines
Distribution: Mandriva, Ubuntu, Mint, Open Suse, Meego
Posts: 390

Original Poster
Blog Entries: 3

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, 03:07 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,843

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
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, 07:08 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 02:49 AM   #6
tailinlinux
Member
 
Registered: Oct 2010
Location: Paudpod, Botolan, Zambales, Philippines
Distribution: Mandriva, Ubuntu, Mint, Open Suse, Meego
Posts: 390

Original Poster
Blog Entries: 3

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, 02:52 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,843

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

Original Poster
Blog Entries: 3

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

Original Poster
Blog Entries: 3

Rep: Reputation: 25
This is not working. Ive tried to copy and rename S91smb to S91smb2
but nothings happen.
 
Old 05-02-2012, 11:02 AM   #10
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,843

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


Reply



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 12:44 AM
Unable to add Samba share mount point with Mandriva 2008.1 Clived Mandriva 6 05-19-2008 03:31 PM
Samba restart when add new user? Jose Rivas Fedora 6 10-27-2006 12:18 PM
add reload and restart options to the firewall script cccc Debian 2 09-27-2006 04: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 08:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:19 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
Open Source Consulting | Domain Registration