LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   runlevel , how to configure ? (https://www.linuxquestions.org/questions/linux-general-1/runlevel-how-to-configure-230080/)

kernelvn 09-13-2004 10:29 AM

runlevel , how to configure ?
 
I would like to know how to configure a runlevel for a deamon ( for example the rc.postgres is the script of postgreSQL and I want it start at boot time ) . How should I do ?

Andrew Benton 09-13-2004 10:50 AM

That depends what distro you're using. Different distro's have different bootscripts.

kernelvn 09-13-2004 11:11 AM

okie , I work on Fedora and Slackware . Could you give me something more ?

Andrew Benton 09-13-2004 12:17 PM

Sure, add the command you want to run to the shell script /etc/rc.d/rc.local

kernelvn 09-13-2004 08:24 PM

Quote:

runlevel
I would like to know about that . How to change runlevel for a deamon , not only as you show me :

Quote:

add the command you want to run to the shell script /etc/rc.d/rc.local
I think that is an old way and not so good because I can not restart it when there are more than one deamon in the rc.local . I think rc.local only for a program need to start up with machine , not for a deamon .

thank you anyway !

Again , anyone can help me ?

blood_omen 09-14-2004 03:47 PM

In Fedora you do have a nice little GUI application that interestingly enough is called services, If I remember correctly, from there you can start stop, and edit runlevels. Although it will only edit runlevel 3,4,5, I recall. Another tool for Fedora is checkconfig (I might be wrong with the name of the command); it does exactly the same as the aforementioned tool, but it also edit runlevels 1,2 and 6 and it is a command line tool.

In Slackware there's not such thing as processes staring at differetn runlevels at boot-up (that, I don't know for certain), but if you want to start a service just /etc/rc.d/nameofservices start|stop|restart, and if you want it to start the service at boot up, just make the file executable chmod +x /etc/rc.d/nameofservice and it will start next time you boot your machine

Here goes an example for Slack using rc.postgres that you mentioned.

a) To start the process
/etc/rc.d/rc.postgres start

b)To start the process at boot time
chmod +x /etc/rc.d/rc.postgres or
chmod 755 /etc/rc.d/rc.postgres


c) If you want to stop the process
/etc/rc.d/rc.postgres start

d) if you don't want the process to start at boot time
chmod 644 /etc/rc.d/rc.postgres

I hope this help you, have a nice day.

Capt_Caveman 09-14-2004 08:54 PM

Not really a security question. Moving this thread to the Linux - General Forum.


All times are GMT -5. The time now is 08:53 AM.