1837365 Members
3482 Online
110116 Solutions
New Discussion

inetd Service

 
J Ramesh Kumar
Advisor

inetd Service

Hi,

I am new to HP UNIX. I require to start my application as service. Before configuring my actual application, I just tried with a sample script act as an application which has just debug prints. I did the following steps,

1. Added the following entry in the /etc/inetd.conf file,
pmpagent stream tcp wait root /home/test/rameshj/service/a.sh testargs


2. Added the following entry in the /etc/service file,
pmpagent 5768/tcp

Then I restart inetd using the inetd command.

/sbin/init.d/inetd stop

/sbin/init.d/inetd start


I expected that, the a.sh script should call during "inetd start" operation. But it was not called. In my script, I performed the below operation in a while loop,
echo "test" > /home/test/rameshj/op.txt. But I couldn't find the op.txt after startup of inetd. Am I missing anything ? Can somebody please help me to resolve this issue ?

Thanks in advance,
Ramesh
7 REPLIES 7
Torsten.
Acclaimed Contributor

Re: inetd Service

Why should your script start when you start inetd ???

inetd is listening to port 5768 and start your script if a connection request come in.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Torsten.
Acclaimed Contributor

Re: inetd Service

see also

http://en.wikipedia.org/wiki/Inetd

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Laurent Menase
Honored Contributor

Re: inetd Service

try
telnet localhost pmpagent

then in an other window check if a.sh is running.
If not check /var/adm/syslog/syslog.log

else to reload the config you can just do inetd -c
chandra Sekhar_7
Frequent Advisor

Re: inetd Service

Dear Ramesh,

If u run inetd service it will reread the file /etc/services & /etc/inet.conf files

If u r script is fine it will call



Regards
chandra
J Ramesh Kumar
Advisor

Re: inetd Service

Thanks for all of your responses.

Torsten,

My understanding was wrong. Now, I understood... my script will call only if any request come to port 5768.

I require to start/stop my application whenever system comes up/goes down respectively. I think, it can be done via creating link to my application under /sbin/init.d directory. But I am not sure. Is it just enough to create a soft link under /sbin/init.d directory ? or Should I perform any other steps to meet my requirement ?

Thanks,
Ramesh
Torsten.
Acclaimed Contributor

Re: inetd Service

I hope this will help.

Do a

man rc

and have a look at

/sbin/init.d/template

and don't forget a matching file in /etc/rc.config.d

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Laurent Menase
Honored Contributor

Re: inetd Service

> I require to start/stop my application
> whenever system comes up/goes down
> respectively. I think, it can be done via creating link to my application under /sbin/init.d directory. But I am not sure. Is it just enough to create a soft link under /sbin/init.d directory ? or Should I perform any other steps to meet my requirement ?

1) you need to put a link in /sbin/rc2.d or /sbin/rc3.d.
2) if you are using socket API or dns request ne sure to start after S008net.init

The link name mus be SXXXmyscript and KXXXmyscript
Where XXX is a sequence number with 3 digits