diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-22 09:38:57 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-22 09:38:57 -0700 |
commit | f393eeebe8cf6a31ecc2160658bee3d2c895a98b (patch) | |
tree | b6c85fc026ffafc58f3c1479efadebb8ba699934 /src/property/service.lisp | |
parent | 2063385338300dfb11cd1a681ba0ca9e7b1aaf37 (diff) | |
download | consfigurator-f393eeebe8cf6a31ecc2160658bee3d2c895a98b.tar.gz |
untabify
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/service.lisp')
-rw-r--r-- | src/property/service.lisp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/property/service.lisp b/src/property/service.lisp index badf5b9..1d7a334 100644 --- a/src/property/service.lisp +++ b/src/property/service.lisp @@ -62,29 +62,29 @@ properties." "Apply PROPAPPS with SERVICE:NO-SERVICES temporarily in effect." (let ((propapp (if (cdr propapps) (eseqprops propapps) (car propapps)))) (:retprop :type :lisp - :hostattrs - (lambda () (propappattrs propapp) (os:required 'os:debianlike)) - :apply - (lambda (&aux (already-exists (file-exists-p +policyrcd+))) - (with-remote-temporary-file (temp :directory "/usr/sbin") - (when already-exists - (rename-file +policyrcd+ temp)) - (%policy-rc.d) - (let ((before (get-universal-time))) - ;; Sleep for one second so that we know BEFORE is in the - ;; past. (SLEEP 1) is only approximately one second so - ;; check that it's actually been a second. - (loop do (sleep 1) until (> (get-universal-time) before)) - (unwind-protect - (with-preserve-hostattrs - (push-hostattrs :no-services t) - (propappapply propapp)) - (if already-exists - ;; Check whether some property we applied set the - ;; contents of /usr/sbin/policy-rc.d, in which case - ;; we won't restore our backup. - (unless (> (file-write-date +policyrcd+) before) - (rename-file temp +policyrcd+)) - (when (file-exists-p +policyrcd+) - (delete-file +policyrcd+))))))) - :unapply (lambda () (propappunapply propapp))))) + :hostattrs + (lambda () (propappattrs propapp) (os:required 'os:debianlike)) + :apply + (lambda (&aux (already-exists (file-exists-p +policyrcd+))) + (with-remote-temporary-file (temp :directory "/usr/sbin") + (when already-exists + (rename-file +policyrcd+ temp)) + (%policy-rc.d) + (let ((before (get-universal-time))) + ;; Sleep for one second so that we know BEFORE is in the + ;; past. (SLEEP 1) is only approximately one second so + ;; check that it's actually been a second. + (loop do (sleep 1) until (> (get-universal-time) before)) + (unwind-protect + (with-preserve-hostattrs + (push-hostattrs :no-services t) + (propappapply propapp)) + (if already-exists + ;; Check whether some property we applied set the + ;; contents of /usr/sbin/policy-rc.d, in which case + ;; we won't restore our backup. + (unless (> (file-write-date +policyrcd+) before) + (rename-file temp +policyrcd+)) + (when (file-exists-p +policyrcd+) + (delete-file +policyrcd+))))))) + :unapply (lambda () (propappunapply propapp))))) |