Quantcast

Bug#857607: apache2.logrotate: don't invoke /etc/init.d/apache2 in postrotate script

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bug#857607: apache2.logrotate: don't invoke /etc/init.d/apache2 in postrotate script

Sergio Gelato
Package: apache2
Version: 2.4.25-3

Now that apache2 includes a native systemd unit, it may be prudent to stop assuming that /etc/init.d/apache2 exists. (It's still distributed as part of the package, but since it's a configuration file system administrators are free to delete it.)

The postrotate script in /etc/logrotate.d/apache2 invokes /etc/init.d/apache2 directly; according to section 9.3.3 of the Debian policy it should be using invoke-rc.d instead.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bug#857607: apache2.logrotate: don't invoke /etc/init.d/apache2 in postrotate script

Stefan Fritsch
On Monday, 13 March 2017 08:07:01 CET Sergio Gelato wrote:
> Now that apache2 includes a native systemd unit, it may be prudent to stop
> assuming that /etc/init.d/apache2 exists. (It's still distributed as part
> of the package, but since it's a configuration file system administrators
> are free to delete it.)

True.

>
> The postrotate script in /etc/logrotate.d/apache2 invokes
> /etc/init.d/apache2 directly; according to section 9.3.3 of the Debian
> policy it should be using invoke-rc.d instead.

That section only talks about the package scripts (postinst, etc.). I don't
think it is applicable for logrotate scripts.

The reason I didn't use invoke-rc.d is that it obeys runlevel constraints,
which is not wanted in the logrotate script. But it seems invoke-rc.d has this
limitation only for "start", not for "status" and "reload". So switching to
invoke-rc.d should be fine.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bug#857607: apache2.logrotate: don't invoke /etc/init.d/apache2 in postrotate script

Sergio Gelato
* Stefan Fritsch [2017-03-13 22:14:23 +0100]:

> On Monday, 13 March 2017 08:07:01 CET Sergio Gelato wrote:
> > The postrotate script in /etc/logrotate.d/apache2 invokes
> > /etc/init.d/apache2 directly; according to section 9.3.3 of the Debian
> > policy it should be using invoke-rc.d instead.
>
> That section only talks about the package scripts (postinst, etc.). I don't
> think it is applicable for logrotate scripts.
>
> The reason I didn't use invoke-rc.d is that it obeys runlevel constraints,
> which is not wanted in the logrotate script. But it seems invoke-rc.d has this
> limitation only for "start", not for "status" and "reload". So switching to
> invoke-rc.d should be fine.

What about the policy-rc.d mechanism? Is it wanted or unwanted in this case?

An alternative, if invoke-rc.d really is unsuitable, would be to use service.

Loading...