- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: socket API issue on HP PA_RISC 11.11
Operating System - HP-UX
1756988
Members
3670
Online
108858
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-29-2006 07:20 PM
тАО08-29-2006 07:20 PM
socket API issue on HP PA_RISC 11.11
Hi All,
I have written a small program to create datagram socket as given in below lines.
struct sockaddr_in saddr;
int sockfd;
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
if ( sockfd < 0 )
{
perror("dgramTest.c:23 socket");
exit(2);
}
This program i am compiling like., /opt/ansic/bin/cc gramTest.c -o /var/tmp/test
This program runs fine when system is up and running.
But this program fails when i run it as part of init service from following script while system is booting.
The initscript looks like.,
#!/bin/sh
/var/tmp/test
The init script for this has priority S10 in /sbin/rc3.d.
The message i am getting on console is
dgramTest.c:23 socket: Operation not supported
Which is basically perror() output from above program lines.
Can you tell me is there any mistake in my program or there are some limitation to know.
Thanks,
Madhava
I have written a small program to create datagram socket as given in below lines.
struct sockaddr_in saddr;
int sockfd;
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
if ( sockfd < 0 )
{
perror("dgramTest.c:23 socket");
exit(2);
}
This program i am compiling like., /opt/ansic/bin/cc gramTest.c -o /var/tmp/test
This program runs fine when system is up and running.
But this program fails when i run it as part of init service from following script while system is booting.
The initscript looks like.,
#!/bin/sh
/var/tmp/test
The init script for this has priority S10 in /sbin/rc3.d.
The message i am getting on console is
dgramTest.c:23 socket: Operation not supported
Which is basically perror() output from above program lines.
Can you tell me is there any mistake in my program or there are some limitation to know.
Thanks,
Madhava
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-29-2006 07:43 PM
тАО08-29-2006 07:43 PM
Re: socket API issue on HP PA_RISC 11.11
This is most proablly because, you are starting program much earlier than netwotk stuff starts.
S10 will be started first than S20 and so on. Put this script as last starting (choose S number accordingly) script. By then all required programs/apps would have been started. (Like network sub-system, network interfaces etc.)
S10 will be started first than S20 and so on. Put this script as last starting (choose S number accordingly) script. By then all required programs/apps would have been started. (Like network sub-system, network interfaces etc.)
There is no substitute to HARDWORK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-29-2006 09:26 PM
тАО08-29-2006 09:26 PM
Re: socket API issue on HP PA_RISC 11.11
Hi RAC,
I have changed priority to S991 then also i can see the issue.
Moreover, if my init script use ifconfig lan0 command then this command also logs error like
ifconfig: socket: Operation not supported
Output from "/sbin/rc3.d/S991mydaemon start":
----------------------------
lan0: flags=1843
inet 10.114.55.57 netmask ffffff00 broadcast 10.114.55.255
So i am not able to get what should be the priority.
Thanks,
Madhava
I have changed priority to S991 then also i can see the issue.
Moreover, if my init script use ifconfig lan0 command then this command also logs error like
ifconfig: socket: Operation not supported
Output from "/sbin/rc3.d/S991mydaemon start":
----------------------------
lan0: flags=1843
inet 10.114.55.57 netmask ffffff00 broadcast 10.114.55.255
So i am not able to get what should be the priority.
Thanks,
Madhava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-20-2006 06:13 PM
тАО09-20-2006 06:13 PM
Re: socket API issue on HP PA_RISC 11.11
This issue is not because of:
1. rc level chosen
2. initd may not started before running our program.
Root cause:
===========
I feel on HPUX there is problem with getting
socket descriptors during system bootup time.
Some time there may be chances that it may get socket descriptor less that 2. 0-2 are for file I/O hence socket operation on them is not correct, hence i was getting error as Socket: Operation not supported.
But when i created some dummy descriptors before my socket API use in program this problem got fixed.
Hence it could be OS problem rather that application problem. We can use dummy descriptor opening method as work around for those program who need creation of sockets during system boot time.
Thanks,
Madhava
1. rc level chosen
2. initd may not started before running our program.
Root cause:
===========
I feel on HPUX there is problem with getting
socket descriptors during system bootup time.
Some time there may be chances that it may get socket descriptor less that 2. 0-2 are for file I/O hence socket operation on them is not correct, hence i was getting error as Socket: Operation not supported.
But when i created some dummy descriptors before my socket API use in program this problem got fixed.
Hence it could be OS problem rather that application problem. We can use dummy descriptor opening method as work around for those program who need creation of sockets during system boot time.
Thanks,
Madhava
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP