Hey everyone. I'm having some issues with a local ...
# prefect-community
e
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
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
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
in case this is helpful!
πŸ™Œ 1
e
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