[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#740380: logrotate warnings when running under systemd



Package: cups
Version: 1.7.1-7
Severity: normal

The logrotate script use a pre-start script to stop the cups service and
a post-rotate script to start cups again.
Under systemd this leads to a warning, since the socket and path are still
active and could lead to having the service activated on-demand.

# invoke-rc.d cups stop
Warning: Stopping cups.service, but it can still be activated by:
  cups.socket
  cups.path


My suggestion would be to use a single post-rotate script + restart.
As cups will still have the file descriptor open, you should use the
delaycompress option, so cups can continue to write to foo.1.log

My suggestion would be something like:

diff --git a/logrotate.d/cups-daemon b/logrotate.d/cups-daemon
index d96e11d..09b7145 100644
--- a/logrotate.d/cups-daemon
+++ b/logrotate.d/cups-daemon
@@ -3,20 +3,10 @@
        missingok
        rotate 7
        sharedscripts
-       prerotate
-               if [ -e /var/run/cups/cupsd.pid ]; then
-                       invoke-rc.d --quiet cups stop > /dev/null
-                       touch /var/run/cups/cupsd.stopped
-               fi
-       endscript
        postrotate
-               if [ -e /var/run/cups/cupsd.stopped ]; then
-                       rm /var/run/cups/cupsd.stopped
-                       invoke-rc.d --quiet cups start > /dev/null
-                       sleep 10
-               fi
+               invoke-rc.d --quiet cups restart > /dev/null
        endscript
-       compress
+       delaycompress
        notifempty
        create
 }


Since the "sleep 10" didn't make any sense to me, I removed that as well.


-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.13-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages cups depends on:
ii  cups-client            1.7.1-7
ii  cups-common            1.7.1-7
ii  cups-core-drivers      1.7.1-7
ii  cups-daemon            1.7.1-7
ii  cups-filters           1.0.46-1
ii  cups-ppdc              1.7.1-7
ii  cups-server-common     1.7.1-7
ii  debconf [debconf-2.0]  1.5.52
ii  ghostscript            9.05~dfsg-8+b1
ii  libavahi-client3       0.6.31-4
ii  libavahi-common3       0.6.31-4
ii  libc-bin               2.18-3
ii  libc6                  2.18-3
ii  libcups2               1.7.1-7
ii  libcupscgi1            1.7.1-7
ii  libcupsimage2          1.7.1-7
ii  libcupsmime1           1.7.1-7
ii  libcupsppdc1           1.7.1-7
ii  libgcc1                1:4.8.2-16
ii  libstdc++6             4.8.2-16
ii  libusb-1.0-0           2:1.0.17-1+b1
ii  lsb-base               4.1+Debian12
ii  poppler-utils          0.22.5-4
ii  procps                 1:3.3.9-4

Versions of packages cups recommends:
ii  avahi-daemon                     0.6.31-4
ii  colord                           1.0.6-1
ii  cups-filters [ghostscript-cups]  1.0.46-1
ii  printer-driver-gutenprint        5.2.9-1

Versions of packages cups suggests:
ii  cups-bsd               1.7.1-7
pn  cups-pdf               <none>
ii  foomatic-db            20140106-1
pn  hplip                  <none>
pn  printer-driver-hpcups  <none>
ii  smbclient              2:4.1.5+dfsg-1
ii  udev                   204-7

-- debconf information excluded


Reply to: