How to use the BSD style init scripts in /etc/rc.d
SlackwareThis Forum is for the discussion of Slackware Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
How to use the BSD style init scripts in /etc/rc.d
I have recently changed over to using Slack for much of my linux boxes.
I've used RH and SUSE for a while, and can find my way in and out. Slack though, it's just the real specifics that I'm having problems with.
Currently, I'm tyring to figure out how to use the BSD style init scripts in the /etc/rc.d directory.
I'm trying to start some services on my system like ProFTPD, Samba, etc...
I know in RH and SUSE, you'd just go to /etc/init.d, then type like smbd start (or whatever it is). But because that is a System V style init script that has symlinks linked to scripts in the /etc/rc.d/rc?.d directories, that currently doesn't work.
After reading some of the man pages, it says that Slack has System V compatibility, but I would have to write my own symlink scripts.
The thing is, I don't have the rc?.d directories within /etc/rc.d, rather just files like rc.0, rc.1, etc...
After reading some other man pages and content on the web, it just mentions that those files just controls the runlevels of the system. Says stuff like rc.0 and rc.6 are linked together because they will both suspend or shutdown the system. And their saying that alot of the programs and services run in runlevel rc.3 or something like that, but I don't even see that listed in my /etc/rc.d directory.
Can someone help me figure out how to use BSD style init scripts? If I can figure this out, I think I'll have Slack figured out.
Welcome to Slackware.
First of all, in Slack the runlevel 3 is controlled by the /etc/rc.d/rc.M script.
Most of that information can be found in the script itself and you can understand better the startup thing reviewing the /etc/inittab file.
Certainly in Slackware one of the biggest differences is the rc.d directory. Look in there, you should have a bunch of scripts, which are called from one to another when booting up.
If you want a particular service to be called upon startup, just give execution permission to the corresponding script, i.e. if you want samba, issue a chmod +x /etc/rc.d/rc.samba; if you don't want to restart for the service to be called, just execute the file once with the given permission adding start as a parameter: /etc/rc.d/rc.samba start that should give you the samba service running (the configuration file for samba must be at /etc/samba/smb.conf which is missing as default but there is an example to copy in that directory)
You can review any of those scripts to check available options or tweak them a little but carefully (remember to backup properly).
I encourage you to post any doubt that concerns you
Ok, I tried that, and it appears that the service is still not started.
I just tried Samba. But after I run ./rc.samba start from /etc/rc.d, then rebooted, I ran nmap localhost, and the SMB/CIFS port is still closed. Also, when I startx into KDE, and go into konqueror, and do smb://localhost or smb://127.0.0.1 I get an error "Internal Error Please Send a full bug report at http://.bugs.kde.org Unknown error: error condition in stat: Connection timed out".
So, what that error is telling me is, the SMBD service is not started.
Also, for ProFTPD specifically, I don't see a file that named rc.proftpd in /etc/rc.d, so I'm not sure how I would go about starting any FTP services. I've used VSFTPD before, but wanted to give ProFTPD a shot, and know that Slack comes packed with the app on there, but can't find where to start it from.
For samba, check that the file /etc/samba/smb.conf exists. If it isn't (which is the default), copy it over from the provided /etc/samba/smb.conf-example file and customize it a little. Then restart the service.
For ProFTPd, it is run through the inetd server. Open the /etc/inetd.conf file, you should see a part like this
# Very Secure File Transfer Protocol (FTP) server.
#ftp stream tcp nowait root /usr/sbin/tcpd vsftpd
# Professional File Transfer Protocol (FTP) server.
ftp stream tcp nowait root /usr/sbin/tcpd proftpd
Just uncomment the line that fits your needs, as I also use ProFTPd I uncommented that one. Restart the inetd server to take the changes:
I'm guessing that your /etc/rc.d/rc.inetd file is executable and you had the service already running as it is by default.
Ok, that seemed to work for ProFTPd, but Samba is giving me a heck of a time.
I have ran the /etc/rc.d/rc.samba start, and it doesn't really give any status.
But when I do either /etc/rc.d/samba stop (or restart) I get message "No process killed"
So I started SWAT in the inetd.conf file. I login to SWAT, and then select Start SMBD, and then show the status of the Samba services, the status still reverts back to "Not Running".
You know of anything that would cause Samba to not actually start? I am just running the 2.4.31 kernel (default) in Slack 10.2. I also have the 2.6.17 compiled and installed, and it does the same thing, so it's not kernel modules that aren't loading or anything....
Ok, that was it. That is silly. I wouldn't have guessed that the smb.conf file wasn't pre-loaded. But, I just edited the smb.conf-sample, and wrote it as smb.conf, and it's running now. Cool. That got that figured out.
One other thing. When I install apps on the system for things like Limewire or something, will it add a line to the inetd.conf file, or would it add a script to the /etc/rc.d directory ? Because I know Gnutella clients such as limewire are supposed to open port 6346 on the system so other Gnutella users can connect to your file server basically.
In that case, those programs will open up the ports and make the connections on their own at run-time. You don't need to specify anything in inetd.conf, or add any rc.* script, just to use a P2P program.