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


On Fri, 10 Sep 2004, Paul J. Ghosh wrote:

> Thank you all for your help.  We pursued all that was recommended and
> still ran into the error: cron : PID 3784 : starting service `cron'
> failed: execv: 128, Transport endpoint is not connected.
>
> Since invoking it command line was successful we put a wrapper in place
> that executes cron and added the wrapper as a service.  cron is now
> working.  For the issue where crontab assumes that SYSTEM is the owner
> of the cron service and leaves the contents of the /var/cron/tabs as 640
> with a group of SYSTEM we also created a wrapper that changes the
> permission to 644.
>
> Here is the detail of what we have put into place and provided to the
> release engineer:
>
> overview:
> 	- 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/bin/bash
> 	/usr/sbin/cron -D
>
> 	$ ls -l /usr/sbin/xcron
> 	-rwxr-xr-x    1 devadm   Domain U       34 Sep 10 14:03 /usr/sbin/xcron
>
> 	- create wrapper for crontab - attached 'xcrontab'/contents below
> 	- install in /usr/bin
> 	- change permissions for xcrontab
> 	$ chmod 744 /usr/bin/xcrontab
>
> 	$ cat /usr/bin/xcrontab
> 	#!/usr/bin/bash
> 	/usr/bin/crontab $@;
> 	xval=$?;
> 	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 /usr/bin/xcrontab
>
> 	- add wrapped cron as service
> 	$ cygrunsrv -I xcron -p /usr/sbin/xcron -a -u svccron -w <passwd>
>
> 	- execute following as user for which tasks need to be scheduled
> 	$ xcrontab -e
>
> 	- for details
> 	$ man 5 crontab

Well, Larry is right -- it's very hard to follow a thread where the
replies neither quote the original message nor have the correct
References: or In-Reply-To: fields.  However, I've just reviewed the whole
thread.  I don't believe you (or Anna Goldberg) ever said what the exact
cygrunsrv invocation of the cron service was.

Had you said that, it would have been rather obvious that you were simply
missing the -D argument to cron, and that adding that would have most
likely solved your problem.

FWIW, I don't believe the cygrunsrv invocation above works for you, since
the -a flag requires an argument, and will grab the -u.  You probably
didn't cut-and-paste the exact command.

In any case, you can try simply using

$ cygrunsrv -I cron -p /usr/sbin/cron -a -D -u svccron -w <passwd>

and see if it works.  The crontab trick, on the other hand, might be
necessary.
HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw

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


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