git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-credential-cache--daemon quits on SIGHUP, can we change it to ignore instead?

From
Noam Postavsky <npostavs@users.sourceforge.net>
Date
Oct 27, 2015, 00:50 UTC
Message-ID
<CAM-tV--80xt_Ro_vQdgRmRxfy+2k2Ca13gVsjDHK+1pdsB_hqQ@mail.gmail.com>
In-Reply-To
<20151026215016.GA17419@sigill.intra.peff.net>
On Mon, Oct 26, 2015 at 5:50 PM, Jeff King wrote:
> But these days, people often have several simultaneous sessions open.
> They may have multiple ssh sessions to a single machine, or they may
> have a bunch of terminal windows open, each of which has a login shell
> and will send HUP to its children when it exits.
Yes, except that as far as I can tell the shell never sends HUP.
> This is all further complicated by bash's huponexit option, which I
> think is off by default. So I, for example, have never noticed this
> behavior even with multiple xterms, because my cache never actually gets
> SIGHUP.

Interesting, I was not aware of this option. I tried enabling it, but I see no difference, the daemon still receives no SIGHUP. Could it be a bug in my version of bash?

GNU bash, version 4.3.42(1)-release (x86_64-pc-linux-gnu)

Ah, it seems I'm not the only one: (Raphael Ahrens at http://unix.stackexchange.com/a/85296/47926)

    Bash seems to send the SIGHUP only if it self received a SIGHUP[...]
    So if you type exit or press Ctrl+D all background process will
remain, since this does not send a hang up signal to the Bash.
    [...]
    There is an option to send the SIGHUP on exit, but it does not
work on my Bash 4.2.25. Maybe it works for you
> I don't know what shell Noam is using, but I wonder if tweaking
> that option (or a similar one if not bash) might be helpful to signal
> "let this stuff keep running even after I exit".

My normal login shell is zsh, but I've been testing with bash and I see the same behaviour with both. But the original reason for this whole thread is that when running from Emacs (not via shell), the daemon *always* get a SIGHUP as soon as "git push" finishes, which makes the caching thing not so useful. We do have a workaround for this by now though (start the daemon independently before calling "git push").

Previous: Jeff KingNext: Jeff King
Message 9 of 29 in “git-credential-cache--daemon quits on SIGHUP, can we change it to ignore instead?”
  1. Noam PostavskyOct 10, 2015
  2. Noam PostavskyOct 18, 2015
  3. Junio C HamanoOct 18, 2015
  4. Noam PostavskyOct 19, 2015
  5. Noam PostavskyOct 21, 2015
  6. Noam PostavskyOct 24, 2015
  7. Junio C HamanoOct 25, 2015
  8. Jeff KingOct 26, 2015
  9. Noam PostavskyOct 27, 2015
  10. Jeff KingOct 27, 2015
  11. Junio C HamanoOct 27, 2015
  12. Junio C HamanoOct 27, 2015
  13. Jeff KingOct 27, 2015
  14. Noam PostavskyOct 28, 2015
  15. Jeff KingOct 30, 2015
  16. Noam PostavskyOct 30, 2015
  17. Jeff KingOct 30, 2015
  18. Noam PostavskyOct 30, 2015
  19. Jeff KingOct 30, 2015
  20. Noam PostavskyNov 9, 2015
  21. Jeff KingNov 9, 2015
  22. Noam PostavskyNov 10, 2015
  23. Jeff KingNov 10, 2015
  24. Jeff KingNov 10, 2015
  25. Noam PostavskyNov 11, 2015
  26. Junio C HamanoDec 4, 2015
  27. Jeff KingDec 4, 2015
  28. Junio C HamanoDec 4, 2015
  29. Jeff KingDec 4, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.