LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-26-2001, 12:30 PM   #1
tcm_va
LQ Newbie
 
Registered: Oct 2001
Posts: 4

Rep: Reputation: 0
Question 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,
 
Old 10-26-2001, 02:05 PM   #2
webtoe
Member
 
Registered: Apr 2001
Location: Cambridge, England
Distribution: Slackware 10, Fedora Core 3, Mac OS X
Posts: 617

Rep: Reputation: 30
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.
 
Old 10-26-2001, 04:49 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
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
 
Old 10-28-2001, 03:16 PM   #4
gummi
LQ Newbie
 
Registered: Oct 2001
Location: CA
Distribution: Debian
Posts: 10

Rep: Reputation: 0
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.
 
Old 10-30-2001, 06:40 PM   #5
tcm_va
LQ Newbie
 
Registered: Oct 2001
Posts: 4

Original Poster
Rep: Reputation: 0
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).
 
Old 02-08-2003, 09:30 PM   #6
vrillusions
Member
 
Registered: Feb 2003
Location: Ohio, USA
Distribution: Ubuntu, Debian, CentOS
Posts: 99

Rep: Reputation: 25
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
starting programs on bootup mantonr Linux - Newbie 2 05-30-2005 10:07 AM
Starting programs on bootup, solutions iskrem Linux - General 2 11-17-2004 07:05 PM
daemons starting on bootup papajohns AIX 4 08-04-2004 02:27 PM
starting apache at bootup softgun Debian 11 08-05-2003 08:17 AM
help starting xscreensaver at bootup rose_bud4201 Linux - Software 2 01-10-2003 07:25 AM


All times are GMT -5. The time now is 06:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration