11-26-2013 07:04 AM
we have a strange problem here on HP-UX B.11.31: we have a daemon process, started by rc which in turn starts another process upon receiving some input over the network.
For some strange reason this 2nd process no longer has any reasonable environment set up, esp. PATH seems to be gone.
It used to work without a problem by now something has gone amiss.
Can anyone help identify the change that might cause this strange behaviour?
PS: I'm not the admin I only use the box and the admins say they didn't change anything (as usual ;)
11-26-2013 12:51 PM
>no longer has any reasonable environment set up
Why would you expect anything in the environment for a demon? You should be using absolute paths.
Can you dump the environment for your first process and check what's missing for the second.
11-26-2013 11:10 PM
Thanx Dennis, for your answer.
- I'm expecting something because it used to work (I'm currently taking over long established software);
- I did dump the environment in the 2nd process and its PATH variable only contains /sbin.
Using absolute paths is an option, I know, but the software is supposed to run on HP-UX, SUN, AIX, ... so I'm not sure if it is such a good idea...
11-27-2013 12:13 AM
DDFA=0 DHCPV6CLNTD_ARGS='' DHCPV6D=0 DHCPV6SRVRD_ARGS='' ERASE=^H ERRNO=2 FCEDIT=/usr/bin/ed IFS=' ' INETD=1 INETD_ARGS='' INIT_STATE=3 LANG=C LINENO=1 MAILCHECK=600 MROUTED=0 MROUTED_ARGS='' NTPDATE_SERVER='' OPTARG OPTIND=1 PATH=/sbin PPID=3093 PRE_U95=true PS2='> ' PS3='#? ' PS4='+ ' PWD=/sam/dev5bdevn/courier RANDOM=16935 RWHOD=0 SECONDS=0 SENDMAIL_RECVONLY=0 SENDMAIL_SENDONLY=0 SENDMAIL_SERVER=1 SENDMAIL_SERVER_NAME='' SHELL=/usr/bin/sh SNMP_HPUNIX_START=1 SNMP_IPv6_START=1 SNMP_MASTER_START=1 SNMP_MIB2_START=1 SNMP_NAA_START=0 SNMP_TRAPDEST_START=1 SSLSOCKET=7 TERM=unknown TMOUT=0 TZ=GMT XNTPD=1 XNTPD_ARGS='' _=/sam/dev5bdevn/courier/rc_tcpip
don't have acces to the 1st process
11-27-2013 12:32 AM
Since the rc(1m) scripts have to run without /usr mounted, I would think that PATH=/sbin is reasonable.
What other path components do you think you need?
If you want more, you will have to set them yourself.
11-27-2013 12:59 AM
I would need at least /usr/bin, because the process does, amongst many other things, a system("cp -r .."); which fails now.
The confusing thing though is, that it used to work, and "nobody changed anything".