As a root I run three dd processes in the background
dd if=/dev/urandom of=/dev/null &
dd if=/dev/urandom of=/dev/null &
dd if=/dev/urandom of=/dev/null &As a root I edit a crontab and put a job to kill all dd processes that were run by root every minute
crontab -e
* * * * * pkill -u root dd But when I use top to monitor processes the dd processes don't get killed. Why ?
Messages from /var/log/syslog :
Dec 9 12:33:01 champion CRON[3395]: Authentication failure
Dec 9 12:33:29 champion crontab[3383]: (root) END EDIT (root)
Dec 9 12:34:01 champion cron[1432]: Authentication failure
Dec 9 12:34:01 champion CRON[3398]: Authentication failureTried these suggestions but it didn't help :
Invoke the crontab with :
crontab -e -u root
Make sure that you have an empty line at the end of the cronjob file, meaning that every line ends with a newline.
2 Answers
Based on the following diagnostic output from pwck -r:
no matching password file entry in /etc/shadow add user 'root' in /etc/shadow?you can see that the problem is the same as described here:
You can fix it by running pwck again, this time in read-write mode
sudo pwckand accepting the suggested action to add the appropriate shadow file entry for user root.
1Have you made sure you're writing the crontab with root?
sudo crontab -eA non-root account would not be able to kill processes owned by root.
4