On Sun, Dec 10, 2023 at 09:22:12AM -0700, Brian Inglis via Cygwin wrote:
> On 2023-12-09 14:55, Adam Dinwoodie via Cygwin wrote:
> > I've been trying to set up Cygwin cron to work as a service on my work
> > PC.  I'm able to get it working just fine on a Windows system where I'm
> > using a personal Microsoft account, but when I attempt the same process
> > using on a Windows system using my work account, I get the following
> > error:
> >      cygrunsrv: Error starting a service: StartService:  Win32 error 1068:
> >      The dependency service or group failed to start.
> > I also note that in the failing scenario, I see the following log appear
> > at this time in Windows Event Viewer:
> > > This computer is configured as a member of a workgroup, not as a
> > > member of a domain. The Netlogon service does not need to run in this
> > > configuration.
> > I've reproduced this behaviour in virtual machines using fresh
> > installations of Windows, and where the only actions taken were to
> > bootstrap, log in, install Cygwin including cygrunsrv and cron, then
> > attempt to set up cron as a service.  I've attached copies of the MinTTY
> > output and the cronbug.txt files (which appear to include the normal
> > cygcheck -srv output, so I've not added those separately.  I've also
> > attached the full Event Viewer log
> > My guess is that something about how Windows manages user accounts has
> > changed over the years, and cygrunsrv hasn't been updated to cope, but
> > that's a very wild guess.  Searching the archives hasn't got me very
> > far; mostly I've found references to cyglsa, which I get the impression
> > is thoroughly deprecated, and based on
> > https://www.cygwin.com/cygwin-ug-net/ntsec.html#ntsec-nopasswd3 I don't
> > think it's appropriate anyway due to the way the password is stored.
> > For now I'm continuing to use a snippet in my .bashrc to start cron when
> > I first start Bash, but that's not the nicest of workarounds.  Does
> > anyone have suggestions for anything better?
> 
> Never any issues here with cron, other than no mail, but I run mainly run
> scripts that log to /var/log/, and syslog rules that chmod a+r.
> I installed cyglsa many years ago, but don't think that's used any more, and
> I also used passwd -R, so that should still be around.
> I have also customized my daemon services so auto-start is delayed, notify
> on pre-shutdown, and depend on others: cron -> syslog-ng -> cygserver ->
> SamSS Security Accounts Manager, as I an not in a domain.
> 
> Given the error, I suggest checking the system config, as it either needs to
> be a domain member, with DC/AD access, or you need your work user created
> locally.

I'm honestly not sure what system config I'd need to check here.  Can
you give any more detailed instructions?

> Also check the deps with `sc qc cron` and follow the chain to see where
> netlogon gets involved.

That doesn't seem useful, sadly: as far as I can tell, cron has no
dependencies, so it's not clear to me why netlogon is getting involved
at all.

    $ sc qc cron
    [SC] QueryServiceConfig SUCCESS

    SERVICE_NAME: cron
            TYPE               : 10  WIN32_OWN_PROCESS
            START_TYPE         : 2   AUTO_START
            ERROR_CONTROL      : 1   NORMAL
            BINARY_PATH_NAME   : C:\cygwin64\bin\cygrunsrv.exe
            LOAD_ORDER_GROUP   :
            TAG                : 0
            DISPLAY_NAME       : Cron daemon
            DEPENDENCIES       :
            SERVICE_START_NAME : EUROPE\adinwoodie

I get the same results running that in Cygwin Bash and in PowerShell,
and with either started normally or running with Administrator
permissions.

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

Reply via email to