Operating System - HP-UX
1830001 Members
3475 Online
109998 Solutions
New Discussion

at what level inetd will get strted.

 
madhavabk
Regular Advisor

at what level inetd will get strted.

Hi
what is the run level where inetd will get started.
and when to start socket programs and at what level.
18 REPLIES 18
Yogeeraj_1
Honored Contributor

Re: at what level inetd will get strted.

hi,

starts at level 1

# ll rc*.d/*|grep inetd
lrwxr-xr-x 1 root root 18 Dec 17 2004 rc1.d/K500inetd -> /sb
in/init.d/inetd
lrwxr-xr-x 1 root root 18 Dec 17 2004 rc2.d/S500inetd -> /sb
in/init.d/inetd
#


hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
sajeer_2
Regular Advisor

Re: at what level inetd will get strted.


From yogeeraj's reply,
Startup script S500inetd is on rc2.d
That means inetd starts on run level 2
madhavabk
Regular Advisor

Re: at what level inetd will get strted.

Hi,

But when it starts at rc2.d, my sample program that just opens one socket fails. with operation not supported message why?

And also ifconfig command fails with same message. It clearly indicates some thing not up and running before we are using the socket api right?

can you help me to solve this problem?
Thanks,
sajeer_2
Regular Advisor

Re: at what level inetd will get strted.


Where you are running your sample program?
If you put it as startup script,confirm it runs after inetd daemon.
madhavabk
Regular Advisor

Re: at what level inetd will get strted.

Hi,

i have put it in rc3.d and sequence number being any number then also this program does not run. And even ifconfig command does not run.

Similarly i have written a socket program in java it fails and thows expcetion with same error(socket Operation not supported and hangs on console), when i press Cntrl+c it will stop running all startup scripts and then if i do ps -ef it does not show inetd in the list of processes started.

But if i remove my hanging program and when system comes up fully then i can see inetd in ps -ef, so inetd is not starting properly during run level 2.

Kindly suggest me some thing it is taking lots of time.

Thanks,
MAdhvaa
madhavabk
Regular Advisor

Re: at what level inetd will get strted.

this is how ps -ef looks before my sample program starts.

Mydaemon is starting
. run-level 3 Sep 2 16:45 3 0 S
UID PID PPID C STIME TTY TIME COMMAND
root 0 0 0 16:45:58 ? 0:12 swapper
root 8 0 0 16:45:58 ? 0:00 supsched
root 9 0 0 16:45:58 ? 0:00 strmem
root 10 0 0 16:45:58 ? 0:00 strweld
root 11 0 0 16:45:58 ? 0:00 strfreebd
root 2 0 0 16:45:58 ? 0:00 vhand
root 3 0 0 16:45:58 ? 0:00 statdaemon
root 4 0 0 16:45:58 ? 0:00 unhashdaemon
root 12 0 0 16:45:58 ? 0:00 ttisr
root 13 0 0 16:45:58 ? 0:00 ioconfigd
root 1 0 0 16:45:58 ? 0:00 init
root 19 0 0 16:45:58 ? 0:00 lvmkd
root 20 0 0 16:45:58 ? 0:00 lvmkd
root 21 0 0 16:45:58 ? 0:00 lvmkd
root 22 0 0 16:45:58 ? 0:00 lvmkd
root 23 0 0 16:45:58 ? 0:00 lvmkd
root 24 0 0 16:45:58 ? 0:00 lvmkd
root 25 0 0 16:45:58 ? 0:00 lvmschedd
root 26 0 0 16:45:58 ? 0:00 smpsched
root 27 0 0 16:45:58 ? 0:00 smpsched
root 28 0 0 16:45:58 ? 0:00 sblksched
root 29 0 0 16:45:58 ? 0:00 sblksched
root 94 1 0 16:46:00 console 0:00 /sbin/sh /sbin/rc
root 279 94 0 16:46:05 console 0:00 /sbin/sh /sbin/rc
root 93 1 0 16:46:00 ? 0:00 init
root 35 0 0 16:45:58 ? 0:00 vxfsd
root 284 279 0 16:46:05 console 0:00 /bin/sh /sbin/rc3.d/S600deleteIt start_msg
root 288 284 2 16:46:05 console 0:00 /usr/bin/ps -ef
Hello from Maddy's daemon!
Yogeeraj_1
Honored Contributor

Re: at what level inetd will get strted.

hi

sorry for the error in my post above.
Thank you Sajeer for the correction.



Can you post the output corresponding to the startup of the inetd from the /etc/rc.log


kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
madhavabk
Regular Advisor

Re: at what level inetd will get strted.

Hi,

Here i am posting the few lines above and below the inetd.

Note: inetd starts at line number line 286 of 1060
and mydaemon starts at line 800 of 1060.


