aboutsummaryrefslogtreecommitdiff
path: root/src/connection.lisp
Commit message (Collapse)AuthorAge
* convert some internal shell snippets to single linesSean Whitton2022-06-27
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* rename RUN-FAILED accessorsSean Whitton2022-04-02
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* rename READFILE, WRITEFILE, corresponding generics and some wrappersSean Whitton2022-04-02
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* rename CONNECTION-TEARDOWN -> CONNECTION-TEAR-DOWNSean Whitton2022-04-02
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* rename DEFINE-PRINT-OBJECT-FOR-STRUCTLIKE & REINIT-STRUCTLIKESean Whitton2022-03-12
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* replace ESCAPE-SH-TOKEN and ESCAPE-SH-COMMAND with new SH-ESCAPESean Whitton2022-03-11
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add "local" and "remote" to the names of some exported symbolsSean Whitton2022-03-09
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* rename :XDG-CACHE-HOME connattr to :XDG_CACHE_HOMESean Whitton2021-10-23
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* replace some functions with a new :CONSFIGURATOR-CACHE connattrSean Whitton2021-10-23
| | | | | | This simplifies the API. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* RUN/MRUN: support unsetting environment variables tooSean Whitton2021-10-23
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* find XDG_CACHE_HOME without relying on HOMESean Whitton2021-10-23
| | | | | | | | | | CONNECTION-CONNATTR for :REMOTE-HOME avoids relying on the HOME environment variable having the correct value; its docstring describes a case in which HOME's value can be incorrect. As determining :XDG-CACHE-HOME depends in most cases on having the correct value for the remote home directory, don't rely on the HOME environment variable here either. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* factor out REMOTE-EXECUTABLE-FINDSean Whitton2021-10-23
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add dep on Anaphora and use APROG1, ALET & AAND in various placesSean Whitton2021-09-08
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* RUN: combine creating the temporary file with running the commandSean Whitton2021-08-31
| | | | | | Should improve performance, especially when connection latency is high. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* MKTEMP: factor out MKSTEMP-CMDSean Whitton2021-08-31
| | | | | | No functional change. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* MKTEMP: also fail if mktemp(1) outputs anything to stderrSean Whitton2021-08-31
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* RUN: at level 4, debug printing excludes the redirection of stdoutSean Whitton2021-08-31
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add CONNECTION-READFILE-AND-REMOVE to improve RUN performanceSean Whitton2021-08-31
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* cache XDG_CACHE_HOME as a connattrSean Whitton2021-08-31
| | | | | | This should provide a performance improvement. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* MOUNT:UNMOUNTED-BELOW-AND-REMOVED: don't unmount DIR itselfSean Whitton2021-08-22
| | | | | | | | | | | If DIR is itself a mount point then previously we would never delete its contents because the unmounting is done first. This meant that when MOUNT:UNMOUNTED-BELOW-AND-REMOVED was used to remove the root filesystem of a container or virtual machine, for example, then whether the contents of the root filesystem was actually deleted depended upon whether DIR happened to be a mount point. This change ensures that the deletion is always done. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* call STRING-UPCASE when converting keywords to environment variablesSean Whitton2021-07-24
| | | | | | | In case the keyword was read with the reader configured not to upcase the names of symbols. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* MKTEMP: use more complex shell command to avoid hiding stderrSean Whitton2021-07-24
| | | | | | | | | | | This replaces two recent quick fixes: 58bcd1fa4a00c35492d6886c0f729974e7028136 350be6c791db8c943b284d8e53d768a1a2a1ee50 Thanks to Mark Wooding for help developing the technique used to detect whether or not m4(1) outputted anything to stderr. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* UNWIND-PROTECT-IN-PARENT -> UNWIND-PROTECTSean Whitton2021-07-24
| | | | | | No longer needed thanks to f4e9170e73cb4bcfa7328422b4ff4f72d1339dd0. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* new approach to calling fork(2) in remote Lisp imagesSean Whitton2021-07-24
| | | | | | | | | | | Drop CAN-PROBABLY-FORK because we now only try to fork(2) in contexts in which there shouldn't ever be any other threads running, apart from Lisp implementation finaliser threads and the like. We no longer need to RESET-DATA-SOURCES before CONTINUE-DEPLOY* because we now only fork(2) in contexts in which *NO-DATA-SOURCES* is t. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* MKTEMP: avoid returning an empty stringSean Whitton2021-07-15
| | | | | | m4(1) can exit zero but fail to create a temporary file. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* MKTEMP: avoid capturing echo builtin's stderrSean Whitton2021-07-13
| | | | | | | In the case where there is no m4(1) on PATH we get "sh: 1: echo: echo: I/O error" as the first line of output. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* factor out MOUNTPOINTPSean Whitton2021-07-10
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* RUN/MRUN: drop the trailing slash when populating HOMESean Whitton2021-07-06
| | | | | | This is the usual convention for that environment variable. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add PERIODIC:AT-MOSTSean Whitton2021-06-07
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* rename REMOTE-FILE-{MODE-AND-SIZE -> STATS} & also return mtimeSean Whitton2021-06-07
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* ls(1) parse: set LC_ALL not just LOCALE, and split fields properlySean Whitton2021-06-07
| | | | | | | Previously our code assumed fields were separated with exactly one space, but sometimes there is padding. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* don't recommend RUN over MRUN in generalSean Whitton2021-05-25
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* convert CONNECTION slots to connattrs & fix finding homedirsSean Whitton2021-05-23
| | | | | | | | | | | | HOME does not take into account /etc/passwd inside the chroot, even when starting a login shell with, e.g., "chroot /chroot sh -lc 'echo $HOME'" -- we would need something which emulates login(1), like su(1), but the -c argument to su(1) is not portable. getent(1) is not POSIX. So use tilde expansion. Additionally, avoid having UPLOAD-ALL-PREREQUISITE-DATA store values for the remote UID, remote homedir etc. from *before* the chroot/setuid operation. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* separately upload, compile and load each ASDF systemSean Whitton2021-05-17
| | | | | | | | | | This avoids recompiling unchanged systems on every deploy, which makes for a decent performance boost, especially on systems with less processing power. Drop the idea of relying on distribution packages on the remote side -- we want to use the same version of the source as is running in the root Lisp. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* require debug level 4 for output for every RUN & MRUNSean Whitton2021-05-17
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* make CACHED-DATA into a connattr and push to it more consistentlySean Whitton2021-05-15
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* pass LOCALE=C to ls(1) in WRITEFILESean Whitton2021-05-06
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* FILE:HAS-CONTENT: avoid writing the file if content unchangedSean Whitton2021-05-06
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* swap order of stdout and stderr when reporting RUN-FAILEDSean Whitton2021-05-06
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* replace WITH-LOCAL-... with an EVALS propertySean Whitton2021-05-06
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add TODO about converting slots to connattrsSean Whitton2021-04-30
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add connattrsSean Whitton2021-04-30
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* CONTINUE-DEPLOY* connections: push a new connection objectSean Whitton2021-04-30
| | | | | | This is cleaner than resetting certain slot values. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* capture child stdout in case *STANDARD-OUTPUT* has been reboundSean Whitton2021-04-26
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add WITH-LOCAL-PASSWORDLESS-SUDO-CONNECTIONSean Whitton2021-04-16
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* RUN/MRUN: when :INFORM, also show the command which was runSean Whitton2021-04-12
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* reindentSean Whitton2021-04-08
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* RUN/MRUN: export each environment variable individuallySean Whitton2021-04-08
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* rename and use DELETE-REMOTE-TREE->DELETE-REMOTE-TREESSean Whitton2021-04-07
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* RUN, MRUN: add missing fresh line when :INFORMSean Whitton2021-04-04
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>