Restarting inetd picks up environment, passed on via telnet
Curious problem I just encountered: needing to restart inetd, I su'd to root and executed the usual commands
Shortly after this, users started reporting unexpected behaviour after logging in with telnet, and it turned out they all had environment variables set to values that only I would use.
It appears (at least, this is the only explanation I have been able to come up with) that inetd inherited my environment (carried over via su) when I executed the 'inetsvc start' script, and telnet, and thence the login shell, then also inherited that environment.
Has anyone else noticed this? Is this a bug? Or should I have restarted the service some other way?
Every process you create inherits a copy of your environment variables, and anything they create gets copies too.
I hadn't expected that would matter to a system service, though! I thought such things usually clear the environment then set a strict one of their own.
Every process you create inherits a copy of your environment variables, and anything they create gets copies too.
I hadn't expected that would matter to a system service, though! I thought such things usually clear the environment then set a strict one of their own.
Exactly so. A system daemon (such as inetd) should surely be protected from inheriting it's parent process's environment in the normal way.
A warning to us all when writing service initialisation scripts, I think. Not inetd's fault, perhaps?
I was also surprised that this environment was inherited by telnet and by the login process. I somehow expected that a login shell would inherit only a predefined environment from the system configuration.
No. It is a Solaris 9 and older documented behavior.
If you kill and restart inetd, be aware that any environment variables in your shell are inherited by a shell for an incoming telnet session. For example, if you have USER=root in your environment, a user who connects to your machine with telnet inherits USER=root.
Quote:
Or should I have restarted the service some other way?
If your goal was for inetd to reread its configuration, the documented way would have been to send SIGHUP to the inetd process, eg:
Note that current Solaris releases (10, 11) no more use the same mechanism to restart this service so do not exhibit this issue.
No. It is a Solaris 9 and older documented behavior.
Ah. Thank you. For 'bug' read 'feature'. Or 'documented behavior' - I must remember that one
The one place I didn't look - updated man pages. Having checked the installed man page and not found a mention there, I will be sure to check for updates in future.
Quote:
If your goal was for inetd to reread its configuration, the documented way would have been to send SIGHUP to the inetd process
Hi,
I am using mv command for moving file mv /tmp/test /tmp/test_bkp but I am getting
change from notrun to 0 failed: Could not find command 'mv'
I am using mv command in puppet language, so generally we use like below
command => "/usr/bin/awk '/search/ { print $1}' /tmp/test
... (1 Reply)
hello all, i am trying to find a better to do what i am doing right now...
i have a file called sidlist...which has my database_name and password to the respective database
so something like below.. file is called sidlist and entry is below...
test, abc123
kes12, abcd12
pss, abcd1234... (5 Replies)
Hi All,
When i am trying to restart the inetd daemon it throughing error.
Please find the message and tell me what i need to do ?
Apr 7 22:57:37 HYDOHS01 inetd: ISTATE not in environment
Apr 7 22:57:41 HYDOHS01 inetd: stop: No such file or directory
Apr 7 22:58:01 HYDOHS01 inetd: ... (5 Replies)
Dear guys,
Pls help me this case. I telnet normally to Solaris. After restarting it manually, I can only console, cannot telnet from my latop although I can ping it. I checked
/etc/default/login
/usr/sbin/in.telnetd
/etc/inet/inetd.conf
All these files are the same.
I don't see telnet... (2 Replies)
Hi , I need help, today I restarted the server, when the machine was up, it had been to writte in the file osmlog that :
"inetd: talk/udp: bind: Address already in use"
This message appears in ten minutes every time. Why ?
Thanks. (6 Replies)
--------------------------------------------------------------------------------
Hi All ,
I have a client an server among which i want to make the server an inetd process.
I have enries in etc/services and etc/inetd.conf
The enries looks like below
etc/services
servername 5551/tcp... (4 Replies)
Ok, So I've been lazy over the past 3 years with the SCO server I maintain, as it just primarily hosts my private networked proprietary software, until now.
We have dedicated net access, in which the SCO server is not setup for and not going to be setup to connect to the internet by any direct... (8 Replies)