LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 07-24-2009, 03:22 AM   #1
rajesh84210
Member
 
Registered: Jul 2009
Posts: 53

Rep: Reputation: 15
how to add a process to the startup


Dear All,
I would like a add a process(mysql in this case) to startup, so that when ever the linux machine boots,mysql also starts automatically(To be precise, iam lookin for something similar to start->run->MSCONFIG->startup in Windows).
i tried chkconfig --add mysql, but i get the following error."error reading information on service mysql: No such file or directory" .Kindly guide me.

Thanks in advance:-)
 
Old 07-24-2009, 03:24 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,272

Rep: Reputation: 148Reputation: 148
check whether mysql startup script available or not on this following location /etc/rc.d/init.d/
 
Old 07-24-2009, 03:28 AM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

It's always very useful to mention what distro you are using because the commands might differ.

On Debian this is done using update-rc.d if the program exists in /etc/initd.d directory. For example:
Code:
update-rc.d squid3 start 90 2 3 4 5 . stop 03 0 1 6 .
This will create startup and kill links for squid with sequence 90 for startup (after most of the others) on runlevel 2,3,4,5 and 03 for kill (before most of the others) on runlevel 0,1 and 6.

For more info man update-rc.d

Kind regards,

Eric
 
Old 07-24-2009, 03:42 AM   #4
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
Making the (very possibly wrong) assumption that chkconfig means a Red Hat family system, try chkconfig mysqld. As mentioned in both of the above posts, the things which chkconfig can operate on are all files under /etc/init.d.
 
Old 07-24-2009, 03:51 AM   #5
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,272

Rep: Reputation: 148Reputation: 148
mysql, mysqld just a script name, you can have any name. therefore we will have to pretty sure whether is there any startup script which is related to mysql


you can list all services added on which runlevel
#chkconfig --list

To add a services in runlevels
chkconfig --level 345 squid on
345 means runlevel

Last edited by kirukan; 07-24-2009 at 03:56 AM.
 
Old 07-24-2009, 03:55 AM   #6
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
It can have any name, but the mysql package of his distro installs it under a specific name which is probably not httpd, shorewall, or anything else. Five bucks says he's on Red Hat, Fedora, or CentOS, where it should be mysqld.
 
Old 07-24-2009, 04:11 AM   #7
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,272

Rep: Reputation: 148Reputation: 148
Ya i agree with you naming is very important if not users may be confused with application but what i said above its just a scritname, there are no necessity to be "d"

Last edited by kirukan; 07-24-2009 at 04:14 AM.
 
Old 07-24-2009, 04:32 AM   #8
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
True; I bolded the d only to make the difference between what the OP tried and what I was suggesting more obvious. Even blind, it's not a bad guess, though; 33 of my 85 available scripts are named with the usual daemon convention.
 
Old 07-24-2009, 05:59 AM   #9
rajesh84210
Member
 
Registered: Jul 2009
Posts: 53

Original Poster
Rep: Reputation: 15
Thisis the first time iam writing to this forum and am really impressed with the quick responses..

Iam using FC6,
 
Old 07-24-2009, 06:14 AM   #10
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
In that case, up it to ten bucks. Try chkconfig mysqld.

By the way, while you're here - I highly recommend upgrading your Fedora. FC6 is very old by Fedora standards - it's not even called Fedora Core anymore. If nothing else, consider this - should someone discover tomorrow that the right series of port knocks will cause the OpenSSH server to crap itself and provide root shell access to anyone who asks, you won't get the update that fixes that. Ever.
 
Old 07-24-2009, 06:22 AM   #11
rajesh84210
Member
 
Registered: Jul 2009
Posts: 53

Original Poster
Rep: Reputation: 15
Thanks for the post.. but this is server machine which iam workin on.. i would like to be clarified with the same..
 
Old 07-24-2009, 06:26 AM   #12
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
I'm not sure how being on a 'server' (whatever you mean by that) is relevant, but I realized that I misunderstood your original post. First things first - run chkconfig --list and see if there's a mysqld in there. The package (did you install it through yum or other package management?) should have given you an init script that you just need to enable, if for some reason it isn't already.
 
Old 07-24-2009, 06:37 AM   #13
rajesh84210
Member
 
Registered: Jul 2009
Posts: 53

Original Poster
Rep: Reputation: 15
Server i meant is that, i cannot update it ,alteast for now.I DO NOT find mysqld process running when i gibe chkconfig --list .. . yes, i did it using Yum..
 
Old 07-24-2009, 07:11 AM   #14
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,272

Rep: Reputation: 148Reputation: 148
Hi rajesh you are confusing, anyhow

1. check whether mysql is installed or not
from rpm --> rpm -qa | grep mysql
from source --> you should know the location

2. chkconfig just for add the services on runlevel(you cant check whether process running or not using chkconfig)

3. to check the running process
ps ax | grep mysql
 
Old 07-24-2009, 07:57 AM   #15
rajesh84210
Member
 
Registered: Jul 2009
Posts: 53

Original Poster
Rep: Reputation: 15
To start with, Iam a newbie to linux and kindly pasdon me if my questions are not very clear.
i didnot start the daemon last time.. but this time, even after startin the daemon, i dont find mysqld daemon when i gibe ckkconfig --list. anyways, on starting mysql manually and again trying chkconfig --list, still i dint see any mysql or mysqld process being listed.(yes, i do find it when i use nmap localhost) .
anyways all i want to know is how to make mysql start automatically when the linux machine starts.
 
  


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
startup process ust Linux - Newbie 3 11-20-2008 01:36 PM
add a process brianmay27 Linux - Software 1 07-23-2007 02:31 AM
Mandriva startup scripts (need to add something to startup before X starts) thunderweasel Mandriva 3 01-01-2006 01:55 AM
add a process to boot? alphamike Linux - Newbie 3 09-06-2005 01:20 PM
startup process thongor Slackware 2 03-21-2004 11:23 AM


All times are GMT -5. The time now is 06:45 PM.

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