I am trying to create a Property to install (and configure) gitlab through Propellor. To perform the installation and configuration I am using Apt.installed and Apt.reConfigure. When ever Propellor has to go though configuration of the package it «fails» (cf. bug report on gitlab package : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=886657
Awaiting a resolution of the bug itself, a workaround would be to perform the apt-get install or dpkg-reconfigure from a «world-readable» directory (such as /tmp or /etc or ...). Currently these properties are executed with CWD eing the propellor repository.
I have looked for, but not found yet, a way to perform the work of this property within a specific directory.
Thanks in advance for any help or pointers,
Serge.
Since propellor can run multiple properties at the same time (Propellor.Property.Concurrent), setting the CWD while running a property is probably not a good idea, as it would affect any other property that's currently running. Might be possible to fork and set CWD, but haskell is not great at supporting fork w/o exec.
Instead, the best way to do it is to use
createProcess
with{cwd = whatever}
when your property runs apt and dpkg-reconfigure. See Property.DnsSec.forceZoneSigned for an example.Hi again,
Thanks for the swift answer. As I am not (yet ?-) an expert of either Haskell or Propellor I'd prefer to be sure before going further. Your proposal is to somehow «copy» the machinery of Apt.installed and Apt.reConfigure but using this time «createProcess with {cwd = whatever}». And I should find useful examples/snippets to implement this in the Property.DnsSec.forceZoneSigned sources.
If I manage that I'll definitely propose a contribution on it
By the way, thanks for the complete system. As often elegance comes with a great quality of use !
Serge.
That is what I was suggesting yes.
Another way to do it is using
cmdProperty'
, for example: