LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-12-2007, 04:56 AM   #1
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Rep: Reputation: 30
Logrotate problem - postrotate: command not found


I get the following email from Cron on a couple of my gentoo servers:
Code:
To: root
Subject: Cron <root@www2> test -x /usr/sbin/run-crons && /usr/sbin/run-crons

sh: line 2: postrotate: command not found
sh: line 2: postrotate: command not found
sh: line 2: postrotate: command not found
I don't know why this happens on these two and not on all the other gentoo servers I have. I can't tell which logrotate script is generating the errors but as far as I know postrotate is valid inside logrotate scripts so I can't see why this erorr is happening.

So how do I stop these errors?
 
Old 01-13-2007, 03:34 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
sounds like some sort of syntax error causing a malformed execution of the code... check all your /etc/logrotate.d/ files for occurences of postrotate and post them if you can't see anythign wrong... that error isn't too useful as i guess it could be in any number of files you would already have.
 
Old 01-14-2007, 10:49 AM   #3
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Original Poster
Rep: Reputation: 30
Code:
/etc/logrotate.d/apache2:
# $Header$
#
# Apache2 logrotate snipet for Gentoo Linux
# Contributes by Chuck Short
#
/var/log/apache2/*log {
  missingok
  notifempty
  sharedscripts
  postrotate
  /etc/init.d/apache2 reload > /dev/null 2>&1 || true
  endscript
}

/etc/logrotate.d/somecustom:
/var/log/somecustom/somecustom.log {
    daily
    rotate 14
    compress
    create 644 apache apache
    sharedscripts
    prerotate
      /usr/bin/svc -d /service/somecustom
    postrotate
      /usr/bin/svc -u /service/somecustom
    endscript
}


/etc/logrotate.d/somecustom2:
/var/log/somecustom2/somecustom2A.log /var/log/somecustom2/somecustom2B.log {
        daily
        rotate 14
        compress
        create 644 apache apache
        sharedscripts
        prerotate
                /usr/bin/svc -d /service/somecustom2
        postrotate
                /usr/bin/svc -u /service/somecustom2
        endscript
}

/etc/logrotate.d/somecustom3:
/var/log/somecustom3/somecustom3A.log /var/log/somecustom3/somecustom3.log {
        daily
        rotate 14
        compress
        create 644 apache apache
        sharedscripts
        prerotate
                /usr/bin/svc -d /service/somecustom3
        postrotate
                /usr/bin/svc -u /service/somecustom3
        endscript
}

/etc/logrotate.d/syslog-ng:
# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.logrotate,v 1.2 2004/07/18 02:25:02 dragonheart Exp $
#
# Syslog-ng logrotate snippet for Gentoo Linux
# contributed by Michael Sterrett
#

/var/log/messages {
    sharedscripts
    postrotate
        /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
    endscript
}

Last edited by humbletech99; 01-14-2007 at 10:50 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-27-2006 11:57 PM
Error running postrotate script... Jake_B Red Hat 0 09-19-2005 04:34 PM
Problem: Startx Command Not Found rvijay Debian 11 02-13-2005 11:40 AM
Command not found problem rudon Linux - Newbie 3 04-16-2003 09:09 PM
problem installing acrobat : ed: command not found? falcon56215 Linux - Software 2 02-08-2002 11:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration