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: Cygwin Cron on Windows 2003 Server Issues

Larry/Igor - well - this is the first time I am participating in the
cygwin mailing list and from what I have read at it is
supposed to add to threads if the subject is identical.  I have been
using the same subject line.  There was not an initial email that I
could have replied to nor was there a References: that I could have
manipulated when I started.  I read the responses by going to the site which just lists items
chronologically.  But, since it was not available night before last I
discovered the site that
actually does have all my responses threaded correctly.  In fact, the
presentation is prefered since it is by thread/subject as opposed to by
date/time.  So, tell me what I am supposed to do such that responses are
correctly threaded and I will comply...

Igor - even though we did not state the command executed to add cron as
a service it did include the -D option as described in the message  Yes, we
have tried running it as you have described and it still fails with the
error: cron : PID 3784 : starting service `cron' failed: execv: 128,
Transport endpoint is not connected.  Also yes, you have correctly
pointed out that the -a is erroneous in my summation of steps.  I am
including an updated set of instructions just to ensure that any future
readers will not be mislead.

Pierre - your suggestion - will it not lead to root privileges for
svccron?  If yes, then that is not desirable.  However, I will try it
out and let all know the outcome.  In a bash shell with a simple command
it prompts for a password.

$ su -c "exec echo foobar" system
su: incorrect password

Thank you all once again.  Hopefully one of you can get it to work on
W2K3 without wrappers.


Paul J. Ghosh

	- create local user called 'svccron'
	- set up permissions for local user
	- create wrappers for cron/crontab
	- add wrapped cron as service
	- set up schedules

execute the following within a bash shell:

	- create local user called 'svccron'

  	net user svccron <passwd> /add /yes
  	net localgroup <administrators_group_name> svccron /add
  	editrights -a SeAssignPrimaryTokenPrivilege -u svccron
 	editrights -a SeCreateTokenPrivilege -u svccron
  	editrights -a SeIncreaseQuotaPrivilege -u svccron
  	editrights -a SeServiceLogonRight -u svccron
  	mkpasswd -l -u svccron >> /etc/passwd

	for security reasons:
  	editrights -a SeDenyInteractiveLogonRight -u svccron
  	editrights -a SeDenyNetworkLogonRight -u svccron
  	editrights -a SeDenyRemoteInteractiveLogonRight -u svccron

	- create wrapper for cron - attached 'xcron'/contents below
	- install in /usr/sbin
	- change permissions for xcron
	$ chmod 744 /usr/sbin/xcron

	$ cat /usr/sbin/xcron
	/usr/sbin/cron -D

	$ ls -l /usr/sbin/xcron
	-rwxr-xr-x    1 devadm   Domain U       34 Sep 10 14:03

	- create wrapper for crontab - attached 'xcrontab'/contents
	- install in /usr/bin
	- change permissions for xcrontab
	$ chmod 744 /usr/bin/xcrontab

	$ cat /usr/bin/xcrontab
	/usr/bin/crontab $@;
	chmod 644 /var/cron/tabs/$USER;
	exit $xval;

	$ ls -l /usr/bin/xcrontab
	-rwxr-xr-x    1 devadm   Domain U       90 Sep 10 13:58

	- add wrapped cron as service
	$ cygrunsrv -I xcron -p /usr/sbin/xcron -u svccron -w <passwd>

	- execute following as user for which tasks need to be scheduled
	$ xcrontab -e

	- for details
	$ man 5 crontab

Attachment: xcrontab
Description: Binary data

Attachment: xcron
Description: Binary data

Unsubscribe info:
Problem reports:

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