[CentOS] logrotate.d - reload vs restart
Bill Campbell
centos at celestial.com
Mon Dec 27 18:40:48 UTC 2010
On Mon, Dec 27, 2010, Frank Cox wrote:
>Looking at some of the stuff in /etc/logrotate.d, I see entries like this in
>some of the configuration files:
>
>postrotate
> /sbin/service privoxy reload 2> /dev/null || true
>
>>From the commandline, that doesn't work:
>
># /sbin/service privoxy reload 2> /dev/null || true
>Usage: /etc/init.d/privoxy {start|stop|restart}
>
>Changing reload to restart does work:
>
>]# /sbin/service privoxy restart 2> /dev/null || true
>Stopping Privoxy, OK.
>Starting Privoxy, OK.
>
>I find "reload" in the httpd logrotate file as well:
>
>postrotate
> /sbin/service httpd reload > /dev/null 2>/dev/null || true
>
>What am I failing to understand?
The reload command usually does a ``kill -HUP'' on the running
process to get it to reload its configuration files whild restart
will kill the running process and restart it which, of course,
causes it to read the configuration. The reload command should
cause the running process to close and reopen log files.
Unfortunately, not all programs properly handle the HUP command,
either not reading the configuration, not properly handling log
files, or both. Thus the restart should always work while reload
may not depending on the application.
Bill
--
INTERNET: bill at celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
Voice: (206) 236-1676 Mercer Island, WA 98040-0820
Fax: (206) 232-9186 Skype: jwccsllc (206) 855-5792
Each individual of the society has a right to be protected in the
enjoyment of his life, liberty, and property no part of the property
of any individual can, with justice, be taken from him, or applied to
public uses, without his own consent -- John Adams
More information about the CentOS
mailing list