From 1a1bbd3efe5d567b342f3ace29a92afb149bbb3f Mon Sep 17 00:00:00 2001 From: Félix Sipma Date: Fri, 11 Sep 2015 11:09:38 +0200 Subject: DebianMirror: run cronjob as user "debmirror" Signed-off-by: Félix Sipma --- src/Propellor/Property/DebianMirror.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Propellor') diff --git a/src/Propellor/Property/DebianMirror.hs b/src/Propellor/Property/DebianMirror.hs index 37a22ae0..252520c7 100644 --- a/src/Propellor/Property/DebianMirror.hs +++ b/src/Propellor/Property/DebianMirror.hs @@ -8,6 +8,7 @@ import Propellor import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Cron as Cron +import qualified Propellor.Property.User as User import Data.List @@ -27,10 +28,11 @@ mirror :: Url -> FilePath -> [DebianSuite] -> [Architecture] -> [Apt.Section] -> mirror url dir suites archs sections source priorities crontimes = propertyList ("Debian mirror " ++ dir) [ Apt.installed ["debmirror"] + , User.accountFor "debmirror" , File.dirExists dir , check (not . and <$> mapM suitemirrored suites) $ cmdProperty "debmirror" args `describe` "debmirror setup" - , Cron.niceJob ("debmirror_" ++ dir) crontimes (User "root") "/" $ + , Cron.niceJob ("debmirror_" ++ dir) crontimes (User "debmirror") "/" $ unwords ("/usr/bin/debmirror" : args) ] where -- cgit v1.2.3