aim icon indicating copy to clipboard operation
aim copied to clipboard

How can I run Aim in the background?

Open Gerenuk opened this issue 2 years ago • 1 comments

❓Question

I'd like to open the Aim interface from a bash script together alongside commands. What is the recommended way to do that?

There is no "background" option in Aim. I could try to use bash "aim up &", but I'm not sure how to handle that in my script and close Aim later. I tried to catch the PID by "$!" and "kill" but it seems to leave abandoned "python" processes.

Gerenuk avatar Aug 29 '22 11:08 Gerenuk

hey @Gerenuk! Thanks for the question. aim up & is the way to go, but unfortunately we're spawning the uvicorn server as a separate process, so you'll need to kill that process instead to not leave any hanging processes behind. To find the id of that process you'll need to use pgrep -P PID command. May I ask you to provide a little bit more information about your setup and why do you need to open the Aim UI in the background?

mihran113 avatar Aug 29 '22 22:08 mihran113

I recommend using a screen instance: e.g.:

screen -RS aim

# screen opens
aim up
# press ctrl+a, then press d
# screen is now in background

screen -r aim
# now back to aim window
# press ctrl-c
# aim is terminating
exit
# screen is now closed

hope this helps.

Pyrestone avatar Sep 22 '22 20:09 Pyrestone