[Techtalk] debian init.d file to create log directory?

Little Girl littlergirl at gmail.com
Wed Feb 10 20:06:39 UTC 2010

Hey there,

Maria McKinley wrote:

> I am running several diskless clients in which the log files are
> kept in ram. One of the programs I am running is one called munin.
> Munin creates a directory, /var/log/munin when it is installed, but
> when it is started on boot, it does not have a check that creates
> the directory if it does not already exist. So, munin doesn't
> start, because the log directory is obviously not there in this
> case. What is the best way to create this directory on boot? Should
> I just add something to /etc/init.d/munin to create the directory?
> I noticed that cups manages to create its own log directory on
> boot, but couldn't see anything in the init.d file that actually
> creates the file, so maybe there is somewhere else that it should
> be created?

You could run a script like this one to check if the directory
exists, and create it if it doesn't:


echo "Checking for munin directory"
if [ -d /var/log/munin ]
    echo "Directory exists"
    mkdir /var/log/munin
    echo "Created munin directory"

Just make sure the script runs before Munin looks for the directory.

Little Girl

There is no spoon.

More information about the Techtalk mailing list