public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@yandex.ru>
To: Brian Inglis <cygwin@cygwin.com>, cygwin@cygwin.com
Subject: Re: services startup postinstall scripts
Date: Fri, 28 Jan 2022 11:18:55 +0300	[thread overview]
Message-ID: <1536908267.20220128111855@yandex.ru> (raw)
In-Reply-To: <b3264a97-b67c-b1dd-c9b3-ad6cdf674862@SystematicSw.ab.ca>

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


      reply	other threads:[~2022-01-28  8:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20 16:15 Updated cygwin this morning, mintty window flashes briefly and quits Keith Christian
2022-01-20 16:41 ` [EXTERNAL] " Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-01-20 18:33   ` Keith Christian
2022-01-20 20:24     ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-01-20 23:02       ` Keith Christian
2022-01-21  7:45       ` Brian Inglis
2022-01-26 14:50         ` Andrey Repin
2022-01-26 20:23           ` services startup postinstall scripts Brian Inglis
2022-01-28  8:18             ` Andrey Repin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1536908267.20220128111855@yandex.ru \
    --to=anrdaemon@yandex.ru \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).