LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Gentoo and Samba (https://www.linuxquestions.org/questions/linux-newbie-8/gentoo-and-samba-495876/)

Reptile 10-26-2006 05:08 PM

Gentoo and Samba
 
We've got a weird situation at my work, and I thought I'd ask the Linux gurus for some advice. We're running Samba on a particular server, but it's being a little quirky. For some odd reason, when the Samba daemon(s) start, they insist on starting before the winbind daemon, and that causes issues. So, the only course of action is to perform something like the following:

/etc/init.d/samba stop
/etc/init.d/winbind restart
/etc/init.d/samba start


For some odd reason, when winbind starts first, then samba, everything works fine. That, however, isn't the real problem. My issue is with the OS, itself. We're running Gentoo, and I'm not 100% sure of where I could place the commands in order for them to run on startup. I believe it's /etc/conf.d/local.start, but there is no way for me to test the machine since I'm not able to reboot. (It's a production server, running some data backup programs, and won't be able to be rebooted for quite some time.)

The reason I want to automate these commands is that, a year from now when we may have to reboot the machine for one reason or another, no one is going to remember that samba and winbind won't play nice together on this particular. I'd like to ensure that if we have to reboot, everything will come back up just the way it's supposed to be. Anyone out there a Gentoo expert, or able to double-check my work so that I'll be sure I haven't gone off in the wrong direction?

Penguin of Wonder 10-27-2006 10:40 AM

You could write the necessary commands you need as a bash script, make it executable and then add it to a specific run level. Or you could tell cron to run it every so often if necessary.

So write your scipt then make it executable
Code:

chmod a+x myscript
then add to the proper run-level.
Code:

rc-update add myscript default

Reptile 10-27-2006 11:53 AM

Thanks for the reply. Writing to a bash script might not be a bad idea, but I don't think setting it up as a cron job would work since I need the commands to be run only on startup. In your opinion, will my temporary solution above work until I can get back to the machine and write the script, or am I completely wrong?

Reptile 11-03-2006 06:06 PM

I think I may finally have got it. Have another Gentoo machine to play with, that's not a production server.

Penguin of Wonder 11-03-2006 07:23 PM

Well I'm glad you got it worked out. I'm not honestly sure what the local.start file is for.


All times are GMT -5. The time now is 08:53 PM.