-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2013-06-05 13:12, Saint Germain wrote:
>>> Indeed even if cron has nothing to do, a temporary file is
>>> always created in /tmp and immediatly deleted.
>>> 
>>> I am trying to reduce the power consumption of my server and
>>> this patch had the effect of waking-up the hard-drive every
>>> hour.
>>> 
>>> Maybe it is possible to prevent the temporary file creation if
>>> cron has nothing to do ?
>> 
>> With "nothing to do", do mean "no jobs are run" or "jobs do not
>> create output"?
> 
> "nothing to do" = there is no job (cron.hourly is empty and users
> cron are empty)
> 
> However it would more elegant for cron to skip this file creation
> in case there is no job to execute.

Ah, but there is one job running: run-parts.

The scripts in cron.{hourly,daily,weekly,monthly} are not processed by
the cron daemon directly. Instead, the system crontab /etc/crontab
contains schedules for calls to "run-parts /etc/cron.[interval]", and
run-parts then processes those scripts. From cron's POV, there is
always exactly 1 process being run.

So another workaround for you would be to comment out the hourly
stanza from /etc/crontab.

Any other solution would be overly complex to implement, I'm afraid.

> This is only a minor bug though, but I spent quite a long time 
> tracking it (especially given that only Debian users have this bug)
> so I thought that it may be useful to report it.

I agree, thank you.

> I can of course mount /tmp on a tmpfs, but it seems to me that it 
> would be overkill (as cron is the only software I have which
> behaves like this). A better workaround would be for me to simply
> comment the line cron.hourly in /etc/crontab (as I don't have any
> hourly job).

(Off-topic, personal opinion: having a tmpfs on /tmp has many other
benefits, eg: there is no need to clean the filesystem on boot. Most of
the stuff in /tmp is probably going to be cached, ie in RAM, anyway)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlGvrsoACgkQwSyarY0epjXFaQCg3PL4cROPSawxFfaRzHDGXUJl
X9cAoI4EgvV4HH4z9K61+wkYcXARj9kF
=P7UF
-----END PGP SIGNATURE-----


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to