Operating System - HP-UX
1748154 Members
3695 Online
108758 Solutions
New Discussion

Re: Environment variables of daemon processes

 
IgnatzMouse
Occasional Visitor

Environment variables of daemon processes

Folks'ses,

 

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?

 

Thanx

 

PS: I'm not the admin I only use the box and the admins say they didn't change anything (as usual ;)

6 REPLIES 6
Dennis Handly
Acclaimed Contributor

Re: Environment variables of daemon processes

>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.

IgnatzMouse
Occasional Visitor

Re: Environment variables of daemon processes

Thanx Dennis, for your answer.

 

  1. I'm expecting something because it used to work (I'm currently taking over long established software);
  2. 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...

Dennis Handly
Acclaimed Contributor

Re: Environment variables of daemon processes

>I did dump the environment in the 2nd process

 

Anything besides PATH?  What about the first process?

IgnatzMouse
Occasional Visitor

Re: Environment variables of daemon processes

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

Dennis Handly
Acclaimed Contributor

Re: Environment variables of daemon processes

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.

IgnatzMouse
Occasional Visitor

Re: Environment variables of daemon processes

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".