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.