Bug 1396274

Summary: alsactl store fails with error: "Cannot open /var/lib/alsa/asound.state for writing: No such file or directory"
Product: Red Hat Enterprise Linux 6 Reporter: Chris Leary <cleary>
Component: alsa-utilsAssignee: Jaroslav Kysela <jkysela>
Status: CLOSED ERRATA QA Contact: Ken Benoit <kbenoit>
Severity: high Docs Contact:
Priority: high    
Version: 6.8CC: bhu
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-21 11:06:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1346447    

Description Chris Leary 2016-11-17 20:27:32 UTC
Description of problem:
The version of alsa-utils shipped with RedHat 6.8 (1.1.0-8) appears to have been compiled to store alsa state (asound.state) to /var/lib/alsa, but the RPM package does not contain that directory - instead it still creates the file /etc/asound.state.

Previous releases (1.0.x) stored state to /etc/asound.state.

Version-Release number of selected component (if applicable):
1.1.0-8

How reproducible:
Easily and every time.

Steps to Reproduce:
1. Install fresh RedHat 6.8 system or upgrade to 6.8 from previous 6.x release
2. as root, execute "alsactl store"
3.

Actual results:
Error message reporting:
alsactl: save_state:1626: Cannot open /var/lib/alsa/asound.state for writing: No such file or directory

Expected results:
No error message with current alsa state saved to /etc/asound.state as was the case with previous EL6 releases.

Additional info:

Comment 4 Jaroslav Kysela 2016-11-22 09:13:41 UTC
Proposed patch:

  diff --git a/alsa-utils.spec b/alsa-utils.spec
  index 3e64b31..00c1784 100644
  --- a/alsa-utils.spec
  +++ b/alsa-utils.spec
  @@ -5,7 +5,7 @@
   Summary: Advanced Linux Sound Architecture (ALSA) utilities
   Name:    alsa-utils
   Version: 1.1.0
  -Release: 9%{?prever_dot}%{?dist}
  +Release: 10%{?prever_dot}%{?dist}
   License: GPLv2+
   Group:   Applications/Multimedia
   URL:     http://www.alsa-project.org/
  @@ -66,7 +66,8 @@ autoheader
   autoconf
   automake --foreign --copy --add-missing
   %configure CFLAGS="$RPM_OPT_FLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" \
  -           --sbindir=/sbin --disable-alsaconf --disable-bat
  +           --sbindir=/sbin --with-asound-state-dir=/etc \
  +           --disable-alsaconf --disable-bat
   %{__make} %{?_smp_mflags}
   %{__cp} %{SOURCE4} .
 
  @@ -139,6 +140,10 @@ if [ -s /etc/alsa/asound.state -a ! -s /etc/asound.state ] ; then
   fi
 
   %changelog
  +* Tue Nov 22 2016 Jaroslav Kysela <jkysela> 1.1.0-10
  +- Fix for /etc/asound.state (was /var/lib/alsa/asound.state)
  +- Resolves: rhbz#1396274
  +
   * Thu Oct 20 2016 Jaroslav Kysela <jkysela> 1.1.0-9
   - Fix for alsaloop (100% CPU)
   - Resolves: rhbz#1108292

Comment 6 Ken Benoit 2016-11-28 14:28:58 UTC
Installed RHEL-6.9-20161128.n.0 on a test system and confirmed that when executing "alsactl store" that it now writes to file /etc/asound.state instead of attempting to write to /var/lib/alsa/asound.state. Marking as verified.

Comment 8 errata-xmlrpc 2017-03-21 11:06:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0714.html