-
Notifications
You must be signed in to change notification settings - Fork 34
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
Package Mox as a service #677
base: main
Are you sure you want to change the base?
Conversation
Update: I've run the test interactively for debugging and got access to the VM. The VM might not have a running nameserver, and I'd like to know if there's a way I can get one running as part of the machine configs before running the test(s). @eljamm, any pointers for further debugging? |
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 |
- Expose Mox as a service
I think the test fails in CI because it's not running with
which will fail. |
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 😅