open.itworld.com
  Search  
Security Home Page Security Webcasts Security White Papers Security Newsletters Security News Open Topics Careers ITworld Voices ITwhirled The Security site of ITworld.com

Unix Tip: Problems with inetd

ITworld.com 12/19/2006

Sandra Henry-Stocker, ITworld.com

Send in your Unix questions today! | See additional Unix tips and tricks

I ran into a problem recently with one of my Solaris 9 servers. For some reason which I have yet to pinpoint, any lines that I add to the /etc/inet/inetd.conf file are removed from the file almost as soon as I finish adding them. Well, almost any lines. Since I generally precede any additions to system configuration files with comments that describe what the lines are for, I did so with these recently added lines as well. When the file was modified, I noticed that only my comments remained in the file of the lines that I had inserted.

The culprit wasn't a cron job. For one thing, there were no obvious cron jobs which could account for what was happening. For another, the timing was odd. The file wasn't changed back on a time boundary (e.g., on the minute). Further, since comments were not removed, it was clear that the file was not simply being overwritten by a copy of the old file. Instead, only the functional entries were being stripped. Some recent change to this system was ensuring that nothing was added to inetd.conf.

Finding a workaround to the problem turned out to be much easier than anticipated. Some processes started by inetd run perfectly well as standalone processes; that is, they don't need inetd to open sockets for them. This wasn't true of the NetBackup processes that I was setting up. After looking over the inetd man page (RTFM is as valid a policy now as it was twenty years ago!) I found an easy way to ensure that inetd did my bidding and wasn't at the mercy of the mysterious problem affecting my inetd.conf file. I created an alternate /etc/inet/inetd.conf file and restarted inetd using the new file in lieu of the standard file.

First, I made a copy of my inetd.conf file and re-added my new lines to the end of the new file.

boson:/etc/inet# cp inetd.conf inetd.conf_w_netbackup
boson:/etc/inet# echo '
> bpcd    stream  tcp     nowait  root    /usr/openv/netbackup/bin/bpcd bpcd
> vnetd   stream  tcp     nowait  root    /usr/openv/bin/vnetd vnetd
> vopied  stream  tcp     nowait  root    /usr/openv/bin/vopied vopied
> bpjava-msvc     stream  tcp     nowait  root    /usr/openv/netbackup/bin/bpjava-msvc bpjava-msvc .transient
> ' >> inetd.conf_w_netbackup
Then, I stopped and restarted inetd using the new configuration file. Note that you want to be careful NOT to log off between killing if you are depending on services supported by inetd to log back in. I depend on sshd which is running independently of inetd.
boson:/etc/inet# pkill inetd
boson:/etc/inet# pgrep inetd
boson:/etc/inet# /usr/sbin/inetd -s /etc/inet/inetd.conf.netbackup
boson:/etc/inet# pgrep inetd
7457
Once inetd was restarted, I verified that my NetBackup services were working properly and then modified /etc/init.d/inetsvc to use the new configuration file whenever the system is restarted. Since /etc/rc2.d/S72inetsvc and similar files are hard-linked to /etc/init.d/inetsvc, this is the only change that I had to make to make my new setup permanent.

I still plan to track down the odd problem with my original inetd.conf file. Even with inetd using a different configuration file, additions to the inetd.conf are still being stripped out. In the meantime, however, my system is being backed up and the pressure is off.

On this topic

 

Sandra Henry-Stocker has been administering Unix systems for more than 18 years. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She currently works for TeleCommunication Systems, a wireless communications company, in Annapolis, Maryland, where no one else necessarily shares any of her opinions. She lives with her second family on a small farm on Maryland's Eastern Shore. Send comments and suggestions to bugfarm@gmail.com.




Sponsored Links

Sign up for a Microsoft Dynamics® CRM WEBCAST
Hear globally recognized leaders in customer strategy discuss the importance and evolution of CRM.
TRY NEW SUN SERVERS FREE for 60 Days!
Test The Latest Sun Servers In Your Environment BEFORE YOU BUY. Pay Nothing, Not Even Shipping.
Workflow Enabled Help Desk & IT Service Management
Automate service desk activities and integrate processes across IT. Learn more here.
Sign up for a FREE NETWORK RISK ASSESSMENT!
MORE THAN 70% OF NETWORKS ARE INFECTED by hidden Malware. Find out if your network is infected now!
Enterprise IP Goes Mobile
To maximize full productivity, companies must integrate their mobile applications with the IP network.
» Buy a link now

Advertisements
Sponsored links
Top 5 Reasons to Combine App Performance and Security
Locate Hidden Software on business PCs with this free tool
KODAK i1400 Series Scanners stand up to the challenge
Bring harmony to your mix of UNIX-Linux-Windows computing environments
 Home   Open source  Operating systems  Unix
www.itworld.com    open.itworld.com     security.itworld.com     smallbusiness.itworld.com
storage.itworld.com     utilitycomputing.itworld.com     wireless.itworld.com

 
Contact Us   About Us   Privacy Policy    Terms of Service   Reprints  

CIO   Computerworld   CSO   GamePro   Games.net   IDG Connect   IDG World Expo   Infoworld   ITworld   JavaWorld   LinuxWorld  MacUser   Macworld   Network World   PC World   Playlist  

Copyright © Computerworld, Inc. All rights reserved

Reproduction in whole or in part in any form or medium without express written permission of Computerworld Inc. is prohibited. Computerworld and Computerworld.com and the respective logos are trademarks of International Data Group Inc.