Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Im currently running of ideas. The proftpd doesn't restart, if logrotate is triggered by the cron task. Logrotate rotates all logfiles stops proftpd but does not start proftpd again.

If i force the rotation with logrotate -f /etc/logrotate.d/proftpd-basic everything works fine..

Any kind of ideas are welcome.

I got the following setup.

cat /etc/cron.daily/logrotate

#!/bin/sh

test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf 

cat /etc/logrotate.conf

# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/btmp {
    missingok
    monthly
    create 0660 root utmp
    rotate 1
}

# system-specific logs may be configured here

cat /etc/logrotate.d/proftpd-basic

/var/log/proftpd/proftpd.log
/var/log/proftpd/controls.log
{
        weekly
        missingok
        rotate 7
        compress
        delaycompress
        notifempty
        create 640 root adm
        sharedscripts
        postrotate
                # reload could be not sufficient for all logs, a restart is safer
                invoke-rc.d proftpd restart 2>/dev/null >/dev/null || true
                #invoke-rc.d proftpd reload 2>/dev/null >/dev/null || true
        endscript
}

/var/log/proftpd/xferlog
/var/log/proftpd/xferreport
{
        monthly
        missingok
        rotate 7
        compress
        delaycompress
        notifempty
        create 640 root adm
        sharedscripts
        prerotate
        endscript
        postrotate
                # reload could be not sufficient for all logs, a restart is safer
                invoke-rc.d proftpd restart 2>/dev/null >/dev/null || true
                #invoke-rc.d proftpd reload 2>/dev/null >/dev/null || true
                # run ftpstats on past transfer log
                ftpstats -a -r -l 2 -d -h -f /var/log/proftpd/xferlog.0 2>/dev/null >/var/log/proftpd/xferreport || true
        endscript
}
share|improve this question
    
i'm using the default behavior of logrotate, which is cron. –  user1219736 Sep 27 '13 at 0:14

2 Answers 2

I have had the same problem. It seems to be a bug in the proftpd init script that causes the ftp server to fail to start. See https://bugs.launchpad.net/ubuntu/+source/proftpd-dfsg/+bug/1246245

A workaround is to change the config to include

     copytruncate

Instead of moving the old file and creating a new one, this will copy the contents of the file and then truncate the old one - meaning that you don't need to restart the daemon.

share|improve this answer

Try an absolute path on invoke-rc.d

/usr/sbin/invoke-rc.d
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.