(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version



Inetd environment variables



(Traditional format)

Sat Nov 20 11:58:07 2004 Inetd environment variables
Posted by Tony Lawrence
Search Keys: code|network

Someone asked me recently where inetd gets its environment from. I said I didn't know for sure, but (since there's no place I know of to set them anywhere) I would expect it would inherit from whatever starts it. The person asking was running a SCO system, so that would be /etc/tcp. Most Linuxes now run xinetd, which lets you specify "env" in its xinetd.conf, but even those values are just added to (or replace) whatever it picks up from its startup heritage.

Well, he tested it by adding to /etc/tcp and found that yes, it picks that up. It would have surprised me if it didn't, because the underlying exec (fork and exec) of a shell script is going to pass the environment, and it would be a strange program indeed that didn't read what it had been passed.

If you only wanted this for a specific program that inetd or xinetd runs, it might make more sense to wrap that program in a script that set whatever you wanted, thus avoiding suddenly changing the environment of every other network program. Don't forget to export anything set that way.

Later on, he reported this:

Clarification on inetd and its environment.
The environment that inetd inherits from /etc/tcp is not passed onward as I first thought. The actual environment seen by any process started by inetd comes from /etc/default/login, which is very limited in scope. About the only thing that would be of interest there would be the PATH statement, usually /bin:/usr/bin.




Click here to add your comments



Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar


cartoon
Looking for Mac OS X Help?
OS X PDF e-books
Inexpensive, instant download


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.


book graphic unix and linux troubleshooting guide

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!



 I sell and support
 Kerio Mail server




pavatar.jpg
More:
       - Networking
       - Programming
       - Blog


Unix/Linux Consultants

Skills Tests

Guest Post Here











My Favorites

Change Congress