Subject: Re: cron problem -- can't switch user context
From: Brian Inglis <[email-masked]>
To: [email-masked]
Cc: [email-masked], Jeremy Hetzler <[email-masked]>
Date: Tue, 20 Jul 2021 00:53:12 -0600
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>

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

	http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd1

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.]

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple