error running postrotate script

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat error running postrotate script
# 1  
Old 04-05-2010
error running postrotate script

Hi,

I am getiing emails from cron.daily with subject:
Code:
Cron root@vsftp run-parts /etc/cron.daily

/etc/cron.daily/logrotate:

Code:
/sbin/killall -HUP radiusd
: line 1: /sbin/killall: No such file or directory
error: error running postrotate script for /var/log/vsftpd/logfile 

the /etc/logrotate.conf file is as follows:
weekly
rotate 4
create
include /etc/logrotate.d
/var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
}
/var/log/vsftpd/logfile {
        daily
        rotate 4
        postrotate
                /sbin/killall -HUP vsftpd
        endscript
}

what is going wrong in the config file? what changes do i need to do to clear the error?

Last edited by renuka; 04-05-2010 at 11:01 AM.. Reason: code tags, please...
# 2  
Old 04-05-2010
Check if killall exist in the /sbin directory???

Show the entry that you have in your cron.
# 3  
Old 04-05-2010
Hi,

As the error message states there is not file /sbin/killall

please run "whereis killall" ( In my casse it is in /usr/bin)

And this section of your file

Code:
/var/log/radius/logfile {
        daily
        rotate 4
        postrotate
                /sbin/killall -HUP vsftpd
        endscript
}

logrotate.d/servicename

example

/etc/logrotate.d/radius

and not in /etc/logrotate.conf

you may change the /sbin/killall to its absolute path or
use just "killall" given you cron env is set appropriately

Regards,
Syed

Last edited by pludi; 04-05-2010 at 08:19 AM.. Reason: code tags, please...
# 4  
Old 04-05-2010
Regards
Arumon
# 5  
Old 04-06-2010
Quote:
Originally Posted by gomes1333
Check if killall exist in the /sbin directory???

Show the entry that you have in your cron.

Hi,
killall's path is /usr/bin/killall. I have made the change in the /etc/logrotate.conf file. thank you... will check the next day if i receive same email from cron.daily.

---------- Post updated 04-06-10 at 01:16 AM ---------- Previous update was 04-05-10 at 08:54 AM ----------

hi,

I changed the killall path from /sbin/killall to /usr/bin/killall and since then i did not receive any email from cron.daily...I think its working as expected.

But as maverick said, that i must create a new file in logrotate.d dir, I think that is how ideally custom logrotate files should be created but I would like to confirm if creating an entry in logrotate.conf would be problematic.
# 6  
Old 04-06-2010
Generally you may configure system-specific logs in /etc/logrotate.conf

However it is always good to have a service file in /etc/logrotate.d

For the sake of clarity

The binary responsible for log rotation is

/usr/sbin/logrotate

It takes /etc/logrotate.conf

which has a

include /etc/logrotate.d
directive ;which is by default enabled.It would be more sensible to have a service based file in /etc/logrotate.d
# 7  
Old 04-07-2010
hi maverick,

i understand now...thank you for the explanation..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Error running script

Hi, I have the the below script more runcda.sh if *\).*/\1/p' $1_dr) ]; then echo "ParallelGCThreads Found with Value" else echo "ParallelGCThreads Not Found - Add !!" fi $ ./runcda.sh output.log ./runcda.sh: test: argument expected ParallelGCThreads Not Found - Add !! Why am i... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. Shell Programming and Scripting

Error in running DB query by script

Hi I was trying to fetch data from database. But the number of rows exported were huge so i got the error. Experts please advice. Thanks a lot for your supprt. #: ./script.sh ./script.sh: xmalloc: subst.c:3076: cannot allocate 1401346369 bytes (0 bytes allocated) (2 Replies)
Discussion started by: brij123
2 Replies

3. Shell Programming and Scripting

Error when running script in background

Hi guys, ./test.sh & #!/usr/bin/ksh echo "No.Of Items :" read count echo "Report Time (Min):" read time some other command .... exit 0; thanks (3 Replies)
Discussion started by: asavaliya
3 Replies

4. UNIX for Dummies Questions & Answers

Help me with find and tar on postrotate script

Hi, My requirements are I wanted to move my daily logs to /appl/logs/old folder Archive and compress all 10 days older log files under /appl/logs/old in YYYYMMDD format file To remove any 60 days older log files from /appl/logs/old I tried this scenario with logrotate utility ... (1 Reply)
Discussion started by: laxyblack
1 Replies

5. UNIX and Linux Applications

Getting error code when running the script 2 (RC)2

hi All, we have a script to remove the files from particular path,when we tryingto run manually the script went to success and removed the files but the same script which is running by other team it got failed and giving the error "2 (RC)2 "..what is the cause of the failure..and we passing the... (2 Replies)
Discussion started by: nagavenkatesh
2 Replies

6. Shell Programming and Scripting

Will the scope be there in logrotate after postrotate directive...?

Hi, Please check the below code...:wall: if ; then echo "/var/log/AAA/BBB/xxx_*.log /var/log/AAA/BBB/yyy_*.log {" >> /etc/logrotate.conf echo " weekly" >> /etc/logrotate.conf echo " rotate 10" >> /etc/logrotate.conf... (2 Replies)
Discussion started by: Dedeepthi
2 Replies

7. Solaris

Error when running script

Hi All, Need your guuys help here. #!/bin/bash { echo "POLICY LIST" echo "====================================" bppllist echo " " echo "POLICY DETAILS" echo "====================================" for type in daily weekly monthly quarterly echo... (6 Replies)
Discussion started by: ronny_nch
6 Replies

8. UNIX for Dummies Questions & Answers

Getting error when running script through crontab

Hi all, I wrote small script for Solaris and when I am running it through command prompt its ok, but when I trying to run it using crontab, i am getting error like: ld.so.1: dbloader: fatal: libACE.so: open failed: No such file or directory /tmp/file.sh: line 5: 8304 Killed ... (4 Replies)
Discussion started by: nypreH
4 Replies

9. Shell Programming and Scripting

error in in running script

Hi all, I have created a script file .sh and had some allias commands, local variable, some grep features, and listing files/directories, and it worked correctly and I got the outputs I am looking for after I run the script . However, some of the grep commands and some other functions did not... (2 Replies)
Discussion started by: aama100
2 Replies

10. UNIX for Dummies Questions & Answers

Error while running a script

Hi all, By running a (command) script I'm getting the following error: .: /usr/bin/test: cannot execute binary file This is the command: $ . test The script (test) is very simple sqlplus user/password @1.sql sqlplus user/password @2.sql Can enyone tell me what the problem is. (5 Replies)
Discussion started by: HarryTellegen
5 Replies
Login or Register to Ask a Question