Start the Trusted Mode with NIS+ subsystem
Output from "/sbin/rc2.d/S440comsec start":
----------------------------
starting the Trusted Table Sync Daemon (ttsyncd)
Not an NIS+ root or master server
"/sbin/rc2.d/S440comsec start" SKIPPED

Configure pseudo devices for MAC/LLA access
Output from "/sbin/rc2.d/S462maclan start":
----------------------------

Start multicast routing daemon
Output from "/sbin/rc2.d/S490mrouted start":
----------------------------
"/sbin/rc2.d/S490mrouted start" SKIPPED

Start Internet services daemon
Output from "/sbin/rc2.d/S500inetd start":
----------------------------
Internet Services started

Start dynamic routing daemon
Output from "/sbin/rc2.d/S510gated start":
----------------------------
"/sbin/rc2.d/S510gated start" SKIPPED

Start router discover protocol daemon
Output from "/sbin/rc2.d/S520rdpd start":
----------------------------
"/sbin/rc2.d/S520rdpd start" SKIPPED

Configuring PPP Interface
Output from "/sbin/rc2.d/S522ppp start":
----------------------------
Creating 16 tunnel device nodes at major 31...

Please revert back if full rc.log you need.

Thanks,
Madhava
Yogeeraj_1
Honored Contributor

Re: at what level inetd will get strted.

hi madhava,

I think there is a problem with your custom script which is waiting for an input. Try to disable it and do a normal startup. See if you get inetd process running.

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
madhavabk
Regular Advisor

Re: at what level inetd will get strted.

Hi Yogeeraj,

Sorry, I could not get you.
I will put only ifconfig command in my script. Then also my script produces error ifconfig:socket:Operation not supported.

And my application does not read any thing.
If you need i can post my sample daemon program.

This program i have taken from HP site and modified to execv my application which was failing.


Thanks,
madhava
Ninad_1
Honored Contributor

Re: at what level inetd will get strted.

Is your lan interface for which you are trying to execute ifconfig enabled ?
Can you post the outputs of
lanscan
and file /etc/rc.config.d.netconf

Regards,
Ninad
Ninad_1
Honored Contributor

Re: at what level inetd will get strted.

Madhava,

Please see if this link helps
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=870504

Regards,
Ninad
madhavabk
Regular Advisor

Re: at what level inetd will get strted.

Hi Ninad,
the lan0 is configured and hence ifconfig should work.

I read the thread that you have given.
My application works when system is up and running. And faces problem only during system boot time. Do you recommend me to use the solution posted there?

Or this solution can be used only when in both cases network socket applications are not workign.

Please clarify.

Thanks,
Madhava
Ninad_1
Honored Contributor

Re: at what level inetd will get strted.

Madhava,

Ok lets go step by step.
First tell me do all the scripts -
S008net.init, S340net and S500inetd in rc2.d complete successfully without errors, if your script is not included at startup ? Are there any messages in rc.log for these scripts ?
If Yes then, after introducing your script with just the ifconfig command, check if works fine now ? Because the S340net uses ifconfig to configure the ip addresses and if this works fine, your script with ifconfig should just work fine.

Regards,
Ninad
madhavabk
Regular Advisor

Re: at what level inetd will get strted.

Hi,

all the scripts that you have mentioned will work fine when my script is not introduced in startup.

But when i use my script, it fails with socket:Operation not supported error.

Once i tried keeping my script only ifconfig command. Then it failed with Operation not Supported. then i added it in rc2.d and rc3.d it did not give any errors. but still when i use my simple socket application in this way it fails! :(

Any clues now?
madhavabk
Regular Advisor

Re: at what level inetd will get strted.

Hi,

As per your guidance, i have added only ifconfig in my rc script and following is output of it in rc.log file.


ifconfig: socket: Operation not supported
Output from "/sbin/rc3.d/S600deleteIt start":
----------------------------
lan0: flags=1843
inet 10.114.55.57 netmask ffffff00 broadcast 10.114.55.255

Thanks,
Madhava
madhavabk
Regular Advisor

Re: at what level inetd will get strted.

Hi All,

Today i added one entry in inittab file to start process.

myprg:3:once:/var/tmp/test

I have following inputs from this work.,

1. my program starts with inittab and gets killed again with same problem what i have reported.

2. If i put some sleep of minimum 30 seconds in script before starting my network application it works with out any problem.

Hence i suspect on machine configuration or the way how HP works compared to other Operating systems.

But this is not solution for my problem.
Please reply if any one find any inputs for me.

Thanks,
Madhava
madhavabk
Regular Advisor

Re: at what level inetd will get strted.

Hi All,

To some extent i have found the solution for the problem.
But i do not have an idea of why this is required on HP.

I create some dummy file descriptors (to ensure we have descriptors above number 2), before my socket API call or my sample daemon execv.

It works perfectly.

Can any one tell why this sort of thing i need to do specifically for HP?

Thanks,
madhava