summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2018-05-03 12:25:48 -0400
committerJoey Hess2018-05-03 12:25:48 -0400
commit8f4a01225dbaf4d3f68ad0d94edab3f7650250ad (patch)
treef08f8e3e79e813ba132c7195a62868ba17e829a6
parent543aa510790b7b91c0c7dfc13fe41d8c80bc1f77 (diff)
parent94653981cab8a9e0640a8ce3eee54a186479c1e5 (diff)
Merge branch 'master' into joeyconfig
l---------config.hs2
-rw-r--r--debian/changelog4
-rw-r--r--doc/forum/5.3.5_errors_building_with_Stack/comment_1_bf0296c4293a52b4533a9465795366e4._comment7
-rw-r--r--doc/forum/5.3.5_errors_building_with_Stack/comment_2_be534b87de24660fb8565c2916ddefb5._comment12
-rw-r--r--doc/forum/5.3.5_import_errors/comment_2_32d521dad51ada52e98c9540ab97add6._comment21
-rw-r--r--doc/forum/5.3.5_import_errors/comment_3_a4774959fd93039d49196e7cff232089._comment21
-rw-r--r--doc/todo/depend_on_concurrent-output.mdwn20
-rw-r--r--privdata/relocate1
-rw-r--r--src/Propellor/Property/Chroot.hs5
-rw-r--r--src/Propellor/Property/Schroot.hs5
-rw-r--r--src/Propellor/Property/SiteSpecific/JoeySites.hs2
-rw-r--r--src/Propellor/Shim.hs9
12 files changed, 99 insertions, 10 deletions
diff --git a/config.hs b/config.hs
index 97d90636..ec313725 120000
--- a/config.hs
+++ b/config.hs
@@ -1 +1 @@
-joeyconfig.hs \ No newline at end of file
+config-simple.hs \ No newline at end of file
diff --git a/debian/changelog b/debian/changelog
index 9308a7bb..39fd6cba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,10 @@ propellor (5.3.6) UNRELEASED; urgency=medium
oldstable), to avoid needing to depend on the semigroups transitional
package, but also because it's just too old to be worth supporting.
* stack.yaml: Updated to lts-9.21.
+ * Make Schroot.overlaysInTmpfs revertable
+ Thanks, Sean Whitton
+ * Update shim each time propellor is run in a container, to deal with
+ library version changes.
-- Joey Hess <id@joeyh.name> Mon, 23 Apr 2018 13:12:25 -0400
diff --git a/doc/forum/5.3.5_errors_building_with_Stack/comment_1_bf0296c4293a52b4533a9465795366e4._comment b/doc/forum/5.3.5_errors_building_with_Stack/comment_1_bf0296c4293a52b4533a9465795366e4._comment
new file mode 100644
index 00000000..03121a74
--- /dev/null
+++ b/doc/forum/5.3.5_errors_building_with_Stack/comment_1_bf0296c4293a52b4533a9465795366e4._comment
@@ -0,0 +1,7 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2018-04-30T13:23:47Z"
+ content="""
+Think I've fixed this now.
+"""]]
diff --git a/doc/forum/5.3.5_errors_building_with_Stack/comment_2_be534b87de24660fb8565c2916ddefb5._comment b/doc/forum/5.3.5_errors_building_with_Stack/comment_2_be534b87de24660fb8565c2916ddefb5._comment
new file mode 100644
index 00000000..43e83fb7
--- /dev/null
+++ b/doc/forum/5.3.5_errors_building_with_Stack/comment_2_be534b87de24660fb8565c2916ddefb5._comment
@@ -0,0 +1,12 @@
+[[!comment format=mdwn
+ username="jsza"
+ avatar="http://cdn.libravatar.org/avatar/72c6bc8c0cdfb0fff175e90c3b036415"
+ subject="comment 2"
+ date="2018-04-30T14:27:19Z"
+ content="""
+Nice, thank you! Can confirm that it's now working for me.
+
+I'd also just like to say that using Propellor to manage our eleven or so TF2 game servers has been an absolute pleasure and a time saver.
+
+Thanks for all the work you've put into making Propellor so awesome.
+"""]]
diff --git a/doc/forum/5.3.5_import_errors/comment_2_32d521dad51ada52e98c9540ab97add6._comment b/doc/forum/5.3.5_import_errors/comment_2_32d521dad51ada52e98c9540ab97add6._comment
new file mode 100644
index 00000000..6edd05d7
--- /dev/null
+++ b/doc/forum/5.3.5_import_errors/comment_2_32d521dad51ada52e98c9540ab97add6._comment
@@ -0,0 +1,21 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2018-04-30T13:24:30Z"
+ content="""
+Seems this must be caused by [[!commit d8d2faece72eabd18c2ff303e5fb63c3a69961f6]]
+
+And I guess you've modified the config.hs in propellor
+for your own systems?
+
+You will indeed need to add dependencies to the cabal stanza for
+propellor-config.
+
+I think that you may be able to add Other-Modules: Utility.FileMode
+to the cabal stanza for propellor-config and get access to the unexported
+module that way. Not 100% sure.
+
+I'm curious: Is there part of propellor's published modules that made you
+need something from Utility.FileMode to use it, or were you writing your
+own property and happened to use something from Utility.FileMode?
+"""]]
diff --git a/doc/forum/5.3.5_import_errors/comment_3_a4774959fd93039d49196e7cff232089._comment b/doc/forum/5.3.5_import_errors/comment_3_a4774959fd93039d49196e7cff232089._comment
new file mode 100644
index 00000000..c861f1cc
--- /dev/null
+++ b/doc/forum/5.3.5_import_errors/comment_3_a4774959fd93039d49196e7cff232089._comment
@@ -0,0 +1,21 @@
+[[!comment format=mdwn
+ username="picca"
+ avatar="http://cdn.libravatar.org/avatar/7e61c80d28018b10d31f6db7dddb864c"
+ subject="comment 3"
+ date="2018-05-01T07:07:54Z"
+ content="""
+* Do you think that I should use a dedicated config-soleil.hs file instead of the config.hs file ?
+
+* I use the combinesModes in order to set the right mode.
+
+ +rra :: Property UnixLike
+ +rra = fetch `onChange` execmode
+ + where
+ + fetch :: Property UnixLike
+ + fetch = property \"install rra scripts\"
+ + (liftIO $ toResult <$> download \"https://archives.eyrie.org/software/devel/backport\" \"/usr/local/bin/backport\")
+ +
+ + execmode :: Property UnixLike
+ + execmode = File.mode \"/usr/local/bin/backport\" (combineModes (ownerWriteMode:readModes ++ executeModes))
+
+"""]]
diff --git a/doc/todo/depend_on_concurrent-output.mdwn b/doc/todo/depend_on_concurrent-output.mdwn
index 347ea9e5..c3641385 100644
--- a/doc/todo/depend_on_concurrent-output.mdwn
+++ b/doc/todo/depend_on_concurrent-output.mdwn
@@ -7,3 +7,23 @@ Waiting on concurrent-output reaching Debian stable.
> supporting the current oldstable, I believe.. --[[Joey]]
[[!tag user/joey]]
+
+> This was attempted again in 2018 and had to be reverted
+> in [[!commit b6ac64737b59e74d4aa2d889690e8fab3772d2c6]].
+>
+> The strange output I was seeing is the first line
+> of "apt-cache policy apache2" (but not subsequent lines)
+> and the ssh-keygen command run by `genSSHFP'`
+
+> Propellor also misbehaved in some other ways likely due to not seeing
+> the command output it expected. In particular Git.cloned must have
+> failed to see an origin url in git config output, because it nuked and
+> re-cloned a git repo (losing data).
+>
+> So, it seems that readProcess was somehow leaking output to the console
+> and also likely not providing it to the caller.
+>
+> The affected system had libghc-concurrent-output-dev 1.10.5-1 installed
+> from debian. That is a somewhat old version and perhaps it was buggy?
+> However, I have not had any luck reproducing the problem there running
+> readProcess in ghci. --[[Joey]]
diff --git a/privdata/relocate b/privdata/relocate
deleted file mode 100644
index 271692d8..00000000
--- a/privdata/relocate
+++ /dev/null
@@ -1 +0,0 @@
-.joeyconfig
diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs
index 0dd1f05a..5d29538c 100644
--- a/src/Propellor/Property/Chroot.hs
+++ b/src/Propellor/Property/Chroot.hs
@@ -169,10 +169,7 @@ propellChroot :: Chroot -> ([String] -> IO (CreateProcess, IO ())) -> Bool -> Pr
propellChroot c@(Chroot loc _ _ _) mkproc systemdonly = property (chrootDesc c "provisioned") $ do
let d = localdir </> shimdir c
let me = localdir </> "propellor"
- shim <- liftIO $ ifM (doesDirectoryExist d)
- ( pure (Shim.file me d)
- , Shim.setup me Nothing d
- )
+ shim <- liftIO $ Shim.setup me Nothing d
ifM (liftIO $ bindmount shim)
( chainprovision shim
, return FailedChange
diff --git a/src/Propellor/Property/Schroot.hs b/src/Propellor/Property/Schroot.hs
index bb20f6e6..2f399b7c 100644
--- a/src/Propellor/Property/Schroot.hs
+++ b/src/Propellor/Property/Schroot.hs
@@ -32,8 +32,8 @@ usesOverlays = isJust . fromInfoVal
-- Implicitly sets 'useOverlays' info property.
--
-- Shell script from <https://wiki.debian.org/sbuild>.
-overlaysInTmpfs :: Property (HasInfo + DebianLike)
-overlaysInTmpfs = go `requires` installed
+overlaysInTmpfs :: RevertableProperty (HasInfo + DebianLike) UnixLike
+overlaysInTmpfs = (go `requires` installed) <!> undo
where
f = "/etc/schroot/setup.d/04tmpfs"
go :: Property (HasInfo + UnixLike)
@@ -58,6 +58,7 @@ overlaysInTmpfs = go `requires` installed
, "fi"
]
`onChange` (f `File.mode` combineModes (readModes ++ executeModes))
+ undo = File.notPresent f
installed :: Property DebianLike
installed = Apt.installed ["schroot"]
diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs
index de93605e..9d7423d7 100644
--- a/src/Propellor/Property/SiteSpecific/JoeySites.hs
+++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs
@@ -1074,7 +1074,7 @@ laptopSoftware = Apt.installed
, "bsdgames", "nethack-console"
, "xmonad", "libghc-xmonad-dev", "libghc-xmonad-contrib-dev"
, "ttf-bitstream-vera"
- , "mairix", "offlineimap", "mutt"
+ , "mairix", "offlineimap", "mutt", "slrn"
, "mtr", "nmap", "whois", "wireshark", "tcpdump", "iftop"
, "pmount", "tree", "pv"
, "arbtt", "hledger", "bc"
diff --git a/src/Propellor/Shim.hs b/src/Propellor/Shim.hs
index 811ae7f0..b8ebdf46 100644
--- a/src/Propellor/Shim.hs
+++ b/src/Propellor/Shim.hs
@@ -16,12 +16,19 @@ import System.Posix.Files
-- | Sets up a shimmed version of the program, in a directory, and
-- returns its path.
--
+-- If the shim was already set up, it's refreshed, in case newer
+-- versions of libraries are needed.
+--
-- Propellor may be running from an existing shim, in which case it's
-- simply reused.
setup :: FilePath -> Maybe FilePath -> FilePath -> IO FilePath
-setup propellorbin propellorbinpath dest = checkAlreadyShimmed shim $ do
+setup propellorbin propellorbinpath dest = checkAlreadyShimmed propellorbin $ do
createDirectoryIfMissing True dest
+ -- Remove all old libraries inside dest, but do not delete the
+ -- directory itself, since it may be bind-mounted inside a chroot.
+ mapM_ nukeFile =<< dirContentsRecursive dest
+
libs <- parseLdd <$> readProcess "ldd" [propellorbin]
glibclibs <- glibcLibs
let libs' = nub $ libs ++ glibclibs