Bug 61371 - /sbin/service qwerks
Summary: /sbin/service qwerks
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-03-18 18:44 UTC by Christopher McCrory
Modified: 2014-03-17 02:26 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-03-21 04:00:47 UTC
Embargoed:


Attachments (Terms of Use)

Description Christopher McCrory 2002-03-18 18:44:59 UTC
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

Comment 1 Bill Nottingham 2002-04-10 06:05:01 UTC
Fixed in 6.62-1.


Note You need to log in before you can comment on or make changes to this bug.