From: Pierre Langlois <pierre.langlois@gmx.com>
To: 43347@debbugs.gnu.org
Subject: [bug#43347] [PATCH] services: dovecot: Do not require dovecot to be globally installed.
Date: Fri, 11 Sep 2020 20:40:06 +0100 [thread overview]
Message-ID: <87k0x09k6h.fsf@gmx.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 535 bytes --]
Hello Guix!
I noticed recently my little dovecot mailserver failed to boot, I
tracked it down to our service installing a symlink as:
/etc/dovecot/modules -> /run/current-system/profile/lib/dovecot
However, I didn't have the dovecot package globally installed, the
service does not install it AFAICT.
We could extend the service to install dovecot into the global profile,
however instead we can just symlink /etc/dovecot/modules to the dovecot
package in the store directly.
Here's the patch to do that! WDYT?
Thanks,
Pierre
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 519 bytes --]
[-- Attachment #2: 0001-services-dovecot-Do-not-require-dovecot-to-be-global.patch --]
[-- Type: text/x-patch, Size: 2436 bytes --]
From a85def0a578bc1b53b8af5e524a5ea9ce18f8403 Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois@gmx.com>
Date: Thu, 10 Sep 2020 23:25:02 +0100
Subject: [PATCH] services: dovecot: Do not require dovecot to be globally
installed.
* gnu/services/mail.scm (%dovecot-activation): Unconditionally symlink
/etc/dovecot/modules to the dovecot package's /lib dir instead of
hardcoding /run/current-system/profile/lib.
---
gnu/services/mail.scm | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index 291a2db8e1..47f686852a 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
;;; Copyright © 2017, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Kristofer Buffington <kristoferbuffington@gmail.com>
+;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1476,7 +1477,10 @@ greyed out, instead of only later giving \"not selectable\" popup error.
(with-output-to-string
(lambda ()
(serialize-configuration config
- dovecot-configuration-fields)))))))
+ dovecot-configuration-fields))))))
+ (dovecot (if (opaque-dovecot-configuration? config)
+ (opaque-dovecot-configuration-dovecot config)
+ (dovecot-configuration-dovecot config))))
#~(begin
(use-modules (guix build utils))
(define (mkdir-p/perms directory owner perms)
@@ -1533,8 +1537,9 @@ greyed out, instead of only later giving \"not selectable\" popup error.
(copy-file #$(plain-file "dovecot.conf" config-str)
"/etc/dovecot/dovecot.conf")
(mkdir-p/perms "/etc/dovecot/private" user #o700)
- (unless (file-exists? moduledir)
- (symlink "/run/current-system/profile/lib/dovecot" moduledir))
+ (if (file-exists? moduledir)
+ (delete-file moduledir))
+ (symlink (string-append #$dovecot "/lib/dovecot") moduledir)
(create-self-signed-certificate-if-absent
#:private-key "/etc/dovecot/private/default.pem"
#:public-key "/etc/dovecot/default.pem"
--
2.28.0
next reply other threads:[~2020-09-11 19:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-11 19:40 Pierre Langlois [this message]
2020-09-11 21:02 ` [bug#43347] [PATCH] services: dovecot: Do not require dovecot to be globally installed Julien Lepiller
2020-09-11 21:33 ` Tobias Geerinckx-Rice via Guix-patches via
2020-09-11 21:50 ` bug#43347: " Pierre Langlois
2020-09-12 15:06 ` [bug#43347] " Alexey Abramov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k0x09k6h.fsf@gmx.com \
--to=pierre.langlois@gmx.com \
--cc=43347@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).