GNU bug report logs - #40950
[PATCH] mcron, create /var/cron/tabs on activation

Previous Next

Package: guix-patches;

Reported by: Marcin Karpezo <sirmacik <at> wioo.waw.pl>

Date: Tue, 28 Apr 2020 21:34:01 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Marcin Karpezo <sirmacik <at> wioo.waw.pl>
To: 40950 <at> debbugs.gnu.org
Cc: Marcin Karpezo <sirmacik <at> wioo.waw.pl>
Subject: [bug#40950] [PATCH] mcron, create /var/cron/tabs on activation
Date: Tue, 28 Apr 2020 23:28:53 +0200
---
Hi!
With big rekado help I'm sending you a patch with at least partially
fixes the issue of crontab -e reporting missing /var/cron/tabs
directory.

 gnu/services/mcron.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/services/mcron.scm b/gnu/services/mcron.scm
index d9627c6bd0..ca9a54a041 100644
--- a/gnu/services/mcron.scm
+++ b/gnu/services/mcron.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2020 Marcin Karpezo <sirmacik <at> wioo.waw.pl>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -128,6 +129,12 @@ files."
               (actions
                (list (shepherd-schedule-action mcron files)))))))))

+(define (mcron-service-activation config)
+  (with-imported-modules '((guix build utils))
+    #~(begin
+        (use-modules (guix build utils))
+        (mkdir-p "/var/cron/tabs"))))
+
 (define mcron-service-type
   (service-type (name 'mcron)
                 (description
@@ -137,7 +144,10 @@ files."
                                           mcron-shepherd-services)
                        (service-extension profile-service-type
                                           (compose list
-                                                   mcron-configuration-mcron))))
+                                                   mcron-configuration-mcron))
+                       (service-extension activation-service-type
+                                          mcron-service-activation)))
+
                 (compose concatenate)
                 (extend (lambda (config jobs)
                           (mcron-configuration
--
2.26.2




This bug report was last modified 26 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.