From 6d36de695ce187ed08b6fe8893c5e3cda1577d96 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 1 Jun 2015 17:51:20 -0400 Subject: [PATCH] add linkJournal property so it can be reverted to disable --- src/Propellor/Property/Systemd.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs index 87290fc..83cc1ea 100644 --- a/src/Propellor/Property/Systemd.hs +++ b/src/Propellor/Property/Systemd.hs @@ -22,6 +22,7 @@ module Propellor.Property.Systemd ( -- * Container configuration containerCfg, resolvConfed, + linkJournal, privateNetwork, ForwardedPort(..), Proto(..), @@ -136,6 +137,7 @@ container :: MachineName -> (FilePath -> Chroot.Chroot) -> Container container name mkchroot = Container name c h & os system & resolvConfed + & linkJournal where c@(Chroot.Chroot _ system _ _) = mkchroot (containerDir name) h = Host name [] mempty @@ -207,7 +209,6 @@ nspawnService (Container name _ _) cfg = setup teardown , "--quiet" , "--keep-unit" , "--boot" - , "--link-journal=try-guest" , "--directory=/var/lib/container/%i" ] ++ nspawnServiceParams cfg | otherwise = l @@ -302,6 +303,13 @@ containerCfg p = RevertableProperty (mk True) (mk False) resolvConfed :: RevertableProperty resolvConfed = containerCfg "bind=/etc/resolv.conf" +-- | Link the container's journal to the host's if possible. +-- (Only works if the host has persistent journal enabled.) +-- +-- This property is enabled by default. Revert it to disable it. +linkJournal :: RevertableProperty +linkJournal = containerCfg "link-journal=try-guest" + -- | Disconnect networking of the container from the host. privateNetwork :: RevertableProperty privateNetwork = containerCfg "private-network"