Bug 7420

Summary: Inconsistent detection of sound device in init/halt scripts
Product: [Retired] Red Hat Linux Reporter: dim
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-11-29 21:45:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description dim 1999-11-29 21:03:56 UTC
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

In /etc/rc.d/rc.sysinit, where the settings are loaded, it says at line
  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
  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 21:45:59 UTC
fixed in initscripts-4.70-1. Thanks for noticing.