Project

General

Profile

Actions

Bug #2019

closed

RedHat 5 initscript condrestart not working

Added by Frederik Nosi over 12 years ago. Updated about 12 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Packaging
Target version:
Difficulty:
trivial
Triaged:
Fixed in Releases:
Found in Releases:

Description

I noticed that a day after foreman has been started the log file gets deleted and not replaced. Torned out the logrotate script was rotatinng the log correctly and then calling the initscript with condrestart:

file /etc/logrotate.d/foreman:
[...]
postrotate
[ -e /etc/init.d/foreman ] && /etc/init.d/foreman condrestart >/dev/null 2>&1 || true
[...]

but condrestart wasn't working as expected. This fixes it for me:

  1. diff u /root/foreman /etc/init.d/foreman
    --
    /root/foreman 2012-12-06 13:10:47.000000000 0100
    ++ /etc/init.d/foreman 2012-12-06 13:11:06.000000000 0100
    @ -134,7 +134,7 @
    ;;
    condrestart)
    if [ f ${FOREMAN_HOME}/tmp/pids/server.pid ]; then
    restart
    /etc/init.d/foreman restart
    RETVAL=$?
    fi
    ;;
Actions

Also available in: Atom PDF