Closed iilyak closed 6 years ago
following worked
test:
tasks:
task1
task2
task1:
command: echo task1
task2:
command: nohup alfred -no-formatting task3 > /dev/null 2>&1 &
exit: 0
task3:
command: sleep 100 && echo task3
Now I need to invent a way to implement stop
command. Probably would have to rely on a pid file.
Just curious but why do you want to run it in the background?
On Fri, Jul 27, 2018, 9:00 AM iilyak notifications@github.com wrote:
Now I need to invent a way to implement stop command. Probably would have to rely on a pid file.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kcmerrill/alfred/issues/85#issuecomment-408445319, or mute the thread https://github.com/notifications/unsubscribe-auth/AAqMSVUxTYL4OLZUyoz9eqUsxt5SAGzzks5uKyscgaJpZM4VjJ-Y .
There are a bunch of other considerations that you might need to account for. Either way, you can use nohop for example, or check out another tiny project of mine kj on my GitHub repos.
On Fri, Jul 27, 2018, 9:10 AM Casey M. kcmerrill@gmail.com wrote:
Just curious but why do you want to run it in the background?
On Fri, Jul 27, 2018, 9:00 AM iilyak notifications@github.com wrote:
Now I need to invent a way to implement stop command. Probably would have to rely on a pid file.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kcmerrill/alfred/issues/85#issuecomment-408445319, or mute the thread https://github.com/notifications/unsubscribe-auth/AAqMSVUxTYL4OLZUyoz9eqUsxt5SAGzzks5uKyscgaJpZM4VjJ-Y .
I ended up using nohop
to start process and pgrep -f "alfred -no-formatting task_name
pwd"
.
By passing pwd
I can make sure I reliably find the pid of a running process.
I am using alfred to start development environment. My development environment includes few long running processes which need to stay running after
alfred start
finishes. I am sure I am doing something wrong.I am trying to do something like the following