Mail Archives: cygwin/2002/07/07/20:25:01
I've been trying to get Cygwin cron to work and I ran into some "can't
switch user context" problems. After reading many messages in the archives
and trying all of the suggested settings, it finally dawned on me what is
happening. I haven't seen this explanation in the archives, so I'm
sending this in the hopes that it will prevent others from getting too
frustrated. I think this really belongs in Cygwin's README for cron.
cron tries to "switch user context WITHOUT a password" before running
the commands in a user's crontab file. The problem, I think, is that
cron is running as a service under the "LocalSystem" user and as such it
cannot "switch user context WITHOUT a password" to a domain user (that
would be a huge security hole). Other cygwin programs (e.g. telnet and
ftp) do not have this problem because they do not "switch user context
WITHOUT a password". The user provides the password to these programs
interactively so they can "switch user context WITH a password" (even to
an NT domain user). Unfortunately, cron is non-interactive so there is
no password available for it to use when switching user context.
Here's how I verified this theory: When logged in to NT using my domain
account, cron kept putting the "can't switch user context" error into
event viewer. As soon as I renamed "/var/cron/tabs/<domain_user>" to
"/var/cron/tabs/<local_user>" (where "<local_user>" is a user local to my
NT box, not part of a domain), cron worked fine.
The simplest workaround is to not setup a crontab if you are logged in as a
domain user (duh). If you want to use cron, setup a local NT and cygwin
user and do all your cron stuff from that local account.
If I'm wrong and there is a way to get cron to run crontabs for domain
users, please let me know how.
Dave
--
David MacMahon, President
Smart Software Consulting
http://www.smartsc.com
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -