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
Junio C Hamano <gitster@pobox.com>
Date
Oct 18, 2015, 17:58 UTC
Message-ID
<xmqqfv18awj4.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAM-tV-_eOgnhqsTFN6kKW=tcS7gAPYaxskBaxnJZo3bsx02HZg@mail.gmail.com>
Noam Postavsky <npostavs@users.sourceforge.net> writes:
Show 7 quoted lines
> On Sat, Oct 10, 2015 at 12:45 PM, Noam Postavsky
> <npostavs@users.sourceforge.net> wrote:
>> I noticed that git-credential-cache--daemon quits on SIGHUP. This
>> seems like surprising behaviour for a daemon. Would it be acceptable
>> to change it to ignore SIGHUP?
>
> ping?

Thanks for pinging. I guess this either fell in the cracks while people were busy discussing other topics, or nobody agreed with the reasoning behind the change, or perhaps a bit of both. In any case, it is a prodent thing to ping on the thread after a week or so, which is what you did. Very much appreciated.

I cannot speak for the person who was primarily responsible for designing this behaviour, but I happen to agree with the current behaviour in the situation where it was designed to be used. Upon the first use in your session, the "daemon" is auto-spawned, you can keep talking with that same instance during your session, and you do not have to do anything special to shut it down when you log out. Isn't that what happens here?

If this were "when you start the system you start this free-standing daemon once, and it will stay around until it gets shut down. If you are staying around in logged-in state is immaterial" kind of daemon, I'd expect it, upon being killed with HUP, to do something useful, like re-reading its configuration file, and continue, instead of dying.

Perhaps you can tweak the system to get both, by making it continue upon HUP by default, but teaching it an option not to (i.e. the current behaviour). Pass that option when spawn_daemon() in credential-cache.c starts the daemon. When using the daemon as a free-standing one (against the way its documentation expects you to---see "git help credential-cache--daemon"), you do not pass that option and your "daemon" will ignore HUP.

Hmm?
Previous: Noam PostavskyNext: Noam Postavsky
Message 3 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.