[olug] SuSE 9.0 proc question
Brian Roberson
roberson at olug.org
Thu May 20 01:45:52 UTC 2004
First, let me start with FYI: suse ( like many other major recent distro ) does not
install extra daemons like ftpd unless you tell it to on the install ( or post-install
with "yast sw_single" ) The media you installed from I can guarantee has at _least_
three flavor's of an ftp daemon ( proftpd, vsftpd and at least wu-ftpd )
Second, let me explain the boot process ( high level overview ) on recent major distro's
as with most unices ( bsd is not one I am refering to ) there is a master process called
"init" ; init is always pid 1. init looks at two things when it comes up, #1 kernel command
line arguments, and #2 /etc/inittab. the inittab file tells init what process's should be
running in the requested run-level ( I will explain "run-level" in a moment ) after init
spawn's the processes defined in /etc/inittab ( well, actually, before it spawns them - but
again, this is a high level intro ) - there are a set of directories which contain additional
boot time ( runlevel change ) progams/commands that need to be ran. on Suse, these are
/etc/init.d/rc[0-6].d/ ...
solaris, for example put them in
/etc/rc[0-6].d/ ...
Linux init will run the files in the appropriate directories in succession if they are marked executable
and passes it a command line arguement of "start". The succession factor is provided by the file name;
example S01blahblah will run before S02blahblah will. Most linux distro's will make these files under
the rc[0-6].d directories symbolic links to the real script or executable, typically in /etc/init.d/.
There are also files in these directories that have names like K01blahblah K02blahblah , which are
typically scripts/executables which will stop the services started by the S*** files. But init runs them
with a command line argument of "stop" ; this only happens on runlevel change.
RunLevel is a term I continue to reference, the definition of runlevel is fairly simple to grasp. there are 7
runlevels, 0 through 6. 0 and 6 are reserved 0 is system halt and 6 is system reboot. typical linux systems
run in either runlevel 3 or 5; 3 is typically multi-user command line login and 5 is multi-user graphical login.
so, on to answer your question, assuming the file you put into /etc/init.d/ was a start/stop script - all
you need to do from there is #1 - make sure it is executable and #2 maek a symbolic link to it from your
default run level directory. your default runlevel is determined by /etc/inittab, typically a line like this:
id:3:initdefault:
in this example, runlevel 3 is the default, so in the directory /etc/init.d/rc3.d/ ; simple make a symbolic
link to the script you put in /etc/init.d ; example:
#"cd /etc/init.d/rc3.d && ln -s ../proftpd S80proftpd"
Now that I typed this huge freaking email, I am sure I left something out, or even sparked more questions.. which
one actually just came to me, there is a project for linux called "Linux Standards Base" ; there is a standards
based utility defined by this forum to add/remove services for exactly what you are trying to do.... this is called
chkconfig I do believe, innserv maybe another one, been a while since I read the LSB, but in any event if your
distro is LSB compliant it should have "chkconfig" for adding/removing/modifying your system services. - oh, BTW
the linux boot process is based on UNIX System V - "rpm -qa | grep init" shoudl yiled something like "sysvinit-???"
--brian
in Wed, May 19, 2004 at 07:48:42PM -0500, Jake Churchill wrote:
> I have suse 9.0 installed on my system and it does not come with an FTP
> server as far as I could tell. So, I downloaded ProFTP, installed it,
> and configured it how I want it. It works fine, just how I want. The
> problem I have is that it doesn't start automatically with the system.
> I copied the proftpd to /etc/init.d/ thinking that it would start it
> like it starts all the other daemons. That's where all the other
> daemons are on my system. When I call startproc proftpd it is fine and
> works perfectly. I looked online and it said that I needed to edit my
> rc.d files but I think it was talking about an older system because on
> mine, there are tons of files and online it made it sound like there
> should be just 1.
>
> So, how do I make a service that was not included in the system, start
> with the system? I don't want to have a script run at startup if I can
> avoid it. If that's the only way, then explain that cuz I've never
> done that either.
>
> Thanks for any help!
>
> jake
>
> _______________________________________________
> OLUG mailing list
> OLUG at olug.org
> http://lists.olug.org/mailman/listinfo/olug
More information about the OLUG
mailing list