Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dcron: failed parsing crontab for user root: PATH
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
NuLL3rr0r
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jul 2009
Posts: 96
Location: The Netherlands

PostPosted: Sat May 20, 2023 11:40 pm    Post subject: dcron: failed parsing crontab for user root: PATH Reply with quote

Interestingly it used to work for the root user but not anymore. It works for the user. For example, I have the following user with this crontab script which works:

Code:

$ crontab -l           
0   */4   *   *   *   export DISPLAY=:0; /home/mamadou/.config/i3/reddit-wallpaper.sh > /dev/null 2>&1


And, for the user root, I have the following:

Code:

crontab -l -u root
# zfs-auto-snapshot
*/15 * * * * root /usr/sbin/zfs-auto-snapshot zroot


Now, not only it won't work but also when I restart the dcron service I see the following in the logs:

Code:

May 21 01:34:11 mamadou-legion crond[6826]: /usr/sbin/crond 4.5 dillon's cron daemon, started with loglevel notice
May 21 01:34:11 mamadou-legion crond[6826]: failed parsing crontab for user root: PATH="/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"


Any idea where that is coming from? BTW, I did not run crontab /etc/crontab as instructed by the handbook, and have the following inside my /etc/crontab:

Code:

$ cat /etc/crontab
# for dcron

# dcron:
# This is NOT the system crontab! dcron does not support a system crontab.
# to get /etc/cron.{hourly|daily|weekly|montly} working with dcron run
# crontab /etc/crontab
# as root.
# NOTE: This will REPLACE root's current crontab!!

# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
59   *  * * *  rm -f /var/spool/cron/lastrun/cron.hourly
9    3  * * *  rm -f /var/spool/cron/lastrun/cron.daily
19   4  * * 6  rm -f /var/spool/cron/lastrun/cron.weekly
29   5  1 * *  rm -f /var/spool/cron/lastrun/cron.monthly


EDIT: I have to mention I have this issue with two separate installations.
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3925

PostPosted: Sun May 21, 2023 8:47 am    Post subject: Reply with quote

This
Quote:

*/15 * * * * root /usr/sbin/zfs-auto-snapshot zroot

might be ok for /etc/crontab.For the specific crontab of root it should be
Code:

*/15 * * * *  /usr/sbin/zfs-auto-snapshot zroot

_________________
:)
Back to top
View user's profile Send private message
NuLL3rr0r
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jul 2009
Posts: 96
Location: The Netherlands

PostPosted: Sun May 21, 2023 12:08 pm    Post subject: Reply with quote

Thank you very much for the suggestion. I tried it:

Code:

$ crontab -l -u root
# zfs-auto-snapshot
*/15 * * * * /usr/sbin/zfs-auto-snapshot zroot


Though, still get the same error when I restart the dcron service:

Code:

May 21 14:05:27 mamadou-legion crond[26028]: /usr/sbin/crond 4.5 dillon's cron daemon, started with loglevel notice
May 21 14:05:27 mamadou-legion crond[26028]: failed parsing crontab for user root: PATH="/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3925

PostPosted: Tue May 23, 2023 9:53 am    Post subject: Reply with quote

Maybe it doesnt like the comment.
Plz remove
Code:

# zfs-auto-snapshot


Also try
Code:

ls -l /var/spool/cron/crontabs

Also maybe there are hidden characters in the file.Try deleting the file and running again
crontab -e
as root.
_________________
:)
Back to top
View user's profile Send private message
The Main Man
Veteran
Veteran


Joined: 27 Nov 2014
Posts: 1172
Location: /run/user/1000

PostPosted: Mon Dec 16, 2024 4:09 pm    Post subject: Reply with quote

I don't know if OP solved this issue and how, but I am seeing the same thing, user jobs are still working fine, but for some reason root jobs are not (failed parsing crontab for user root...)
It worked for ages without any issues, having trouble figuring this one out, there were no config changes or anything like that, or related updates as far as I can tell.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum