logrotate script needs to redirect stderr too

Bug #271767 reported by Andreas Hasenack
10
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Released
Low
Andreas Hasenack
Landscape Server
Fix Released
Low
Andreas Hasenack
landscape-client (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The landscape-client logrotate script needs to also redirect stderr to /dev/null, or else we get an error when the process is not running:

root@nsn2:~# logrotate -f /etc/logrotate.d/landscape-client
cat: /var/run/landscape-client.pid: No such file or directory
kill: 2: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]
error: error running postrotate script for /var/log/landscape/watchdog.log
cat: /var/run/landscape-client.pid: No such file or directory
kill: 2: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]
error: error running postrotate script for /var/log/landscape/broker.log
cat: /var/run/landscape-client.pid: No such file or directory
kill: 2: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]
error: error running postrotate script for /var/log/landscape/monitor.log
cat: /var/run/landscape-client.pid: No such file or directory
kill: 2: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]
error: error running postrotate script for /var/log/landscape/manager.log
root@nsn2:~# /etc/init.d/landscape-client start
 * Starting the landscape-client daemon [ OK ]
root@nsn2:~# logrotate -f /etc/logrotate.d/landscape-client
root@nsn2:~#

Or if the pid file is incorrect:
root@nsn2:~# logrotate -f /etc/logrotate.d/landscape-client
kill: 2: No such process

error: error running postrotate script for /var/log/landscape/watchdog.log
kill: 2: No such process

error: error running postrotate script for /var/log/landscape/broker.log
kill: 2: No such process

error: error running postrotate script for /var/log/landscape/monitor.log
kill: 2: No such process

error: error running postrotate script for /var/log/landscape/manager.log

Changed in landscape-client:
importance: Undecided → Low
Changed in landscape:
importance: Undecided → Low
milestone: none → thames-pre-8
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Pushed for thames-pre-9

Changed in landscape:
milestone: thames-pre-8 → thames-pre-9
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Pushed for the final thames milestone.

Changed in landscape:
milestone: thames-pre-9 → thames
Revision history for this message
Andreas Hasenack (ahasenack) wrote :
Changed in landscape:
milestone: thames → thames+1
Revision history for this message
Thomas Herve (therve) wrote :

Looks great, +1.

Changed in landscape-client:
status: New → In Progress
Changed in landscape:
status: New → In Progress
Revision history for this message
Jamu Kakar (jkakar) wrote :

+1!

Changed in landscape-client:
status: In Progress → Fix Committed
Changed in landscape:
milestone: thames+1 → thames
status: In Progress → Fix Committed
Changed in landscape:
milestone: thames → thames+1
Changed in landscape-client:
status: New → Confirmed
Revision history for this message
Matt Zimmerman (mdz) wrote : Re: [Bug 271767] Re: logrotate script needs to redirect stderr too

Rather than redirecting stderr, the script should avoid the errors, so that
when there is a genuine error, it is not lost.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

No client release in this milestone, so pushing for the next one.

Changed in landscape:
milestone: thames+1 → mountainview-pre-1
Changed in landscape:
milestone: mountainview-pre-1 → mountainview-pre-2
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 1.0.25-0ubuntu0.9.04

---------------
landscape-client (1.0.25-0ubuntu0.9.04) jaunty; urgency=low

  * New upstream release supporting custom graphs (LP: #306360)
    - Multiple custom graphs can be used at the same time (LP: #307314)
    - PATH is now set for scripts in script execution (LP: #257018)
  * debian/landscape-common.postinst: Only chown parts of /var/lib/landscape
    because we now store files in it that should maintain their ownership
    (LP: #307321).
  * debian/landscape-client.postinst: Work around chfn/system user problem
    by not specifying a --gecos (LP: #238755)
  * debian/landscape-client.logrotate: logrotate no longer reports spurious
    errors when the client isn't running (LP: #271767)

 -- Christopher Armstrong <email address hidden> Thu, 11 Dec 2008 17:11:08 -0800

Changed in landscape-client:
status: Confirmed → Fix Released
Changed in landscape:
milestone: mountainview-pre-2 → mountainview-pre-3
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

qa + 1, but we should address mdz's comment in another release.

Revision history for this message
Matt Zimmerman (mdz) wrote :

On Tue, Jan 20, 2009 at 05:29:38PM -0000, Andreas Hasenack wrote:
> qa + 1, but we should address mdz's comment in another release.

Do I need to file a separate bug or will you ensure that this is not
forgotten?

--
 - mdz

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I opened bug #319316 for that, thanks for reminding me.

Changed in landscape:
milestone: mountainview-pre-3 → mountainview-pre-4
Changed in landscape:
milestone: mountainview-pre-4 → mountainview-pre-5
Changed in landscape:
milestone: mountainview-pre-5 → mountainview-pre-6
Changed in landscape:
milestone: mountainview-pre-6 → mountainview-pre-7
Changed in landscape:
milestone: mountainview-pre-7 → mountainview-pre-8
Changed in landscape-client:
assignee: nobody → ahasenack
Changed in landscape:
assignee: nobody → ahasenack
Changed in landscape:
status: Fix Committed → Fix Released
Changed in landscape:
milestone: mountainview-pre-8 → mountainview
status: Fix Released → Fix Committed
Changed in landscape-client:
status: Fix Committed → Fix Released
Changed in landscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.