From mboxrd@z Thu Jan 1 00:00:00 1970 From: swedebugia Subject: bug#34255: wishlist: Add guix-y way to create swapfile Date: Wed, 30 Jan 2019 08:48:29 +0100 Message-ID: <85f0c642-8f24-3b33-ded8-dee9e191f567@riseup.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([209.51.188.92]:48668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gokcJ-0006FN-Dr for bug-guix@gnu.org; Wed, 30 Jan 2019 02:49:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gokcI-00045b-LZ for bug-guix@gnu.org; Wed, 30 Jan 2019 02:49:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51735) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gokcI-00045T-HU for bug-guix@gnu.org; Wed, 30 Jan 2019 02:49:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gokcI-0001OI-9q for bug-guix@gnu.org; Wed, 30 Jan 2019 02:49:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([209.51.188.92]:48616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gokbz-0006BG-4z for bug-guix@gnu.org; Wed, 30 Jan 2019 02:48:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gokby-0003za-9L for bug-guix@gnu.org; Wed, 30 Jan 2019 02:48:42 -0500 Received: from mx1.riseup.net ([198.252.153.129]:46322) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gokby-0003xs-05 for bug-guix@gnu.org; Wed, 30 Jan 2019 02:48:42 -0500 Received: from cotinga.riseup.net (cotinga-pn.riseup.net [10.0.1.164]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.riseup.net (Postfix) with ESMTPS id 29C2B1A09E3 for ; Tue, 29 Jan 2019 23:48:34 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by cotinga.riseup.net with ESMTPSA id 843744369E for ; Tue, 29 Jan 2019 23:48:33 -0800 (PST) Content-Language: en-US List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 34255@debbugs.gnu.org Hi I specified a swapfile in my config without creating it on disk manually. (swap-devices '("/swapfile")) Then I predictably got this error: guix system: error: exception caught while executing 'start' on service 'swap-/swapfile': In procedure swapon: "/swapfile": No such file or directory I think we should let guix do all the dirty work of generating the swapfile so we can do something like: (swap-file (file "/swapfile")) (size "1G")) And then guix will invoke the relevant file tools to create and enable the swap file. We could add a check to see if the file exist and if yes try to use it as is. -- Cheers Swedebugia