mirror of
https://github.com/getcompanion-ai/computer-guest.git
synced 2026-04-15 04:03:25 +00:00
feat: phase 1
This commit is contained in:
parent
2b2ece6778
commit
c74c1a676c
2 changed files with 27 additions and 1 deletions
|
|
@ -38,6 +38,7 @@ cleanup() {
|
|||
[ -n "${ready_agent_pid:-}" ] && kill "$ready_agent_pid" >/dev/null 2>&1 || true
|
||||
[ -n "${sshd_pid:-}" ] && kill "$sshd_pid" >/dev/null 2>&1 || true
|
||||
[ -n "${desktop_pid:-}" ] && kill "$desktop_pid" >/dev/null 2>&1 || true
|
||||
[ -n "${guestd_pid:-}" ] && kill "$guestd_pid" >/dev/null 2>&1 || true
|
||||
wait >/dev/null 2>&1 || true
|
||||
exit 0
|
||||
}
|
||||
|
|
@ -75,6 +76,13 @@ start_desktop() {
|
|||
desktop_pid=$!
|
||||
}
|
||||
|
||||
start_guestd() {
|
||||
reap_if_needed "${guestd_pid:-}"
|
||||
log "starting guestd on 49983"
|
||||
/usr/local/bin/microagent-guestd >>/var/log/guestd.log 2>&1 &
|
||||
guestd_pid=$!
|
||||
}
|
||||
|
||||
trap cleanup INT TERM
|
||||
|
||||
log "bringing up guest network"
|
||||
|
|
@ -125,6 +133,7 @@ fi
|
|||
start_ready_agent
|
||||
start_sshd
|
||||
start_desktop
|
||||
start_guestd
|
||||
|
||||
while true; do
|
||||
if ! pid_running "${ready_agent_pid:-}"; then
|
||||
|
|
@ -139,5 +148,9 @@ while true; do
|
|||
log "desktop session exited; restarting"
|
||||
start_desktop
|
||||
fi
|
||||
if ! pid_running "${guestd_pid:-}"; then
|
||||
log "guestd exited; restarting"
|
||||
start_guestd
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue