Greetings, Brian Inglis!

> On 2022-01-26 07:50, Andrey Repin wrote:
>> Greetings, Brian Inglis!
>> 
>>> restart them in a late local permanent postinstall script
>>> /etc/postinstall/zp_z0_l_start_services.dash after setup.
>> 
>> It never occured to me that I can use postinstall tasks to restart services 
>> :D
>> 
>> Just add a line
>> 
>> for svc in cygserver $( cygrunsrv --list | grep -v cygserver ); do net start 
>> "$svc"; done
>> 
>> and you're golden!

> To avoid conflicts you may first want to stop some Windows services 
> using first sc, then net as backup:

net waits for command to be completed, so it's reasonable sure to assume if it
completed without an error, things are going smooth.
sc is good to make sure service exists.

> for srv in      ssh ssh-agent sshbroker sshproxy        \
>                 sshd sshdbroker sshdproxy               \
>                 vmictimesysnc w32time # for GPS ref Windows NTP server
Why would I need to stop w32time, for example?

> do
>         sc stop         $srv
>         sleep 1
>         net stop        $srv
> done

> then start all Cygwin services using cygrunsrv, then sc, then net to be 
> more sure:

> for srv in $(cygrunsrv -L)
> do
>         cygrunsrv -S    $srv
>         sleep 1
>         sc start        $srv
>         sleep 1
>         net start       $srv
> done

That's overcomplicated, IMO.

> with suitable checks, messages, and logging added.

And checks to check that checks are checking out? ;)


-- 
With best regards,
Andrey Repin
Friday, January 28, 2022 11:13:24

Sorry for my terrible english...


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