0

I have a Amazon Linux instance in which Tomcat is starting up during the server start. I want to disable it. Tomcat is not listed in the chkconfig or /etc/rc.local. How to find out, from where it's starting up? I am not passing anything as user-data while starting the instance. I'm not using opsworks/cloudformation/elasicbeanstalk.

# chkconfig --list
acpid           0:off   1:off   2:on    3:on    4:on    5:on    6:off
atd             0:off   1:off   2:off   3:on    4:on    5:on    6:off
auditd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
blk-availability        0:off   1:on    2:on    3:on    4:on    5:on    6:off
cloud-config    0:off   1:off   2:on    3:on    4:on    5:on    6:off
cloud-final     0:off   1:off   2:on    3:on    4:on    5:on    6:off
cloud-init      0:off   1:off   2:on    3:on    4:on    5:on    6:off
cloud-init-local        0:off   1:off   2:on    3:on    4:on    5:on    6:off
crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off
ip6tables       0:off   1:off   2:on    3:on    4:on    5:on    6:off
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
irqbalance      0:off   1:off   2:off   3:on    4:on    5:on    6:off
jexec           0:on    1:on    2:on    3:on    4:on    5:on    6:on
lvm2-monitor    0:off   1:on    2:on    3:on    4:on    5:on    6:off
mdmonitor       0:off   1:off   2:on    3:on    4:on    5:on    6:off
messagebus      0:off   1:off   2:on    3:on    4:on    5:on    6:off
monit           0:off   1:off   2:off   3:off   4:off   5:off   6:off
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
ntpd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
ntpdate         0:off   1:off   2:on    3:on    4:on    5:on    6:off
psacct          0:off   1:off   2:off   3:off   4:off   5:off   6:off
racoon          0:off   1:off   2:off   3:off   4:off   5:off   6:off
rdisc           0:off   1:off   2:off   3:off   4:off   5:off   6:off
rsyslog         0:off   1:off   2:on    3:on    4:on    5:on    6:off
saslauthd       0:off   1:off   2:off   3:off   4:off   5:off   6:off
sendmail        0:off   1:off   2:on    3:on    4:on    5:on    6:off
sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
udev-post       0:off   1:on    2:on    3:on    4:on    5:on    6:off

Output from ps shows tomcat running on boot.

ps -ef

UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 15:01 ?        00:00:01 /sbin/init
root         2     0  0 15:01 ?        00:00:00 [kthreadd]
root         3     2  0 15:01 ?        00:00:00 [ksoftirqd/0]
root         4     2  0 15:01 ?        00:00:00 [kworker/0:0]
root         5     2  0 15:01 ?        00:00:00 [kworker/0:0H]
root         6     2  0 15:01 ?        00:00:00 [kworker/u2:0]
root         7     2  0 15:01 ?        00:00:00 [migration/0]
root         8     2  0 15:01 ?        00:00:00 [rcu_bh]
root         9     2  0 15:01 ?        00:00:01 [rcu_sched]
root        10     2  0 15:01 ?        00:00:00 [khelper]
root        11     2  0 15:01 ?        00:00:00 [kdevtmpfs]
root        12     2  0 15:01 ?        00:00:00 [netns]
root        13     2  0 15:01 ?        00:00:00 [kworker/u2:1]
root        19     2  0 15:01 ?        00:00:00 [xenwatch]
root        20     2  0 15:01 ?        00:00:01 [xenbus]
root       108     2  0 15:01 ?        00:00:00 [writeback]
root       110     2  0 15:01 ?        00:00:00 [kintegrityd]
root       111     2  0 15:01 ?        00:00:00 [bioset]
root       112     2  0 15:01 ?        00:00:00 [crypto]
root       114     2  0 15:01 ?        00:00:00 [kblockd]
root       122     2  0 15:01 ?        00:00:00 [xenbus_frontend]
root       126     2  0 15:01 ?        00:00:00 [kworker/0:1]
root       131     2  0 15:01 ?        00:00:00 [md]
root       229     2  0 15:01 ?        00:00:00 [khungtaskd]
root       234     2  0 15:01 ?        00:00:00 [kswapd0]
root       235     2  0 15:01 ?        00:00:00 [ksmd]
root       299     2  0 15:01 ?        00:00:00 [fsnotify_mark]
root       314     2  0 15:01 ?        00:00:00 [kthrotld]
root       321     2  0 15:01 ?        00:00:00 [khvcd]
root       364     2  0 15:01 ?        00:00:00 [deferwq]
root       631     2  0 15:01 ?        00:00:00 [jbd2/xvda1-8]
root       632     2  0 15:01 ?        00:00:00 [ext4-dio-unwrit]
root       667     1  0 15:01 ?        00:00:00 /sbin/udevd -d
root       690   667  0 15:01 ?        00:00:00 /sbin/udevd -d
root       691   667  0 15:01 ?        00:00:00 /sbin/udevd -d
root       841     2  0 15:01 ?        00:00:00 [jbd2/xvdb-8]
root       842     2  0 15:01 ?        00:00:00 [ext4-dio-unwrit]
root       873     2  0 15:01 ?        00:00:00 [kauditd]
root      1066     1  0 15:01 ?        00:00:00 /sbin/dhclient -q -lf /var/lib/dhclient/dhclient-eth0.leases -pf /var/run/dhclient-eth0.pid eth0
root      1106     1  0 15:01 ?        00:00:00 auditd
root      1119     1  0 15:01 ?        00:00:00 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
dbus      1140     1  0 15:01 ?        00:00:00 dbus-daemon --system
root      1227     1  0 15:01 ?        00:00:00 /usr/sbin/sshd
root      1239     2  0 15:01 ?        00:00:00 [kworker/0:1H]
ntp       1246     1  0 15:01 ?        00:00:00 ntpd -u ntp:ntp -p /var/run/ntpd.pid -g
root      1261     1  0 15:01 ?        00:00:00 sendmail: accepting connections
smmsp     1268     1  0 15:01 ?        00:00:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
root      1289     1  2 15:01 ?        00:00:06 /usr/java/jdk1.7.0_03/bin/java -Djava.util.logging.config.file=/opt/apache-tomcat-7.0.54/conf/logging.properties -Djava.
root      1295     1  0 15:01 ?        00:00:00 crond
root      1305     1  0 15:01 ?        00:00:00 /usr/sbin/atd
root      1351     1  0 15:01 hvc0     00:00:00 /sbin/agetty hvc0 38400 vt100-nav
root      1353     1  0 15:01 tty1     00:00:00 /sbin/mingetty /dev/tty1
root      1356     1  0 15:01 tty2     00:00:00 /sbin/mingetty /dev/tty2
root      1360     1  0 15:01 tty3     00:00:00 /sbin/mingetty /dev/tty3
root      1362     1  0 15:01 tty4     00:00:00 /sbin/mingetty /dev/tty4
root      1365     1  0 15:01 tty5     00:00:00 /sbin/mingetty /dev/tty5
root      1367     1  0 15:01 tty6     00:00:00 /sbin/mingetty /dev/tty6
root      1409  1227  0 15:06 ?        00:00:00 sshd: ec2-user [priv]
ec2-user  1411  1409  0 15:06 ?        00:00:00 sshd: ec2-user@pts/0
ec2-user  1412  1411  0 15:06 pts/0    00:00:00 -bash
root      1437  1412  0 15:06 pts/0    00:00:00 sudo su -
root      1438  1437  0 15:06 pts/0    00:00:00 su -
root      1439  1438  0 15:06 pts/0    00:00:00 -bash
root      1460  1439  0 15:06 pts/0    00:00:00 ps -ef
Santhosh S
  • 263
  • 2
  • 11
  • 2
    Please edit the question to say what OS you're using, or just add the tag for your OS. – Andrew Schulman Dec 03 '14 at 10:24
  • 1
    From that list CloudFormation and `cloud-init` would be a good suspect... – HBruijn Dec 03 '14 at 10:55
  • Are you using OpsWorks or Elasticbeanstalk? – TheFiddlerWins Dec 03 '14 at 17:39
  • I launched the instance from an AMI. I looked at all the cloud-* files, tomcat does not seem to be started from there. I'm not using opsworks/cloudformation/elasicbeanstalk. – Santhosh S Dec 03 '14 at 17:51
  • Can you show us how you know tomcat is starting on boot? Perhaps `ps` output? –  Dec 03 '14 at 18:03
  • Is 'tomcat' there in the `/etc/init.d` directory? – Sreeraj Dec 04 '14 at 15:49
  • @Sree: Yes. I have edited the question to include ps output. – Santhosh S Dec 05 '14 at 06:33
  • @SanthoshS , yeah I see that, but is there 'tomcat' in your `/etc/init.d` directory? – Sreeraj Dec 05 '14 at 06:37
  • @Sree yes tomcat file is present in /etc/init.d and I can start tomcat with `service tomcat start` command. – Santhosh S Dec 05 '14 at 06:44
  • Can you paste me the output of `grep chkconfig /etc/init.d/tomcat` ? Also, I assume that the `java` process you see in the `ps` output is the same process that you would see if you use `service tomcat start` to start tomcat. – Sreeraj Dec 05 '14 at 07:06
  • Tomcat was getting started through monit. I added a delay to monit daemon so that tomcat starts only after a certain time, if the service is not already running. Thanks a lot everyone! – Santhosh S Dec 05 '14 at 08:39

0 Answers0