cron.d crontabs
Posted: 19. Jul 2013, 21:58
According to the crond man page on /etc/cron.d:
But it doesn't seem to be working.
The package in question is lockout, which I posted about here nearly three years ago when I knew even less about Linux:
http://archive09.linux.com/feature/116324
It's a Perl script to boost productivity by blocking access to the online distractions of your choice and then temporarily scrambling the root password for a set period. No-one in their right mind would do such a thing on a production system, but since a live cd will reset the root password for you if the worst does happen, it doesn't feel too dangerous to try at home.
Putting the requisite entries in root's crontab makes everything work:
(lockout only accepts the 'unlock' argument if the allotted time has expired. If not, 'force' is also needed.)
Why, though, is the app's own crontab table apparently not recognised?
Yes, I actually made it executable
Note to anyone foolish enough to try this out: keep a root terminal open to save the bother of resetting the root password. The instructions linked to above are worth a look beforehand.
Presumably, reparse also occurs on boot, and also just by doingThe directory of per-user crontabs is re-parsed once every hour in any case. Any crontabs in the system directory (usually /etc/cron.d) are parsed at the same time. This directory can be used by packaging systems. When you install a package foo, it might write its own foo-specific crontab to /etc/cron.d/foo.
Code: Select all
#crond
The package in question is lockout, which I posted about here nearly three years ago when I knew even less about Linux:
http://archive09.linux.com/feature/116324
It's a Perl script to boost productivity by blocking access to the online distractions of your choice and then temporarily scrambling the root password for a set period. No-one in their right mind would do such a thing on a production system, but since a live cd will reset the root password for you if the worst does happen, it doesn't feel too dangerous to try at home.
Putting the requisite entries in root's crontab makes everything work:
Code: Select all
root[mimosa]# crontab -l
#
[...snip...]
# Begin custom crontab entries
#
* * * * * /usr/bin/lockout unlock 1> /dev/null
@reboot /usr/bin/lockout unlock force 1> /dev/null
Why, though, is the app's own crontab table apparently not recognised?
Code: Select all
ls -l /etc/cron.d/lockout
-rwxr-xr-x 1 root root 236 Jul 19 17:11 /etc/cron.d/lockout
root[mimosa]# cat /etc/cron.d/lockout
# lockout needs to check every minute whether it's time to unlock
*/1 * * * * root /usr/bin/lockout unlock >/dev/null 2>&1
# rebooting *MUST* restore the root password
@reboot root /usr/bin/lockout unlock force >/dev/null 2>&1

Note to anyone foolish enough to try this out: keep a root terminal open to save the bother of resetting the root password. The instructions linked to above are worth a look beforehand.