Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Here is the first part of my question. Splitted it because of rule "One topic - one question". My third and main question is about configuring autostart for webserver and database. init.d scripts seems to be very heavy for my case. (Just run smth on startup.)

share|improve this question
    
So what is your question? Please make it self-contained, even if that involves duplicating information. Normally you don't want people to read other posts just to get the information they need in order to give you an answer :) –  slhck Dec 26 '12 at 16:42
    
Why are init.d scripts "heavy" for starting services? Exactly that is their purpose. –  Karma Fusebox Dec 26 '12 at 17:13
    
I think I do not need service restarting. I do not even need a service. I just want an automatical startup. –  madhead Dec 26 '12 at 19:30
    
@madhead which service you want to make automatic startup? –  max Dec 28 '12 at 12:39
    
@max in my case only two services: tomcat and mongodb. Both are not installed from repositories. (When installing from repos, init.d scripts are created). –  madhead Dec 28 '12 at 12:48

1 Answer 1

First check whether tomact deamon is running or not using this command

[root@localhost ~]# chkconfig --list | grep -i tomcat
tomcat6         0:off   1:off   2:off   3:off   4:off   5:off   6:off

Here 0 1 2 3 4 5 6 means run levels

In my case in run level 5 tomcat is not running that's why while tying service tomcat6 status its showing stopped

[root@ical ~]# service tomcat6 status
tomcat6 is stopped   

Now start the service permanently by using this command, permanent means no need to start the tomcat6 service Again and Again

To make it permanent use this is the command

[root@ical ~]# chkconfig tomcat6 on

Now check the service whether it is running or not

[root@ical ~]# chkconfig --list | grep -i tomcat
tomcat6         0:off   1:off   2:on    3:on    4:on    5:on    6:off

See in run level 5 its on (5:on)

[root@ical ~]# service tomcat6 start
Starting tomcat6:                                          [  OK  ]
[root@ical ~]# service tomcat6 status
tomcat6 (pid 2806) is running...                           [  OK  ]

After reboot check Again

Do the same for mongodb also

share|improve this answer
    
I have no tomcat service. I only have tomcat binary unzipped to /usr/local/tomcat. –  madhead Dec 28 '12 at 16:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.