Bug 7420 - Inconsistent detection of sound device in init/halt scripts
Inconsistent detection of sound device in init/halt scripts
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-11-29 16:03 EST by dim
Modified: 2014-03-16 22:11 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-11-29 16:45:21 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description dim 1999-11-29 16:03:56 EST
To check if mixer settings can be loaded/saved, /proc/devices is grepped
for a sound entry, but this is done inconsistently in different init
scripts.

In /etc/rc.d/rc.sysinit, where the settings are loaded, it says at line
290:
  grep -q "14 sound" /proc/devices 2>/dev/null

And in /etc/rc.d/init.d/halt, where the settings are saved, it says at line
54:
  grep -q "\(sparcaudio\|sound\)" /proc/devices

As the second method seems more portable (if sparcaudio is really used?
can't check since I have no sparc), I think it would be the best to also
use this for the first case.

Maybe it's better to move this "detection" to /etc/rc.d/init.d/functions,
ie something like:

checksound {
  return grep -q "\(sparcaudio\|sound\)" /proc/devices 2>/dev/null
}

which could then be used consistently in all init scripts.
Comment 1 Bill Nottingham 1999-11-29 16:45:59 EST
fixed in initscripts-4.70-1. Thanks for noticing.

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