[bug#77041,15/16] services: mcron: Deprecate.

Message ID 9c83cf458fc508990a834cecac3f9d8cbd74df87.1742073920.git.ludo@gnu.org
State New
Headers
Series Replacing mcron jobs by Shepherd timers |

Commit Message

Ludovic Courtès March 15, 2025, 9:37 p.m. UTC
  * gnu/services/mcron.scm (mcron-service-type): Mark as deprecated.
* gnu/home/services/mcron.scm (home-mcron-service-type): Likewise.
* doc/guix.texi (Scheduled Job Execution): Document it.
(Mcron Home Service): Likewise.

Change-Id: I0329bf1ef5026d6b7d392a5807f0600ff28c3006
---
 doc/guix.texi               | 18 ++++++++++++++++++
 gnu/home/services/mcron.scm |  7 +++++--
 gnu/services/mcron.scm      |  7 +++++--
 3 files changed, 28 insertions(+), 4 deletions(-)
  

Patch

diff --git a/doc/guix.texi b/doc/guix.texi
index 35999db9b0..19342c22a3 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -20851,6 +20851,18 @@  Scheduled Job Execution
 @cindex cron
 @cindex mcron
 @cindex scheduling jobs
+@quotation Deprecation Warning
+This section describes the mcron service, which is deprecated and slated
+for removal after 2026-04-01.
+
+The Shepherd supports running jobs periodically by defining services as
+@dfn{timers}.  @xref{Shepherd Services} for information on defining
+Shepherd services in Guix, and @ref{Timers,,, shepherd, The GNU Shepherd
+Manual} for information on Shepherd timers.
+
+Please use the Shepherd instead mcron.
+@end quotation
+
 The @code{(gnu services mcron)} module provides an interface to
 GNU@tie{}mcron, a daemon to run jobs at scheduled times (@pxref{Top,,,
 mcron, GNU@tie{}mcron}).  GNU@tie{}mcron is similar to the traditional
@@ -48514,6 +48526,12 @@  Mcron Home Service
 @cindex mcron
 @cindex scheduling jobs
 
+@quotation Deprecation Warning
+The @code{home-mcron-service-type} described below is superseded by
+Shepherd timers and slated for removal after 2026-04-01.
+@xref{Scheduled Job Execution}, for more information.
+@end quotation
+
 The @code{(gnu home services mcron)} module provides an interface to
 GNU@tie{}mcron, a daemon to run jobs at scheduled times (@pxref{Top,,,
 mcron, GNU@tie{}mcron}).  The information about system's mcron is
diff --git a/gnu/home/services/mcron.scm b/gnu/home/services/mcron.scm
index 23be44ba07..57b92da2eb 100644
--- a/gnu/home/services/mcron.scm
+++ b/gnu/home/services/mcron.scm
@@ -2,7 +2,7 @@ 
 ;;; Copyright © 2021, 2023 Andrew Tropin <andrew@trop.in>
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
-;;; Copyright © 2023 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2023, 2025 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +20,7 @@ 
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu home services mcron)
+  #:use-module (guix deprecation)
   #:use-module (gnu home services)
   #:use-module (gnu home services shepherd)
   #:use-module (gnu services mcron)               ;for the service mapping
@@ -53,7 +54,9 @@  (define-syntax-rule (home-mcron-configuration fields ...)
   ;; Macro provided for backward compatibility.
   (for-home (mcron-configuration fields ...)))
 
-(define home-mcron-service-type
+;; TODO: Deprecated; remove sometime after 2026-04-01.
+(define-deprecated home-mcron-service-type
+  home-shepherd-service-type
   (service-type
    (inherit (system->home-service-type mcron-service-type))
    (default-value (for-home (mcron-configuration)))))
diff --git a/gnu/services/mcron.scm b/gnu/services/mcron.scm
index 0e0d07d252..0bb0ae7450 100644
--- a/gnu/services/mcron.scm
+++ b/gnu/services/mcron.scm
@@ -1,5 +1,5 @@ 
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016-2020, 2023 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016-2020, 2023, 2025 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
 ;;;
@@ -22,6 +22,7 @@  (define-module (gnu services mcron)
   #:use-module (gnu services)
   #:use-module (gnu services shepherd)
   #:use-module (gnu packages guile-xyz)
+  #:use-module (guix deprecation)
   #:use-module (guix records)
   #:use-module (guix gexp)
   #:use-module (srfi srfi-1)
@@ -194,7 +195,9 @@  (define (mcron-shepherd-services config)
                  (actions
                   (list (shepherd-schedule-action mcron files)))))))))
 
-(define mcron-service-type
+;; TODO: Deprecated; remove sometime after 2026-04-01.
+(define-deprecated mcron-service-type
+  shepherd-root-service-type
   (service-type (name 'mcron)
                 (description
                  "Run the mcron job scheduling daemon.")