LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   starting programs at bootup (https://www.linuxquestions.org/questions/linux-newbie-8/starting-programs-at-bootup-7975/)

tcm_va 10-26-2001 11:30 AM

starting programs at bootup
 
Running Mandrake 8.0.

I want to know how to make programs (daemons, mostly - mysql specifically) start at boot time. I read theLinux Network Administrator's Guide from O'Reilly. It mentioned the inetd superserver. Yet, I cannot find any inetd.conf file. There is an xinet.d directory with some scripts in it. Do I just drop the safe_mysqld script in there? I noticed Apache (httpd) starts automaticaly. It's startup script is in /etc/rc.d/inet.d. I dropped safe_mysqld into that directory but it did not work. I still have to manually type "safe_mysqld &" in a comand prompt to get it to start.

Do I simply create an inetd.conf file in the /etc/ directory and make an entry for mysql?

Thanks,

webtoe 10-26-2001 01:05 PM

to get it loaded at startup you have to have a script in the /etc/rc.d/inet.d directory and then have a symlink in the appropriate directory in /etc/rc.d/rc.x
(where x is the runlevel you're talking about. it could be 4 or something.) im not overly sure since i use slack which has the scripts in a different place and in a different way.

someone here must know how things are arranged

Alex

P.S. make sure that the script you want started has execute permissions. check a newbie guide/book to check how to do this.

acid_kewpie 10-26-2001 03:49 PM

Quote:

Originally posted by webtoe
to get it loaded at startup you have to have a script in the /etc/rc.d/inet.d directory and then have a symlink in the appropriate directory in /etc/rc.d/rc.x
(where x is the runlevel you're talking about. it could be 4 or something.) im not overly sure since i use slack which has the scripts in a different place and in a different way.

someone here must know how things are arranged

NRRRRGGGGGGGGGGGGG!!!!!!!!!!!

Not *quite* right.. on the right path tho.

I seem to say this sooo many times

... and i really don't understand why people get told this info in the first place.... but..

inet.d is OLD and GONE. it was replaced by xinetd.d in nearly all distro a fair while ago.

Webtoe seems to have got init.d and inet.d confused, understanable i guess.

ok so what was refered to as /etc/rc.d/inet.d is actually /etc/init.d on your machine: MD80. that directory is just a symlink to

/etc/rc.d/init.d, but it's shorter.. so hey!

These scripts are not simple bash scripts, they are very standardised, and must contain functions such as start, stop, restart and such like to work properly, and are not easy to write yourself, unless you nick oen and hack it accordingly.

incidentally, runlevel 4 isn't used. you always use 3 or 5, maybe 2 if you're odd...

right, ok so to get you up and running, and also assuming that there IS a MyQSL startup script in /etc/init.d, then try somethign like:

ln -s /etc/init.d/MySQL /etc/rc3.d/S85mysql

ok, the 3 defines the runlevel, as you'ev probably sussed, so you want 3, or 5 if you boot straight to X. the S85 defines the priority of the system, there's S or K types, not totally sure what the difference is, but a level of around 85 will start it toward the end. doesn't matter if a service already has that number, it';s just a very low level approch to setting things an order.

IF there's no working script, then add whatever startup line you need to to /etc/rc.local.

having not used mysql extensively as a server, i'm a bit confused why you've got 'safe_mysql &' listed. The & is used to put a program into the background, and if that file loads a server then it MUST fork into the background of it's own accord, or... well, it's not really a server is it?

OK, my fingers hurt

ask more q's as and when

gummi 10-28-2001 02:16 PM

Running Debian 2.2

Just for the information sake:

S stands for Start
K stands for Kill

Meaning that for each runlevel you control which programs start and which stop.

Although /etc/init.d scripts should be all standardized and good looking it doesn't mean you can't play with it. It is after all your system.
Personally I have created a file in /etc/init.d that runs all the things that I want to run, it's only an executable script that gets run at the prioraty level of 99 (i.e. after everything else) for things like setfont and cdrom configs and such things). The important thing is that you put a script (prefferably a standardized one) into /etc/init.d and then create links in which ever runlevel directory you want to that script. In Debian there is a program called 'update-rc.d' that creates those links for you and maintians them. I seem to remember my old R.H. having one too but I could be wrong.

tcm_va 10-30-2001 05:40 PM

figured it out
 
This is what I did: I used Linuxconf (can't find what happened to DrakConf!) and saw that it did exactly what you said to do manually. I did it for both httpd and mysql.

Why did I put an & after safe_mysqld? Becaue I am a newvie, and I read that using a & puts the process in the background, and I saw that if I didn't do it, I never got my terminal prompt back (when starting it manually).

vrillusions 02-08-2003 08:30 PM

interesting, wondering why mysql wasn't starting and it was listed as K90mysql (meaning it killed it) so I just changed that to an S and now it's working fine :D


All times are GMT -5. The time now is 12:56 AM.