Description of Problem: Differing behavour with /sbin/service Version-Release number of selected component (if applicable): 6.43-1 to current rawhide How Reproducible: Steps to Reproduce: 1. boot system 2. restart service with /sbin/service 3. Actual Results: extra environment variables and possibly extra file handles Expected Results: clean environment clean exit Additional Information: When the system boots it does the sysv init thing starting various daemons At this point the environment is the same every time but if I restart a service, the daemon can inherit my environment this is easy to see with apache and php by running phpinfo() in a web page on a freshly booted machine the environment is pretty clean. After I restart apache, the environment has things like: QTDIR=/usr/lib/qt-2.3.1 LESSOPEN=|/usr/bin/lesspipe.sh %s KDEDIR=/usr LS_COLORS=<snip> LANG=en_US DISPLAY=localhost:11.0 etc. Other programs like ucd-snmp keep local file handles and/or stderr open. This is easy to see via ssh. "ssh server ; /sbin/service snmpd restart". Your connection will hang while ssh waits for stderr to close. In the case of snmpd it keeps a filehandle for my home directory [chrismcc@philippe chrismcc]$ sudo /usr/sbin/lsof | grep snmp snmpd 22946 root cwd DIR 8,3 4096 1466108 /home/chrismcc snmpd 22946 root rtd DIR 8,3 4096 2 / snmpd 22946 root txt REG 8,3 18028 374747 /usr/sbin/snmpd ... snmpd 22946 root 0u CHR 136,0 2 /dev/pts/0 after killing my xterm snmpd 22946 root 0u CHR 136,0 2 /dev/pts/0 (deleted) Besides hanging ssh this can also cause problems with mounts. i.e. if /home was NFS mounted, you couldn't unmount it because it is 'busy'. The same goes for cdroms. cd /mnt/cdrom ; rpm -ivh foo.rpm ; /sbin/service foo start ; cd / ; umount /mnt/cdrom" umount will not work because foo holds a file handle in /mnt/cdrom <disclaimer> I'm not a programmer, I'm a sysadmin </disclaimer> It seems it should be fairly easy to add this to /sbin/service
Fixed in 6.62-1.