I am trying to create a task in ansible which executes a shell command to run an executable in daemon mode using &. Something like following
-name: Start daemon
shell: myexeprogram arg1 arg2 &
What am seeing is if I keep & the task returns immediately and the process is not started . If I remove & ansible task waits for quite some time without returning.
Appreciate suggestion on proper way to start program in daemon mode through ansible. Pls note that I dont want to run this as a service but an adhoc background process based on certain conditions.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…