LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-24-2008, 10:20 AM   #1
ocgltd
Member
 
Registered: Sep 2005
Location: Canada
Distribution: Fedora 12 i386
Posts: 57

Rep: Reputation: 16
logrotate permissions problem - can't figure it out


I have a new Fedora 9 installation and I'm moving over my scripts from a Fedora 5 installation. Strangely, one of my logrotate scripts fails with a permissions error (when run from logrotate/cron). However, if I run the logrotate script (with -vf) from root account it runs fine. The associated file and directory permissions appear identical!

Can someone help or give some ideas?

Here is the error:
Code:
/etc/cron.daily/logrotate:


       /usr/sbin/asterisk -rx 'logger rotate' > /dev/null 2> /dev/null
       # Remove rotated logs since already made a copy
       rm -f /var/log/asterisk/debug.0
       rm -f /var/log/asterisk/messages.0
       rm -f /var/log/asterisk/event_log.0
       rm -f /var/log/asterisk/queue_log.0
       rm -f /var/log/asterisk/faxlog
       rm -f /var/log/asterisk/table-cdr.mysql
       rm -f /var/log/asterisk/table-cid.mysql
       rm -f /var/log/asterisk/table-callednumber.mysql
       rm -f /var/log/asterisk/controllog
       rm -f /var/log/asterisk/voicemaillog
       # Set permissions on file to ensure smrsh can write to it
       touch /var/log/asterisk/controllog
       chown root:asterisk /var/log/asterisk/controllog
       chmod 660  /var/log/asterisk/controllog
       touch /var/log/asterisk/voicemaillog
       chown root:asterisk /var/log/asterisk/voicemaillog
       chmod 660  /var/log/asterisk/voicemaillog
       # Extract the cdr and callerid databases, empty the cdr
       /data/scripts/backupasteriskdb
: line 21: /data/scripts/backupasteriskdb: Permission denied
error: error running shared postrotate script for '/var/log/asterisk/debug /var/log/asterisk/messages /var/log/asterisk/event_log /var/log/asterisk/queue_log /var/log/asterisk/faxlog /var/log/asterisk/table-cdr.mysql /var/log/asterisk/table-callednumber.mysql /var/log/asterisk/table-cid.mysql /var/log/asterisk/controllog /var/log/asterisk/voicemaillog '
/etc/cron.daily/updatetime:
Here is the contents of the /data/scripts folder:
Code:
-rwxr-xr-x 1 root root   416 2008-09-24 09:50 backupasteriskdb
-rwxr-xr-x 1 root root   374 2008-09-24 09:50 backupasteriskdb~
-rwxr-xr-x 1 root root    81 2006-10-25 11:25 backup-callednumber.mysql
-rwxr-xr-x 1 root root    64 2006-03-18 21:34 backup-cdr.mysql
-rwxr-xr-x 1 root root    63 2006-10-25 11:25 backup-cid.mysql
Thanks!
 
Old 09-25-2008, 08:21 AM   #2
racracracrac
Member
 
Registered: Sep 2008
Posts: 44

Rep: Reputation: 15
Looks like the error is coming from /data/scripts/backupasteriskdb What does this script do?

Also, you should be including the interpreter at the top of your scripts. Its good practice and avoids strange problems. Like #!/bin/sh

Last edited by reddazz; 10-14-2008 at 06:55 PM. Reason: removed spammed link
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Logrotate problem - postrotate: command not found humbletech99 Linux - General 2 01-14-2007 11:49 AM
logrotate question/problem jwholey Linux - General 1 06-28-2006 12:18 AM
Logrotate strange problem FragInHell Linux - Software 3 05-07-2006 07:12 PM
problem with logrotate tflavell Linux - Newbie 6 07-04-2005 04:32 AM
problem with logrotate pippet Linux - General 2 09-07-2004 02:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:04 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