[CentOS] logrotate.d - reload vs restart

Nico Kadel-Garcia nkadel at gmail.com
Mon Dec 27 21:31:29 UTC 2010


On Mon, Dec 27, 2010 at 2:24 PM, Frank Cox <theatre at sasktel.net> wrote:
> On Mon, 27 Dec 2010 10:40:48 -0800
> Bill Campbell wrote:
>
>> 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.
>
> "reload" doesn't appear to be recognized as a command line option with
> the /sbin/service command, as seen here:
>
> # /sbin/service privoxy reload  2> /dev/null || true
> Usage: /etc/init.d/privoxy {start|stop|restart}
>
> Does that vary between what /sbin/service is trying to reload?

*/sbin/service* is working fine. It's just a shell script that finds
and passes arguments to the init scripts in /etc/rc.d/init.d/.
(/etc/init.d is a symlink to /etc/rc.d/init.d: don't be confused by
that.)

If the init script supports reload, then service will successfully
pass the argument to it. If it doesn't support reload, such as the
"privoxy" script in this case does not, then you'll need  to use
start, stop, or restart.

Some init scrupts have much more useful useful options, such as
"configtest" from some Apache init scripts.

>> 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.
>
> This came up because I'm trying to figure out why privoxy crashes overnight
> sometimes (and not at other times of the day).  It occurred to me that perhaps
> some of the jiggery-pokery involved in the logrotate business might be at the
> root of the issue.
>
> --
> MELVILLE THEATRE ~ Melville Sask ~ www.melvilletheatre.com
> www.creekfm.com - FIFTY THOUSAND WATTS of POW WOW POWER!
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>



More information about the CentOS mailing list