Deploy to the handset from the cluster
CI builds an arm64 image (compositor, host, chandra-remote, modules) and deploys the updater pod that installs it on the phone. chandra-remote updates go in live (SIGUSR2 restarts it in place); the compositor waits for an idle, locked phone or an approval, and a locked session restarts locked. Host tests: the launcher no longer draws its label in a narrow panel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d2e00b4658
commit
2aa3de5741
14 files changed
+675
-2
No files matched your search
@@ -21,12 +21,19 @@
|
||||
|
||||
static volatile sig_atomic_t g_running = 1;
|
||||
static volatile sig_atomic_t g_reload = 0;
|
||||
static volatile sig_atomic_t g_reexec = 0;
|
||||
|
||||
static void on_term(int sig) {
|
||||
(void)sig;
|
||||
g_running = 0;
|
||||
}
|
||||
|
||||
static void on_usr2(int sig) {
|
||||
(void)sig;
|
||||
g_reexec = 1;
|
||||
g_running = 0;
|
||||
}
|
||||
|
||||
static void on_hup(int sig) {
|
||||
(void)sig;
|
||||
g_reload = 1;
|
||||
@@ -740,6 +747,11 @@ int main(int argc, char **argv) {
|
||||
signal(SIGINT, on_term);
|
||||
signal(SIGTERM, on_term);
|
||||
signal(SIGHUP, on_hup);
|
||||
/* SIGUSR2: restart in place from the installed binary (an update), same pid and arguments. */
|
||||
char self_path[512];
|
||||
ssize_t self_len = readlink("/proc/self/exe", self_path, sizeof self_path - 1);
|
||||
self_path[self_len > 0 ? self_len : 0] = 0;
|
||||
if (self_path[0]) signal(SIGUSR2, on_usr2);
|
||||
|
||||
/* Record PID for `chandra-remote status` / `passwd`. */
|
||||
{
|
||||
@@ -870,6 +882,12 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
pthread_mutex_unlock(&app.osk_mu);
|
||||
ctl_close(&app.ctl);
|
||||
if (g_reexec) {
|
||||
fprintf(stderr, "chandra-remote: restarting for an update\n");
|
||||
close_range(3, ~0U, CLOSE_RANGE_CLOEXEC); /* clients' sockets too: they reconnect */
|
||||
execv(self_path, argv);
|
||||
fprintf(stderr, "chandra-remote: exec %s: %s\n", self_path, strerror(errno));
|
||||
}
|
||||
unlink(pid_path);
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user