summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Systemd.hs
AgeCommit message (Collapse)Author
2019-07-16Systemd.machined: Fix a bug that caused the systemd-container package to not ↵Joey Hess
be installed when used with Debian buster. jessie (oldoldstable) is the only still supported release to have a systemd from before the systemd-container package was split out.
2019-07-02Revert "Revert "custom type error messages""Joey Hess
This reverts commit 665ea0d3d9e1b0e90278fd659dee0ef8642030da.
2019-07-02Revert "custom type error messages"Joey Hess
This reverts commits 14f6ae30809d8bbdb10b91cc59757e865a365df8 de21ef26861db458b0dfb0212cf501f9f8ed459b e20662e6a8881db55394a6366be17ca4e509bc2a Until this bug is resolved, these custom error types hide more basic errors. https://gitlab.haskell.org/ghc/ghc/issues/16894
2019-07-01fix build with ghc 8.0.1Joey Hess
Something in commit 14f6ae30809d8bbdb10b91cc59757e865a365df8 ghc 8.0.1 in a few cases unable to infer types when ensureProperty or tightenTargets is used. Newer versions of ghc, including 8.4.4 were able to infer these types. Perhaps it tries harder, or an inference bug was fixed. Seemed best to work around the problem to keep supporting ghc 8.0.1 and the current Debian stable. Since only 3 uses out of hundreds in propellor were affected, it's pretty unlikely it will affect user's properties, but I mentioned in in the changelog anyway. Hopefully a new Debian release will soon mean I no longer need to support 8.0.1, but the code changes also generally made it clearer and easier to read. And, I made custom type errors suggesting adding annotations to help any user who does encounter it. (Included in commit de21ef26861db458b0dfb0212cf501f9f8ed459b; may also help with other cases than an old ghc.)
2019-04-08change from inChroot to granular container capabilities infoJoey Hess
* Removed inChroot, instead use hasContainerCapability FilesystemContained. (API change) * Hostname: Properties that used to not do anything in a systemd or docker container will now change the container's hostname, since it's namespaced. More container capabilities can easily be added later, to fine grain control what properties will run in different kinds of containers. This changed CmdLine's Read instance, which should be ok, because propellor inside the container is always updated at the same time as propellor outside, so when it chains into the chroot, it will know to expect the capability list. Docker was not setting InChroot before, but now sets both container capabilities, so chroot setting will also work in it. Note that, things that used to check inChroot before would not work in docker, but things that check FilesystemContained now will. It may be that some of those properties don't really work properly in docker. And, Grub.installed used to run grub-mkconfig in a docker container before, I doubt that made sense (was it even safe?); it doesn't do it now. This commit was sponsored by Trenton Cronholm on Patreon.
2019-04-01Added Utility.FileMode to the modules exported by Propellor.UtilitiesJoey Hess
Since File.mode uses FileMode, it seems it ought to be exported by propellor somewhere. I don't want to make propellor Property modules themselves export core data types though, so this is a compromise of dubious utility.
2019-01-18fix withOS type level bugJoey Hess
withOS had a type level bug that allowed ensureProperty to be used inside it with a Property that does not match the type of the withOS itself. Propellor.Property.Cron.runPropellor is a Property DebianLike; it was incorrectly a Property UnixLike before and that wrong type was hidden by the withOS bug. This commit was sponsored by Jack Hill on Patreon.
2018-08-19one more fixJoey Hess
2018-08-19fix escaping non-alphanumericsJoey Hess
2018-08-19Systemd.escapePath functionJoey Hess
Useful when creating mount units.
2018-04-03fix comment indentJoey Hess
2018-02-17Systemd.machined should install systemd-container on Debian stretchSean Whitton
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
2017-07-27propellor spinJoey Hess
2017-07-27propellor spinJoey Hess
2017-05-15Removed dependency on MissingH, instead depends on split and hashable.Joey Hess
MissingH is a heavy dependency, which pulls in parsec and a bunch of stuff. So eliminating it makes propellor easier to install and less likely to fail to build. changesFileContent now uses hashable's hash. This may not be stable across upgrades, I'm not sure -- but it's surely ok here, as the hash is not stored. socketFile also uses hash. I *think* this is ok, even if it's not stable. If it's not stable, an upgrade might make propellor hash a hostname to a different number, but with 9 digets of number in use, the chances of a collision are small. In any case, I've opned a bug report asking for the stability to be documented, and I think it's intended to be stable, only the documentation is bad. NB: I have not checked that the arch linux and freebsd packages for the new deps, that Propellor.Bootstrap lists, are the right names or even exist. Since propellor depends on hashable, it could be changed to use unordered-containers, rather than containers, which would be faster and perhaps less deps too. This commit was sponsored by Alexander Thompson on Patreon.
2017-03-24fix diskimage finalization bugJoey Hess
* Fix bug when using setContainerProps with a chroot that prevented properties added to a chroot that way from being seen when propellor was running inside the chroot. This affected disk image creation, and possibly other things that use chroots. The problem was, propagateChrootInfo was being passed the initial version of the Chroot, but then the Chroot got more properties added, and so those were not recorded in the _chroot info. Fix was simply to make InfoPropagator be passed the Chroot as an additional parameter, so Chroot.provisioned' can pass in the final Chroot to it.
2017-03-11Changed Chroot data type to include Info propigationJoey Hess
This will allow for different Chroots that propigate info differently. hostChroot will use this. This commit was sponsored by Peter Hogg on Patreon.
2017-02-26use ConfigurableValue where applicableJoey Hess
* Removed fromPort (use val instead). (API change) * Removed several Show instances that were only used for generating configuration, replacing with ConfigurableValue instances. (API change) It's somewhat annoying that IsInfo requires a Show instance. That's needed to be able to display Info in ghci, but some non-derived Show instances had to be kept to support that.
2016-06-17revert accidential commitJoey Hess
2016-06-16responseJoey Hess
2016-06-13add DebianKernel datatypeFélix Sipma
(cherry picked from commit 3590a1241580ddcdd153e2619a3c02ce18a8db8c but without the changes to src/Propellor/Precompiled.hs)
2016-06-13convert Architecture to a sumtypeFélix Sipma
TODO: remove ANDROID (used in GitAnnexBuilder) TODO: add other architectures TODO: rename ARMHF TODO: rename ARMEL (cherry picked from commit 6f36f6cade4e1d8b15c714565e223562c6573099)
2016-05-28deal with systemd's KillUserProcesses changeJoey Hess
* Systemd: Added killUserProcesses property, which can be reverted to return systemd to its default behavior before version 230 started killing processes like screen sessions. * Systemd: Added logindConfigured property.
2016-03-30fix info propigation from chroot to systemd containerJoey Hess
2016-03-30refactorJoey Hess
2016-03-27finished the conversion, including my config file!Joey Hess
It builds, but I have not yet tested if it works. Need to verify info propagation, etc.
2016-03-27portedJoey Hess
fixed up chroot to take Props
2016-03-27ported SystemdJoey Hess
added mising method in docker
2016-03-26more portingJoey Hess
2016-03-26ported propagateContainerJoey Hess
Renamed several utility functions along the way.
2016-03-07clean upJoey Hess
2016-03-07add fromPort functionFélix Sipma
(cherry picked from commit c3a23f89092d1ef8367c37ab8993ea7031124f4b)
2015-12-06avoid removing line we wanted to add, only to add it back laterJoey Hess
2015-12-05UncheckedProperty for cmdProperty et alJoey Hess
* Properties that run an arbitrary command, such as cmdProperty and scriptProperty are converted to use UncheckedProperty, since they cannot tell on their own if the command truely made a change or not. (API Change) Transition guide: - When GHC complains about an UncheckedProperty, add: `assume` MadeChange - Since these properties used to always return MadeChange, that change is always safe to make. - Or, if you know that the command should modifiy a file, use: `changesFile` filename * A few properties have had their Result improved, for example Apt.buldDep and Apt.autoRemove now check if a change was made or not.
2015-10-27Explicit Info/NoInfo for RevertableProperty (API change)Joey Hess
RevertableProperty used to be assumed to contain info, but this is now made explicit, with RevertableProperty HasInfo or RevertableProperty NoInfo. Transition guide: - If you define a RevertableProperty, expect some type check failures like: "Expecting one more argument to ‘RevertableProperty’". - Change it to "RevertableProperty NoInfo" - The compiler will then tell you if it needs "HasInfo" instead. - If you have code that uses the RevertableProperty constructor that fails to type check, use the more powerful <!> operator
2015-10-23Hostname.sane and Hostname.setTo can now safely be used as a property of a ↵Joey Hess
chroot, and won't affect the hostname of the host system.
2015-10-23Changed how the operating system is provided to Chroot (API change).Joey Hess
* Where before debootstrapped and bootstrapped took a System parameter, the os property should now be added to the Chroot. * Follow-on change to Systemd.container, which now takes a System parameter. Two motivations for this change: 1. When using ChrootTarball, there may be no particular System that makes sense for the contents of the tarball, so don't force the user to specify one. 2. When creating a chroot for a disk image with the same properties as an existing Host, using hostProperties host to get them, this allows inheriting the os property from the host, and doesn't require it to be redundantly passed to Chroot.debootstrapped.
2015-10-20haddocksJoey Hess
2015-10-20Chroot: Converted to use a ChrootBootstrapper type classJoey Hess
So other ways to bootstrap chroots can easily be added in separate modules. (API change)
2015-10-18fix typo: propigate → propagateFelix Gruber
2015-10-14fileProperty, and properties derived from it now write the new file content ↵Joey Hess
via origfile.propellor-new~, instead of to a randomly named temp file. This allows them to clean up any temp file that may have been left by an interrupted run of propellor. Also converted the new isSymlinkedTo property to use the same implementation, with some simplifications.
2015-10-10propellor spinJoey Hess
2015-10-10propellor spinJoey Hess
2015-10-10Improved documentation, particularly of the Propellor module.Joey Hess
This involved some code changes, including some renaming of instance methods. (ABI change)
2015-09-06Added Propellor.Property.Rsync. WIP; untestedJoey Hess
Convert Info to use Data.Dynamic, so properties can export and consume info of any type that is Typeable and a Monoid, including data types private to a module. (API change) Thanks to Joachim Breitner for the idea.
2015-08-31Update for Debian systemd-container package split.Joey Hess
2015-07-13clarifyJoey Hess
2015-07-05Systemd.masked propertySean Whitton
This property masks, and when reverted unmasks, systemd services. This is just `systemctl mask service` and `systemctl unmask service`. It's useful for turning off a system service that you intend to run with --user. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
2015-06-02wordingJoey Hess
2015-06-02fix exampleJoey Hess