cron problem -- can't switch user context

Brian Inglis
Tue Jul 20 06:53:12 GMT 2021

On 2021-07-19 11:40, Jeremy Hetzler via Cygwin wrote:
> Upon installing Cygwin and cron on a new Windows Server 2019 machine,
> we are unable to get cron to work.
> I installed cron using cron-config. Cron is configured to run under
> account cyg_server, which cron-config set up. cron-config reported
> that "cyg_server is a valid privileged account".
>>From cronevents, I see numerous errors saying "can't switch user
> context". It looks like every time cron tries to run a job, it emits
> one of these errors.
> Example:
>> 2021/07/15 18:45:02 [cyg_server] /usr/sbin/cron: PID 6421: (CRON) error (can't switch user context)
> See attached for cronbug output.
> I tried rebooting the machine, but this did not help.
> How can we get cron to work on this new machine?
> Please copy me on any responses; thank you.

Use the recommended local System account and you should have no problems 
with recent Cygwin services under recent Windows:

"To run multiple users, cron must change user context without knowing 
the passwords. There are three methods to do that, as explained in

If all the cron users have executed "passwd -R" (see man passwd),
which provides access to network drives, or if you are using the
[obsolete] cyglsa package, then cron should run under the
local system account."

Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

More information about the Cygwin mailing list