LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 01-29-2003, 09:44 PM   #1
TomCruise2002
LQ Newbie
 
Registered: Sep 2002
Posts: 12

Rep: Reputation: 0
Unhappy Problem starting java service during bootup



I have written a script which is supposed to start a java sockets listener service during bootup and stop it during shutdown.
See below.

I have placed the script inside /etc/rc.d/init.d and created two soft-linked files in /etc/rc.d/rc5.d so that when redhat linux boots up it will start the script.

After the system has booted up, and I do a ps -ef the java service appears in the list. The strange thing is that when the client program is started it can connect to the server (you don't get a cannot connect to host exception) but it hangs there.

Now if I login to the Linux machine and open a bash shell and stop and start the script again. The programs work perfectly. I am thinking that some other daemons are getting in the way.

I have attached the console for ps-ef for both cases.

Here is the ps -ef after the system boots and the program does not work

UID PID PPID C STIME TTY TIME CMD
root 1 0 2 12:09 ? 00:00:03 init [5]
root 2 1 0 12:09 ? 00:00:00 [keventd]
root 3 1 0 12:09 ? 00:00:00 [kapm-idled]
root 4 0 0 12:09 ? 00:00:00 [ksoftirqd_CPU0]
root 5 0 0 12:09 ? 00:00:00 [kswapd]
root 6 0 0 12:09 ? 00:00:00 [kreclaimd]
root 7 0 0 12:09 ? 00:00:00 [bdflush]
root 8 0 0 12:09 ? 00:00:00 [kupdated]
root 9 1 0 12:09 ? 00:00:00 [mdrecoveryd]
root 412 1 0 12:09 ? 00:00:00 [eth0]
root 413 1 0 12:09 ? 00:00:00 /sbin/dhcpcd -n -R eth0
root 483 1 0 12:09 ? 00:00:00 syslogd -m 0
root 488 1 0 12:09 ? 00:00:00 klogd -2
rpc 508 1 0 12:09 ? 00:00:00 portmap
ntp 658 1 0 12:09 ? 00:00:00 ntpd -U ntp
root 677 1 0 12:09 ? 00:00:00 /usr/sbin/sshd
postgres 738 1 0 12:09 ? 00:00:00 /usr/bin/postmaster -i
postgres 740 738 0 12:09 ? 00:00:00 postgres: stats buffer process
postgres 741 740 0 12:09 ? 00:00:00 postgres: stats collector proces
root 748 1 0 12:09 ? 00:00:00 java KT.ServerMain
root 752 1 0 12:09 ? 00:00:00 java KT.ServerMainDownload
root 785 1 0 12:09 ? 00:00:00 xinetd -stayalive -reuse -pidfil
root 786 752 0 12:09 ? 00:00:00 java KT.ServerMainDownload
root 787 748 0 12:09 ? 00:00:00 java KT.ServerMain
root 788 787 0 12:09 ? 00:00:01 java KT.ServerMain
root 789 786 0 12:09 ? 00:00:00 java KT.ServerMainDownload
root 790 787 0 12:09 ? 00:00:00 java KT.ServerMain
root 791 787 0 12:09 ? 00:00:00 java KT.ServerMain
root 792 786 0 12:09 ? 00:00:00 java KT.ServerMainDownload
root 793 786 0 12:09 ? 00:00:00 java KT.ServerMainDownload
root 794 787 0 12:09 ? 00:00:00 java KT.ServerMain
root 795 787 0 12:09 ? 00:00:00 java KT.ServerMain
root 796 786 0 12:09 ? 00:00:00 java KT.ServerMainDownload
root 797 786 0 12:09 ? 00:00:00 java KT.ServerMainDownload
root 798 786 0 12:09 ? 00:00:00 java KT.ServerMainDownload
root 799 787 0 12:09 ? 00:00:00 java KT.ServerMain
root 800 787 0 12:09 ? 00:00:00 java KT.ServerMain
root 801 786 0 12:09 ? 00:00:00 java KT.ServerMainDownload
lp 825 1 0 12:09 ? 00:00:00 lpd Waiting
root 844 1 0 12:09 ? 00:00:00 gpm -t ps/2 -m /dev/mouse
root 862 1 0 12:09 ? 00:00:00 crond
xfs 914 1 0 12:09 ? 00:00:00 xfs -droppriv -daemon
daemon 932 1 0 12:09 ? 00:00:00 /usr/sbin/atd
root 952 1 0 12:09 tty1 00:00:00 /sbin/mingetty tty1
root 953 1 0 12:09 tty2 00:00:00 /sbin/mingetty tty2
root 954 1 0 12:09 tty3 00:00:00 /sbin/mingetty tty3
root 955 1 0 12:09 tty4 00:00:00 /sbin/mingetty tty4
root 956 1 0 12:09 tty5 00:00:00 /sbin/mingetty tty5
root 957 1 0 12:09 tty6 00:00:00 /sbin/mingetty tty6
root 958 1 0 12:09 ? 00:00:00 /usr/bin/gdm -nodaemon
root 966 958 0 12:09 ? 00:00:00 /usr/bin/gdm -nodaemon
root 967 966 1 12:09 ? 00:00:02 /etc/X11/X :0 -auth /var/gdm/:0.
gdm 973 966 0 12:09 ? 00:00:00 /usr/bin/gdmlogin --disable-soun
gdm 974 973 0 12:09 ? 00:00:00 /usr/bin/xsri --redhat-login --r
root 980 677 0 12:10 ? 00:00:00 /usr/sbin/sshd
506 981 980 0 12:10 pts/0 00:00:00 -bash
root 1035 787 28 12:12 ? 00:00:05 java KT.ServerMain
root 1036 787 1 12:12 ? 00:00:00 java KT.ServerMain
root 1037 787 16 12:12 ? 00:00:03 java KT.ServerMain
root 4725 1037 0 12:12 ? 00:00:00 /usr/bin/env
root 4727 787 0 12:12 ? 00:00:00 [java]
506 4731 981 0 12:12 pts/0 00:00:00 ps -ef
root 4738 1037 0 12:12 ? 00:00:00 /usr/bin/env


Here is the ps -ef when the program works

UID PID PPID C STIME TTY TIME CMD
root 1 0 1 12:09 ? 00:00:03 init [5]
root 2 1 0 12:09 ? 00:00:00 [keventd]
root 3 1 0 12:09 ? 00:00:00 [kapm-idled]
root 4 0 0 12:09 ? 00:00:00 [ksoftirqd_CPU0]
root 5 0 0 12:09 ? 00:00:00 [kswapd]
root 6 0 0 12:09 ? 00:00:00 [kreclaimd]
root 7 0 0 12:09 ? 00:00:00 [bdflush]
root 8 0 0 12:09 ? 00:00:00 [kupdated]
root 9 1 0 12:09 ? 00:00:00 [mdrecoveryd]
root 412 1 0 12:09 ? 00:00:00 [eth0]
root 413 1 0 12:09 ? 00:00:00 /sbin/dhcpcd -n -R eth0
root 483 1 0 12:09 ? 00:00:00 syslogd -m 0
root 488 1 0 12:09 ? 00:00:00 klogd -2
rpc 508 1 0 12:09 ? 00:00:00 portmap
ntp 658 1 0 12:09 ? 00:00:00 ntpd -U ntp
root 677 1 0 12:09 ? 00:00:00 /usr/sbin/sshd
root 785 1 0 12:09 ? 00:00:00 xinetd -stayalive -reuse -pidfil
lp 825 1 0 12:09 ? 00:00:00 lpd Waiting
root 844 1 0 12:09 ? 00:00:00 gpm -t ps/2 -m /dev/mouse
root 862 1 0 12:09 ? 00:00:00 crond
xfs 914 1 0 12:09 ? 00:00:00 xfs -droppriv -daemon
daemon 932 1 0 12:09 ? 00:00:00 /usr/sbin/atd
root 952 1 0 12:09 tty1 00:00:00 /sbin/mingetty tty1
root 953 1 0 12:09 tty2 00:00:00 /sbin/mingetty tty2
root 954 1 0 12:09 tty3 00:00:00 /sbin/mingetty tty3
root 955 1 0 12:09 tty4 00:00:00 /sbin/mingetty tty4
root 956 1 0 12:09 tty5 00:00:00 /sbin/mingetty tty5
root 957 1 0 12:09 tty6 00:00:00 /sbin/mingetty tty6
root 958 1 0 12:09 ? 00:00:00 /usr/bin/gdm -nodaemon
root 966 958 0 12:09 ? 00:00:00 /usr/bin/gdm -nodaemon
root 967 966 0 12:09 ? 00:00:02 /etc/X11/X :0 -auth /var/gdm/:0.
gdm 973 966 0 12:09 ? 00:00:00 /usr/bin/gdmlogin --disable-soun
gdm 974 973 0 12:09 ? 00:00:00 /usr/bin/xsri --redhat-login --r
root 980 677 0 12:10 ? 00:00:00 /usr/sbin/sshd
506 981 980 0 12:10 pts/0 00:00:00 -bash
root 11624 981 0 12:13 pts/0 00:00:00 su root
root 12051 11624 0 12:13 pts/0 00:00:00 bash
postgres 14029 1 0 12:13 pts/0 00:00:00 /usr/bin/postmaster -i
postgres 14031 14029 0 12:13 pts/0 00:00:00 postgres: stats buffer process
postgres 14033 14031 0 12:13 pts/0 00:00:00 postgres: stats collector proces
root 14039 1 2 12:13 pts/0 00:00:00 java KT.ServerMain
root 14043 1 3 12:13 pts/0 00:00:00 java KT.ServerMainDownload
root 14047 14039 0 12:13 pts/0 00:00:00 java KT.ServerMain
root 14048 14047 0 12:13 pts/0 00:00:00 java KT.ServerMain
root 14049 14047 0 12:13 pts/0 00:00:00 java KT.ServerMain
root 14050 14047 0 12:13 pts/0 00:00:00 java KT.ServerMain
root 14051 14043 0 12:13 pts/0 00:00:00 java KT.ServerMainDownload
root 14052 14051 0 12:13 pts/0 00:00:00 java KT.ServerMainDownload
root 14053 14051 0 12:13 pts/0 00:00:00 java KT.ServerMainDownload
root 14054 14051 0 12:13 pts/0 00:00:00 java KT.ServerMainDownload
root 14055 14047 0 12:13 pts/0 00:00:00 java KT.ServerMain
root 14056 14047 0 12:13 pts/0 00:00:00 java KT.ServerMain
root 14057 14047 0 12:13 pts/0 00:00:00 java KT.ServerMain
root 14058 14047 0 12:13 pts/0 00:00:00 java KT.ServerMain
root 14059 14051 0 12:13 pts/0 00:00:00 java KT.ServerMainDownload
root 14060 14051 0 12:13 pts/0 00:00:00 java KT.ServerMainDownload
root 14061 14051 0 12:13 pts/0 00:00:00 java KT.ServerMainDownload
root 14062 14051 0 12:13 pts/0 00:00:00 java KT.ServerMainDownload
root 14067 12051 0 12:13 pts/0 00:00:00 ps -ef

Last edited by TomCruise2002; 01-29-2003 at 11:27 PM.
 
  


Reply



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
problem with starting Samba service honghebox Linux - Newbie 6 01-03-2006 11:20 PM
Problem with wireless networking starting at bootup. Zombie13 Mandriva 2 08-24-2005 01:26 PM
Error starting NetBackup: Cannot connect to the NB-Java authentication service charleycat Linux - Software 1 05-25-2005 08:13 AM
Problem starting Samba Service on Mandrake 9 Box StewieG Linux - Networking 3 05-15-2005 12:38 AM
Won't Boot - Starting Printer Service - Starting CUPS jeansond Linux - Newbie 0 10-11-2004 06:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Open Source Consulting | Domain Registration