SIGHUP sent using ansible ?

1,591 views
Skip to first unread message

Alainkr

unread,
Oct 15, 2014, 7:39:08 AM10/15/14
to ansible...@googlegroups.com
Hello,

I'm very puzzled by the following: 

using regular ssh I'm not getting SIGHUP at the end.
using ansible SIGHUP get's sent  : strace output : 

0x7f34a666c9d0, tls=0x7f34a666c700, child_tidptr=0x7f34a666c9d0) = 600
futex(0x7f34a666c9d0, FUTEX_WAIT, 600, NULL) = ? ERESTARTSYS (To be restarted)
--- SIGHUP (Hangup) @ 0 (0) ---
+++ killed by SIGHUP +++ 

This is using an adhoc commands such  :
-m shell -a "sudo /etc/init.d/myservice start"
-m shell -a "/etc/init.d/myservice start" -s
-m shell -a "/etc/init.d/myservice start" -s -c ssh

I've tried -c ssh but behavior is unchanged.
I'm aware of the service module. But this is just an example.
The funny thing is that when using the service module no SIGHUP gets send 

My shell (bash)  has "huponexit       off" off couse.

What is happening here ? Is this the excepted behavior ?

I'm using ansible (1.7.1) paramiko (1.15.0) ( upgraded paramiko to  (1.15.1)  same result ) 

Thanks for your help. I'm kind of lost on this.

Alain
 


John Favorite

unread,
Oct 15, 2014, 10:03:29 AM10/15/14
to ansible...@googlegroups.com
My guess would be the fire and forget nature of using the shell command. If you ran '/usr/sbin/myprogram -C /etc/myconfig/myprogram.conf' it would die on exit. I'm curious why you need it instead of just doing:

- service: name=httpd state=started




--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/90ade591-bcd1-4913-b622-9f74d17c8430%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Scott Sturdivant

unread,
Oct 15, 2014, 10:14:21 AM10/15/14
to ansible...@googlegroups.com
FWIW, I too saw SIGHUPs as noted in this issue:  https://github.com/ansible/ansible/issues/3063

My resolution?  I just patched supervisord to handle it better (now fixed in later releases), so your best bet may to find a workaround.

Alainkr

unread,
Oct 17, 2014, 1:01:16 PM10/17/14
to ansible...@googlegroups.com
Yes I've seen the same issues. I think there's something doing on here. There's a similar post in this forum here : https://groups.google.com/d/msg/ansible-project/wf-UOtPOuKk/og0hVgL4xOoJ

So supervisord is not the issue there. How it is possible use ssh directly the -c ssh didn't quite helpful.

Thanks

Florian Gysin

unread,
Jan 8, 2015, 4:27:30 AM1/8/15
to ansible...@googlegroups.com
I seem to have the same issue when trying to start Weblogic server instances via the shell command (I have to use that for complicated reasons).
After successfully starting the server Ansible sends a SIGHUP and the server shuts down again. :(

Tomasz Kontusz

unread,
Jan 8, 2015, 1:24:41 PM1/8/15
to ansible...@googlegroups.com
Try sudo /etc/init.d/myservice start && sleep 2. Some services don't isolate themselves properly on time.
Ansible drops the ssh session the millisecond it's not needed anymore, so those service might catch a SIGHUP.

Florian Gysin <fl...@bluewin.ch> napisał:

--
Wysłane za pomocą K-9 Mail.

Florian Gysin

unread,
Jan 9, 2015, 4:09:35 AM1/9/15
to ansible...@googlegroups.com
I resorted to calling nohup myservice which solved the problem, although I'll give the sleep a try as well.
Reply all
Reply to author
Forward
0 new messages