Bug 61371 - /sbin/service qwerks
/sbin/service qwerks
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2002-03-18 13:44 EST by Christopher McCrory
Modified: 2014-03-16 22:26 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-03-20 23:00:47 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Christopher McCrory 2002-03-18 13:44:59 EST
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

Actual Results:
extra environment variables
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:

LESSOPEN=|/usr/bin/lesspipe.sh %s

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

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

I'm not a programmer, I'm a sysadmin

It seems it should be fairly easy to add this to /sbin/service
Comment 1 Bill Nottingham 2002-04-10 02:05:01 EDT
Fixed in 6.62-1.

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