From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] alsactl: Try to create state file directory Date: Mon, 08 Jun 2015 20:46:15 +0200 Message-ID: References: <1433541647-300-1-git-send-email-nicholson@endlessm.com> <1433780269.8893.5.camel@midnight> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 7BEDA2604C7 for ; Mon, 8 Jun 2015 20:46:15 +0200 (CEST) In-Reply-To: <1433780269.8893.5.camel@midnight> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Dan Nicholson Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 08 Jun 2015 09:17:49 -0700, Dan Nicholson wrote: > > On Mon, 2015-06-08 at 15:22 +0200, Takashi Iwai wrote: > > At Mon, 08 Jun 2015 15:03:21 +0200, > > Takashi Iwai wrote: > > > > > > At Mon, 8 Jun 2015 05:52:18 -0700, > > > Dan Nicholson wrote: > > > > > > > > On Jun 8, 2015 4:38 AM, "Takashi Iwai" wrote: > > > > > > > > > > At Fri, 5 Jun 2015 15:00:47 -0700, > > > > > Dan Nicholson wrote: > > > > > > > > > > > > Try to create the directory for the state file when saving so we don't > > > > > > depend on it being created ahead of time. This only checks for failures > > > > > > on existing directories and doesn't try to create the leading > > > > > > directories or workaround any other errors. This should catch the common > > > > > > case where /var/lib exists, but /var/lib/alsa doesn't. > > > > > > > > > > I don't think it's the role of alsactl. It saves a file on the > > > > > certain directory. If it doesn't exist, it's a failure of the > > > > > installed package. > > > > > > > > Sure, that's understandable, but there's a couple reasons I think this is > > > > helpful addition. > > > > > > > > First, if no path is supplied, store will save to /var/lib/alsa. So, it's > > > > not as of the user has supplied a path it didn't setup correctly. It would > > > > be nice if alsactl worked out of the box without additional integration by > > > > packagers. > > > > > > For that, a safer way would be to create /var/lib/alsa in the > > > installation.'s > > Sure, as I said, we can do that if necessary. It's just another custom > thing to maintain, and I think it would be nice if alsactl could manage > this on its own. Well, it can show a different face depending on the perspective. Imagine if you pass a wrong path (e.g. /vat/lib/alsa/asound.state). Then it creates the whole wrong directories. So, it might be nice, but it might be dangerous. And, as it's a tool mostly used by root, I'd like to vote for safety. thanks, Takashi