首页 > 代码库 > Developers, do consider different user roles! - A bad experience with cron
Developers, do consider different user roles! - A bad experience with cron
The Story:
Last week, I found one of our embedded arm linux device ran out of flash space( totally only 128M for apps and OS).
After checking for a while, I found that test app created too many files which occupied the major flash space.
But after deeper checking, also found that cron log file( /var/cron/log) also ocuppied more than 10M space.
I looked at cron‘s source code and saw that there‘s a macro definition(LOG_FILE) to decide logging to /var/cron/log or not.
And we‘re using "angstrom-distribution" which provides pre-compiled .ipk packages, we were not aware that this macro was openned while compiling.
The Thoughts:
Firstly, It‘s our requirement analysis and testing problem that didn‘t check carefully if there‘re potential disk space eaters.
And I really think that it can be better that in original cron developers‘ mind that software package end users and package providers are different user roles.
And it‘s better to aware that different users‘ pain points maybe very different like some doesn‘t care about 10M disk usage while some cares a lot.
If considered these factors, they mostly would consider to provide end users a dynamic way to configure logging behavior.
(Btw, good to see that in latest ubuntu distribution, /etc/default/cron file allow user to define environment variables to control this.)
Further readings:
What is cron: http://en.wikipedia.org/wiki/Cron
Cron source code( didn‘t find angstrom‘s but ubuntu‘s) : https://launchpad.net/ubuntu/+source/cron/3.0pl1-120ubuntu3