-   Slackware (
-   -   How to use the BSD style init scripts in /etc/rc.d (

jmbrink26 09-05-2006 10:27 AM

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.



raska 09-05-2006 10:53 AM

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 ;)

jmbrink26 09-05-2006 11:26 AM

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:// I get an error "Internal Error Please Send a full bug report at 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.

Thanks for help :)


raska 09-05-2006 11:33 AM

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:

/etc/rc.d/rc.inetd restart
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.

jmbrink26 09-05-2006 12:47 PM

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....

Thanks, Justin

raska 09-05-2006 12:50 PM

Do you have the /etc/samba/smb.conf file configured?
You should also review some logs as dmesg, /var/log/messages and /var/log/syslog

jmbrink26 09-05-2006 01:24 PM

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.

Thanks, Justin

MS3FGX 09-06-2006 01:48 AM

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.

jmbrink26 09-06-2006 09:32 AM

Ok, that's about what I figured, but wanted to make sure.

Thanks, Justin

All times are GMT -5. The time now is 03:23 AM.