From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Service activation snippets vs mounting filesystems Date: Tue, 24 Feb 2015 22:31:12 -0500 Message-ID: <87wq36651b.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQSgj-00080l-55 for guix-devel@gnu.org; Tue, 24 Feb 2015 22:31:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQSge-00087q-6u for guix-devel@gnu.org; Tue, 24 Feb 2015 22:31:05 -0500 Received: from world.peace.net ([50.252.239.5]:40818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQSge-00087g-3W for guix-devel@gnu.org; Tue, 24 Feb 2015 22:31:00 -0500 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org Hello Guix, I wanted to add a service to clean /tmp and /var/run at boot time, and have run into several problems. First, I see no way to add a service that will be run early at boot time without modifying Guix itself. In this case, it should run after mounting filesystems but before anything else is started. It would be good to have a way to express such a constraint without modifying all of the existing services. For now, I was going to hack it into 'user-processes-service', since 'essential-services' arranges to add all filesystem services to the requirements for 'user-processes-service', and most other services depend on 'user-processes', so it seems well positioned for this cleanup task. However, I've now discovered a problem. Several services have activation scripts that create things in /var, and sometimes even in /var/run, one of the directories I want to clean. So, I must ensure that my cleanup happens before these activations. The problem is that these activation scripts are run before dmd is even launched, in 'operating-system-boot-script'. This implicitly assumes that everything created in the activation scripts is located on the root filesystem, since of course it happens before filesystems are mounted. Or am I missing something? Where is the right place to clean up /tmp and /var/run ? Mark