https://prefect.io logo
e

Esdras Lopes Nani

09/09/2022, 7:51 PM
Hey everyone. I'm having some issues with a local agent in linux AWS-EC2. I've started it using
prefect agent start -q 'queue_name' &
(observe the '&' indicator to run it in background), but once I close my remote terminal the agent is killed. If I keep my terminal open the agent don't die. Is it a current bug, am I doing something wrong or is it the normal behavior? Thanks!
βœ… 1
c

Cole Murray

09/09/2022, 7:54 PM
Hello Esdras, This is normal behavior for linux. This occurs because the user you used to create the process still owns it, and upon disconnection the OS will kill the backgrounded process. There is two ways to resolve this, depending on if you need access to the process later: a) no access needed - Type β€œdisown” after backgrounding the task b) access needed - Use screen/tmux
πŸ™Œ 2
c

Christopher Boyd

09/09/2022, 8:34 PM
are you trying to run this in the foreground or as a daemon service ? If you want to run it as a daemon , you can configure it as a service in systemd
πŸ™Œ 1
We have some recipes in infrastructure / DevOps folders in prefect-recipes - https://github.com/PrefectHQ/prefect-recipes
n

Nate

09/11/2022, 3:49 PM
in case this is helpful!
πŸ™Œ 1
e

Esdras Lopes Nani

09/13/2022, 4:10 AM
Thanks @Christopher Boyd and @Nate, systemd worked the way that I was looking for! (Windows user here! πŸ˜…) @Cole Murray the screen workaround worked as well!
πŸ™Œ 2
3 Views