diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-10-14 13:10:07 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-10-14 13:10:07 -0400 |
| commit | 037d287a3a383471edbcd4cf8f490fc4027b67b7 (patch) | |
| tree | f82c33311ae7a1731a329d40f7643ebed0d60c7b /src/Propellor/Property/Systemd.hs | |
| parent | bbb0386515365b6735a9e635baa38fe762c951ef (diff) | |
fileProperty, and properties derived from it now write the new file content 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.
Diffstat (limited to 'src/Propellor/Property/Systemd.hs')
| -rw-r--r-- | src/Propellor/Property/Systemd.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs index 8194fc85..a93c48bc 100644 --- a/src/Propellor/Property/Systemd.hs +++ b/src/Propellor/Property/Systemd.hs @@ -254,8 +254,9 @@ nspawnService (Container name _ _) cfg = setup <!> teardown <$> servicefilecontent <*> catchDefaultIO "" (readFile servicefile) - writeservicefile = property servicefile $ makeChange $ - viaTmp writeFile servicefile =<< servicefilecontent + writeservicefile = property servicefile $ makeChange $ do + c <- servicefilecontent + File.viaStableTmp (\t -> writeFile t c) servicefile setupservicefile = check (not <$> goodservicefile) $ -- if it's running, it has the wrong configuration, |
