UGN Security

slackware startup scripts

Posted By: Gollum

slackware startup scripts - 02/13/04 08:50 AM

ok, this is the one things that's bothering me with slackware. the startup scripts. now, if i've figured everything correctly, slackware uses sysvinit start scripts. which are a bit more complicated in that they require a "start|stop|restart" type deal. also, they're located in "/etc/rc.d/" now this is where i get confused. are all the scripts called rc.* in that directory supposed to run...with the exception of the runlevel one's which only like, rc.4 will run during runlevel 4 and rc.6 during runlevel 6. the problem i have, is that i have scripts in the directory which don't run. for instance, rc.httpd and rc.snort. the httpd one runs fine, but the snort one won't. same with my webmin script that dones't run, but say, rc.mysqld runs fine. why is this? is there somethign i'm missing?//
Posted By: sinetific

Re: slackware startup scripts - 02/13/04 04:15 PM

slackware doesnt use sysvinit scripts it uses BSD style.

Open /etc/rc.d/rc.local with your favorite text editor and add the following line to the bottom.

/usr/local/apache/bin/apachectl start
Posted By: Gollum

Re: slackware startup scripts - 02/14/04 03:41 AM

# /etc/rc.d/rc.local: Local system initialization script.
# Put any local setup commands in here:
/etc/webmin/start >/dev/null 2>&1 </dev/null # Start Webmin

echo "Running the Emerde's scripts"
for d in $(/bin/ls -1 -B /etc/init.d)
if [ -x /etc/init.d/$d ]
/etc/init.d/$d start

that's my rc.local file. the only one it runs is the startup for webmin....which doesnt start. should i be placing my startup scripts in init.d?//
Posted By: sinetific

Re: slackware startup scripts - 02/14/04 09:24 AM

hmm maybe the file permissions or group?

are you using emerde? I tried it and noticed a lot of bugs. I wouldn't use anything like emerde -U world or system since gentoo and slackware are quite different systems.

ya i need to go back and re-evalute posting the link to emerde and put a caution with it.
Posted By: Gollum

Re: slackware startup scripts - 03/07/04 04:59 PM

I dont' know how many other people were confused by the way Slackware works it's startup scripts. But I was. It's actually easier than other version of linux...but because it retains it's backwards compatability with most of them, it makes things a bit more complicated.
But, I did a lot of reading and looking at them, so I figure, just in case anyone else out there had questions, they could find the answer here.
Not all of what I say here will be the same for some people. For instance, I moved all my networking parts to rc.inet2...where as in the default installation, i believe they'll be under rc.M.
Basically, it's simplicity. I was confused that some of the scripts in the /etc/rc.d directory seemed to be getting run, while others didn't. But that's simplys because they were never called. The scripts work in this order. rc.S is called when you're system boots up. It does things like mounting the root filesystem, checking it, mouting other filesystems, removing temp files, displaying the MOTD, setting the hardware clock, setting up ISA PnP devices, loading Modules (by running /etc/rc.d/rc.modules), and running scripts to set up the serial port (etc/rc.d/rc.serial). When it's running other scripts, it always checks first to make sure they're set to executable. If not, it'll skip them. Then, when a runlevel is set, it'll run the rc script for that runlevel. For instance, rc.4 runs the session manager. It'll look for GDM, KDM, and finally XDM. rc.M however will run everytime you enter a multi-user session. which is runlevels 1-6.
rc.M is what calls most programs and other things. This sets up everything. Internet and networking scripts for hardware and services, PCMCIA devices, logs/loggers, removes more temp and junk files, filesystem permissions, updates libraries and fonts, starts the cups server, hard drive monitors, crond, sets quotas, ACPI, loads the ALSA script, custom user options such as font, keyboard style, starts gdm, and even starts the SystemV script and the rc.local script. Some of the important scripts it calls (By important, i mean one's that are interesting. Filesystem permissions and starting crond are important, but not very fun.) are the network init scripts (rc.inet1, rc.inet2), ALSA, and calling rc.local. The inet scripts contain all the information for starting up your network services and hardware. rc.inet1 will set up your hardware, and then it'll call rc.inet2. inet2 will call rc.inetd, which using /etc/inetd.conf will start up a variety of services. Just scroll though /etc/inetd.conf to see what I mean. Most anything from echo (Port 7), to FTP, to kerberos, finger, netstat, auth, RPC. Almost everything. After that, inet2 will take back control from inetd and begin running more scripts. It will call your SSH server up, BIND, NIS, NFS, and then a few others which are commented out. This is where I added to start all my server daemons. Nessus, MySql, Snort, Appletalk, Apache and Samba. Even though I dont' NEED them, I still keep my rc.httpd, rc.mysql, etc...files in to /etc/rc.d directory, and I call those when starting the programs. This makes things easier and if i want to stop calling a program while starting up, I can simply change it to be an unexecutable file and the script will skip it. Although a lot of these seems fairly easy to figure out, I figured I'd type it all out, seeing as how I spent a little while trying to figure out exactly how Slackware worked it's startup deal. Only a few resources went into detail on it, and those that did were sometimes incorrect. Well that is, without pouring through pages of Slack documentation. Anyway, since I've figured this out, it has made things much easier and so I figured I'd share it around. I must say, aftering learning about it, I really like the way Slackware deals with it's startup scripts. All except where they would call some of the others. Such as calling the webserver from rc.M. I just figure a network service should be called from the scripts that call network services. Well maybe I'm just picky...but it makes sense.//
© 2018 UGN Security Forum