-
Notifications
You must be signed in to change notification settings - Fork 45
Package Mox as a service #677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Turns out that it was just a matter of modifying the service order since the dns configuration is not over by the time the fix-mox-service-order.patch
---
projects/Mox/module.nix | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/projects/Mox/module.nix b/projects/Mox/module.nix
index 43bb8d7..91d38d7 100644
--- a/projects/Mox/module.nix
+++ b/projects/Mox/module.nix
@@ -48,23 +48,26 @@
systemd.services.mox-setup = {
description = "Setup Mox Mail Server";
wantedBy = [ "multi-user.target" ];
+ requires = [ "network-online.target" ];
+ after = [ "network-online.target" ];
before = [ "mox.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
+ User = "mox";
+ Group = "mox";
};
script = ''
mkdir -p /var/lib/mox
cd /var/lib/mox
${pkgs.mox}/bin/mox quickstart -hostname ${config.services.mox.hostname} ${config.services.mox.user}
- chown -R mox:mox /var/lib/mox
'';
};
systemd.services.mox = {
wantedBy = [ "multi-user.target" ];
- after = [ "network.target" "mox-setup.service" ];
- requires = [ "mox-setup.service" ]; # This ensures mox-setup must succeed
+ after = [ "mox-setup.service" ];
+ requires = [ "mox-setup.service" ];
serviceConfig = {
WorkingDirectory = "/var/lib/mox";
ExecStart = "${pkgs.mox}/bin/mox -config /var/lib/mox/config/mox.conf serve";
--
2.47.2 |
lol. Been on it since I left the office hour I added |
That sounds like it could be useful for a separate example config that uses DNSSEC, for those interested in that |
530c09e
to
077a483
Compare
Yess. I've stashed changes using |
I think the test fails in CI because it's not running with
which will fail. |
After many days of debugging, I got it working @eljamm I've refreshed my knowledge on DNSs quite much in this process. It was as good as it was heartbreaking 😅 Kindly give it a review. Thanks for the time you've dedicated to my issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done @themadbit! This is shaping up really nicely.
ac178d6
to
a5bf11a
Compare
460cfa3
to
9c0c010
Compare
23e7a2a
to
dece5b8
Compare
dece5b8
to
c3d3241
Compare
@fricklerhandwerk, we might want to rerun the checks, as the error with |
The issue with the ubuntu test was resolved in #1054 and I'm in the process of fixing CI, now. |
ooh, okay |
CI failures are unrelated to these changes (see #1040) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, well done @themadbit!
Closes #576 #577 #578
i.e:
However, it fails to start/survive reboot with:
So, I'll leave this as a draft PR as I investigate further. Putting it out here in case you've had a similar headache and know the painkiller 😅