From mboxrd@z Thu Jan 1 00:00:00 1970 From: iyzsong@member.fsf.org (=?utf-8?B?5a6L5paH5q2m?=) Subject: Re: [PATCH 2/9] activation: Allow /var/lib to be a home directory. Date: Fri, 02 Sep 2016 19:54:38 +0800 Message-ID: <877fautt35.fsf@member.fsf.org> References: <20160901155711.7388-1-david@craven.ch> <20160901155711.7388-2-david@craven.ch> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfnea-0001yX-OK for guix-devel@gnu.org; Fri, 02 Sep 2016 08:33:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfneV-0004wi-Na for guix-devel@gnu.org; Fri, 02 Sep 2016 08:33:03 -0400 Received: from smtp27.openmailbox.org ([62.4.1.61]:41144 helo=smtp12.openmailbox.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfneV-0004wa-HK for guix-devel@gnu.org; Fri, 02 Sep 2016 08:32:59 -0400 In-Reply-To: <20160901155711.7388-2-david@craven.ch> (David Craven's message of "Thu, 1 Sep 2016 17:57:04 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: David Craven Cc: guix-devel@gnu.org David Craven writes: > * gnu/build/activation.scm (activate-user): Make sure /var/lib exists. > --- > gnu/build/activation.scm | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm > index 10aa58d..3abfdd6 100644 > --- a/gnu/build/activation.scm > +++ b/gnu/build/activation.scm > @@ -233,6 +233,9 @@ numeric gid or #f." > ;; 'groupadd' aborts if the file doesn't already exist. > (touch "/etc/group") > > + ;; allow /var/lib/application to be a home directory > + (mkdir-p "/var/lib") > + The comment is misleading, I think a better one is: allow home directories to be created under /var/lib. Also, it's better fit in the 'add-user' procudere, before the run of `useradd' command. And instead of handing this particular case, how about create any parent directory of HOME? like: [...] ;; create the parent directory of HOME. (when home (mkdir-p (dirname home))) ;; Use 'useradd' from the Shadow package. [...]