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
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 – 2012-12-26T16:42:34.467
Why are init.d scripts "heavy" for starting services? Exactly that is their purpose. – Karma Fusebox – 2012-12-26T17:13:08.913
I think I do not need service restarting. I do not even need a service. I just want an automatical startup. – madhead – 2012-12-26T19:30:07.730
@madhead which service you want to make automatic startup? – max – 2012-12-28T12:39:44.640
@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 – 2012-12-28T12:48:52.440