reconnects not exported from deployment.lisp
Andreas Reuleaux
rx at a-rx.info
Fri Aug 5 17:59:14 BST 2022
Sean Whitton <spwhitton at spwhitton.name> writes:
> Hello,
>
> On Fri 05 Aug 2022 at 11:18am +01, Andreas Reuleaux wrote:
>
>> (defprop moc-config-symlinked :posix ()
>> (:desc #?"moc config symlinked")
>> (:apply
>> (file:symlinked :from ".moc/config"
>> :to #?"${(get-connattr :remote-home)}cfg/moc/config"
>> )
>> )
>> )
>
> This one can be
>
> (defproplist moc-config-symlinked :posix ()
> (:desc "moc config symlinked")
> (file:symlinked :from ".moc/config"
> :to #?"${(get-connattr :remote-home)}cfg/moc/config"))
>
Hi again,
I am sorry, but I have tried: personally I don't care, if
moc-config-symlinked is a single property (defprop), or a list of
properties (defproplist), but the (get-connattr :remote-home) is
rejected in the latter case:
(asdf:load-system "my.consfig") (in-package :my.consfig)
T
* #<PACKAGE "MY.CONSFIG">
(deploy-these ((:ssh :user "root")) softland (moc-combined))
debugger invoked on a SB-PCL::NO-APPLICABLE-METHOD-ERROR in thread
#<THREAD "main thread" RUNNING {1004E00073}>:
There is no applicable method for the generic function
#<STANDARD-GENERIC-FUNCTION CONSFIGURATOR:CONNECTION-CONNATTR (11)>
when called with arguments
(NIL :REMOTE-HOME).
See also:
The ANSI Standard, Section 7.6.6
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [RETRY] Retry calling the generic function.
1: [ABORT] Exit debugger, returning to top level.
((:METHOD NO-APPLICABLE-METHOD (T)) #<STANDARD-GENERIC-FUNCTION CONSFIGURATOR:CONNECTION-CONNATTR (11)> NIL :REMOTE-HOME) [fast-method]
0]
>> It would nevertheless be nice to have just one combined task:
>> moc-combined, deployed as root, which internally does both of the
>> above task:
>>
>> make sure, moc is installed - as root
>> do the symlinking - temporarily becoming rx for that matter
>>
>> And I have succeeded in doing so: either with:
>>
>>
>> (defproplist moc-combined :posix ()
>> (apt:installed "moc")
>>
>> (reconnects '((:setuid :user "rx"))
>> (make-propspec :propspec `(moc-config-symlinked)
>> ))
>> )
>
> You can just use AS, which chooses between :SU and :SETUID for you.
>
> (defproplist moc-combined :posix ()
> (apt:installed "moc")
> (as "rx" (moc-config-symlinked)))
...So I stick with the defprop for now (as I want indeed the remote home in
my :to path: /home/rx/... - fine with (defprop moc-config-symlinked ...)
(Is there a reason, why I cannot use (get-connattr :remote-home) in the
defproplist version ?)
I think I had tried "as" before, too - but I am giving it another shot:
(defprop moc-config-symlinked :posix ()
(:desc #?"moc config symlinked")
(:apply
(file:symlinked :from ".moc/config"
:to #?"${(get-connattr :remote-home)}cfg/moc/config"
)
)
)
(defproplist moc-combined :posix ()
(apt:installed "moc")
(as "rx" (moc-config-symlinked))
)
And apparently, this works, if I use :sbcl in my chain - so
yes, thanks!
(asdf:load-system "my.consfig") (in-package :my.consfig)
;;; Computing Hangul syllable names
T
* #<PACKAGE "MY.CONSFIG">
(deploy-these ((:ssh :user "root") :sbcl) softland (moc-combined))
;; Waiting for remote Lisp to exit, this may take some time ... done. Output was:
;; softland :: apt installed moc ... ok
;; softland :: moc config symlinked ... done
;; softland :: ((:AS :USER "rx")) reconnection ... done
;; softland :: done
;; Changes were made without any reported failures.
NIL
*
If I don't use :sbcl, the error message was a little cryptic to me,
not really pointing me in the right direction
(and maybe there is even some old cached stuff in there [?]: I have
commented all reconnects code)
(asdf:load-system "my.consfig") (in-package :my.consfig)
;;; Computing Hangul syllable names
T
* #<PACKAGE "MY.CONSFIG">
(deploy-these ((:ssh :user "root")) softland (moc-combined))
debugger invoked on a SB-INT:SIMPLE-PROGRAM-ERROR in thread
#<THREAD "main thread" RUNNING {1004E00073}>:
invalid keyword argument: :USER (valid keys are :TO).
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [SKIP-PROPERTY] Skip (RECONNECTS ((:AS :USER "rx")) (:HOST
#<CONSFIGURATOR::PREPROCESSED-HOST {100250EEA3}>
:PROPSPEC
#<CONSFIGURATOR::UNPREPROCESSED-PROPSPEC {100250DBD3}>))
1: [SKIP-SEQUENCE] Skip remainder of sequence containing (RECONNECTS ((:AS
:USER
"rx")) (:HOST
#<CONSFIGURATOR::PREPROCESSED-HOST {100250EEA3}>
:PROPSPEC
#<CONSFIGURATOR::UNPREPROCESSED-PROPSPEC {100250DBD3}>))
2: Skip (MOC-COMBINED)
3: Skip remainder of sequence containing (MOC-COMBINED)
4: [ABORT ] Exit debugger, returning to top level.
(SB-INT:%PROGRAM-ERROR "~@<invalid keyword argument~P: ~{~S~^, ~} (valid keys are ~{~S~^, ~}).~@:>" 1 (:USER) (:TO))
0]
I am debian testing by the way.
Anyway thanks a lot.
-A
More information about the sgo-software-discuss
mailing list