You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to add a recurring job to my crontab, I get the following message:
crontab: installing new crontab
/var/spool/cron/: mkstemp: Permission denied
I'm able to work around the issue by using Task Scheduler to call bash.exe with the script I wanted to run, but that seems kludgy. A lot of applications depend on cron to run routine maintenance tasks, and having to set them up in Task Scheduler is sub-optimal.
Grant Dobbe (@grantdobbe) Unfortunately, we currently don't have support for background task execution. Please help us prioritize it by providing the feedback in our user voice page. I do see one related post, if you would like to up vote it.
There is another issue: some normal userspace commands in linux are, for some reason, restricted to root, with no good reason (that is, it might make sense if the underlying NTFS filesystem prohibited it, which it usually doesn't). So even if cron background jobs worked, the current implementation denies permission for unprivileged users to use it. Lots of other things are in the same boat.
So for example, if you do sudo crontab -e and you don't get "permission denied", but you do get "permission denied" with plain crontab -e, this is not crontab not working, it is another of several unwarranted restrictions on linux unprivileged account behavior.
I'm not saying that cron is working, just that the crontab -e command is being denied to normal users without good reason. Making crontab work is thus, strictly speaking, a different issue. (In my opinion, there shouldn't be a question about it being a high priority.)
To fragment discussion? To increase the effort required, in the hope that people will give up instead of speaking up?
That was definitely not the intent. This bug tracker is good for tracking bugs, but, it's difficult to do a consolidated voting based feature request here (nothing that I am aware of). If you have any feedback on how we take feature requests for WSL, please feel free to also reach out to Tara Raj (@tara-raj)
We actually look at our user voice page on feature requests. As for this particular request to support background tasks, that was added recently. See here. Hopefully that clarifies few things here.
crontab: installing new crontab
/var/spool/cron/: mkstemp: Permission denied
This is because cron(8) was not running, and that directory (possibly) did not have correct permissions. The 'possibly' caveat because no strace of the failing crontab(1) was provided.
The issue was marked as 'feature' because at the time WSL did not support background tasks. This was addressed in Insider 17046 and will hit the Spring Update RSN.
If anyone finds any further problems with cron(8) or crontab(1) please feel encouraged to open a new issue following CONTRIBUTING.md. The popular github hang-out for launching of init tasks like cron (or sshd, or syslogd, or dbus-daemon, or ...) is #994.
Activity
sunilmut commentedon May 11, 2016
Grant Dobbe (@grantdobbe) Unfortunately, we currently don't have support for background task execution. Please help us prioritize it by providing the feedback in our user voice page. I do see one related post, if you would like to up vote it.
rodrymbo commentedon May 12, 2016
There is another issue: some normal userspace commands in linux are, for some reason, restricted to root, with no good reason (that is, it might make sense if the underlying NTFS filesystem prohibited it, which it usually doesn't). So even if cron background jobs worked, the current implementation denies permission for unprivileged users to use it. Lots of other things are in the same boat.
So for example, if you do
sudo crontab -eand you don't get "permission denied", but you do get "permission denied" with plaincrontab -e,this is not crontab not working, it is another of several unwarranted restrictions on linux unprivileged account behavior.I'm not saying that cron is working, just that the crontab -e command is being denied to normal users without good reason. Making crontab work is thus, strictly speaking, a different issue. (In my opinion, there shouldn't be a question about it being a high priority.)
matthewpersico commentedon Aug 11, 2016
sudo crontab -u $USER -e is a reasonable workaround. I'll upvote the cron support.
sunilmut commentedon Mar 12, 2018
@sampablokuper -
That was definitely not the intent. This bug tracker is good for tracking bugs, but, it's difficult to do a consolidated voting based feature request here (nothing that I am aware of). If you have any feedback on how we take feature requests for WSL, please feel free to also reach out to Tara Raj (@tara-raj)
We actually look at our user voice page on feature requests. As for this particular request to support background tasks, that was added recently. See here. Hopefully that clarifies few things here.
We appreciate all feedback!
therealkenc commentedon Mar 13, 2018
The OP in this issue was:
This is because
cron(8)was not running, and that directory (possibly) did not have correct permissions. The 'possibly' caveat because nostraceof the failingcrontab(1)was provided.The issue was marked as 'feature' because at the time WSL did not support background tasks. This was addressed in Insider 17046 and will hit the Spring Update RSN.
You can start
cronwithsudo service cron start.If anyone finds any further problems with
cron(8)orcrontab(1)please feel encouraged to open a new issue following CONTRIBUTING.md. The popular github hang-out for launching ofinittasks likecron(orsshd, orsyslogd, ordbus-daemon, or ...) is #994.tara-raj commentedon May 22, 2018
Fixed in release 1803. You can read more about how to do this in our blog post on background tasks