I have a similar setup, except I have an SSD so I've got /var/log
mounted on tmpfs. The directory needs to start afresh on each boot. This
is a common trick for people who need to reduce the write count on their
EeePC or Aspire One.

Here's a method which will touch the required logfiles (including the
'news' directory), and also create the directory for the logfile if it
does not already exist. This allows the entire log directory to be
rebuilt on boot, regardless of what paths are specified in
/etc/syslog.conf:

fix_log_ownership()
{
        for l in `syslogd-listfiles -a --news`
        do
                # Create directory for logfile if required
                ldir=$(echo ${l} | sed  's/[^\/]*$//g')
                if [ ! -e $ldir ] ; then
                        mkdir -p $ldir
                fi
                # Touch logfile and chown
                touch $l && chown ${USER}:adm $l
        done
}

-- 
Non-existent log files cannot be chown'ed
https://bugs.launchpad.net/bugs/290127
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to