This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cron error can't switch user context

On Fri 2010-04-16 17:06, Cyrille Lefevre wrote:
> Le 16/04/2010 20:42, Tom Schutter a écrit :
> >
> > I have number of machines running Windows2003 and Cygwin 1.7.5.  On most cron works.  But on one (lemon) it does not.  It appears that on lemon cron cannot switch the user context.
> >
> > Cronevents on lemon shows:
> >
> > 2010/04/15 17:19:01 [SYSTEM] /usr/sbin/cron: PID 656: (tschutter) CMD (/usr/bin/python /cygdrive/f/production-sync/
> > 2010/04/15 17:19:01 [SYSTEM] /usr/sbin/cron: PID 656: (CRON) error (can't switch user context)
> >
> > /var/log/cron.log is empty on all machines.
> let's configure syslogd from inetutils to have some logs :
> syslogd-config --yes

I don't have a syslogd-config.  Ok.  So I installed inetutils.  Now I have a syslogd-config which I have just run.  And I have started syslogd.
After setting up syslogd, I still see an empty /var/log/cron.log and /var/log/messages.

> you may need to configure sshd before to have the right permissions
> on /var/empty, etc. (ssh-host-config --yes --user "${CYGSERVER_USER}" 
> --pwd "${CYGSERVER_PASS}" where CYGSERVER_USER=cyg_server and 
> CYGSERVER_PASS=whatever you want)

I am not sure what sshd has to do with cron.  In my case sshd cannot run as the cygserver user because it must be a domain user.

> PS : well, I prefer the legacy one than the ng one...
> PS2: IMHO, linux^Wcygwin cron(^W^Wlinux) sucks bcoz it doesn't report on 
> tasks return codes as a true unix does... (i.e.: <  root 1331 c Tue Feb 
>   2 17:32:36 MET 2010 rc=1)
> > The cron daemon is running as SYSTEM on all machines.
> 2K3 may need to be running under cyg_server ?

Why?  I have not seen any doc stating that.

> to configure cron, I use :
> cron-config << EOF
> yes
> no
> no
> no
> no
> PS : doesn't support csih yet :-(

Your yes and no responses do not match what cron-config asks me:

lemon:/$ cron-config
Do you want to install the cron daemon as a service? (yes/no) yes
Enter the value of CYGWIN for the daemon: [ ]

You must decide under what account the cron daemon will run.
If you are the only user on this machine, the daemon can run as yourself.
   This gives access to all network drives but only allows you as user.
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
  cyglsa package, then cron should run under the local system account.
Otherwise you need to have or to create a privileged account.
  This script will help you do so.
Do you want the cron daemon to run as yourself? (yes/no) no

Were the passwords of all cron users saved with "passwd -R", or
are you using the cyglsa package ? (yes/no) yes
The cron daemon will run as SYSTEM.

Running cron_diagnose ...
... no problem found.

Do you want to start the cron daemon as a service now? (yes/no) yes
OK. The cron daemon is now running.

In case of problem, examine the log file for cron,
/var/log/cron.log, and the appropriate syslog file
for information about the problem cron is having.

Examine also any cron.log file in the HOME directory
(or the file specified in MAILTO) and cron related files in /tmp.

If you cannot fix the problem, then report it to
Please run the script /usr/bin/cronbug and ATTACH its output
(the file cronbug.txt) to your e-mail.

WARNING: PATH may be set differently under cron than in interactive shells.
         Names such as "find" and "date" may refer to Windows programs.


It appears that cron-config decides to run cron under the SYSTEM account because I indicated that I was using cyglsa.

> > cyglsa is running on all machines.
> did you reboot after configuring cyglsa ?
> > cygserver is not running on any machine.
> 2K3 may need cygserver as well as passwd -D?

If I do a "passwd -R", cron will work.  But I don't want to do a "passwd -R".  I am forced to change my password every 60 days.  Then I would have to go to every cygwin box and change the password there as well.

> > I have rerun cron-config, rebooted, etc.
> well, ok, you surelly have rebooted :-)
> > I have searched the net, but most solutions seem to involve Cygwin 1.5 and no cyglsa.
> >
> > Does anyone have any suggestions?
> done.

Tom Schutter
First American Spatial Solutions
303-440-7272 x6822

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]