SIGHUP signal

Kevin Korb kmk at sanitarium.net
Sat Feb 15 18:26:28 MST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Except that rsyncd can also run via an ssh session.  Programs that do
so are supposed to exit when they receive a HUP signal.

On 02/15/2014 07:47 PM, Perry Hutchison wrote:
> Paul Slootman <paul+rsync at wurtel.net> wrote:
> 
>> On Sat 15 Feb 2014, Perry Hutchison wrote:
>>> Hiroyuki Ikegami <ikegam at mixallow.net> wrote:
>>>> 2014-02-15 7:39 GMT+09:00 Grozdan <neutrino8 at gmail.com>:
>>>>> Yesterday, I changed my rsyncd.conf file to add one more
>>>>> module to it. Then I sent a kill -HUP $pid signal to rsync
>>>>> running in daemon mode, but what gives? It just died so I
>>>>> had to start it up again. I though sending a HUP would just
>>>>> make it reload its config file, no?
>>>> 
>>>> Many softwares catches SIGHUP as a trigger to reload
>>>> configurations. But it is a kind of software design. If the
>>>> programmer does not want to write signal handling code, the
>>>> programs received HUP just dies.
>>> 
>>> This really ought to go on the to-do list.  It is a very 
>>> longstanding convention that a daemon should reinitialize
>>> itself (for some reasonable definition of reinitialize) upon
>>> receiving a SIGHUP.
>> 
>> Why should the code be modified to help those that don't read the
>> docs properly?
>> 
>> From the rsyncd.conf manpage:
>> 
>> Note that you should not send the rsync daemon a HUP signal to
>> force it to reread the rsyncd.conf file. The file is re-read on
>> each client con- nection.
> 
> Because "kill -HUP" after editing a config file is a standard 
> administrative workflow.  Google "Principle Of Least
> Astonishment".
> 
> Since rsyncd already reinitializes itself on each connection, all 
> that's needed is for it to ignore SIGHUP:
> 
> #include <signal.h> ... signal(SIGHUP, SIG_IGN);
> 

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
	Kevin Korb			Phone:    (407) 252-6853
	Systems Administrator		Internet:
	FutureQuest, Inc.		Kevin at FutureQuest.net  (work)
	Orlando, Florida		kmk at sanitarium.net (personal)
	Web page:			http://www.sanitarium.net/
	PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlMAE8QACgkQVKC1jlbQAQcQQQCbBTUOpGLjyalLptHXTyhTv566
tNQAoPng47uLVCsyeGe9HGDSLXoWtNKP
=YLiI
-----END PGP SIGNATURE-----


More information about the rsync mailing list