www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/07/04/14:59:53

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:cc:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=y5klJlVWZMXfGcv0
WmKmDsOIsSfQpJhuUhkYos3UCRR5TRtZIMPKxm6suxR3vBzwTfV7YbsCiHIT2ooj
6ld9dMOE/32RK4rs6NPO1fnXZ2R2TdzxRGzAyBpL4XhTKS8MliJpfzepxiOlemTS
mhMDGj3uZCCmmJyDriMGDYjzSC0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:cc:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=eOQkAczv+5/WGYUmHiOaLC
sTDOU=; b=euwWiGZB7r1EIZrIsYYdGJ8R92MK8u7ZrQ/e5Mm//VkVmAM4M9AAwv
I1utTzcEiMiVfI2LP7fcLnCVndWEkUtnLsR8Auk8xdzHMz54GkTt1NdYc+TuMjr2
debq1F9j7HejnDDSIbIfSNFJeVv9yN+hpzojQvRODKbpG5vbUzKT0=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:may, H*r:forged, proceeds, grepping
X-HELO: limerock02.mail.cornell.edu
Subject: Re: Unattended upgrade does not report errors via the exit code
To: cygwin AT cygwin DOT com
References: <693796192 DOT 3838665 DOT 1530640512441 DOT ref AT mail DOT yahoo DOT com> <693796192 DOT 3838665 DOT 1530640512441 AT mail DOT yahoo DOT com>
Cc: "R. Diez" <rdiezmail-cygwin AT yahoo DOT de>
From: Ken Brown <kbrown AT cornell DOT edu>
Message-ID: <126e0d40-4dd2-126d-b54c-7ddc27d008b8@cornell.edu>
Date: Wed, 4 Jul 2018 14:59:35 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0
MIME-Version: 1.0
In-Reply-To: <693796192.3838665.1530640512441@mail.yahoo.com>
X-IsSubscribed: yes

On 7/3/2018 1:55 PM, R. Diez via cygwin wrote:
> First of all, many thanks for Cygwin.
> 
> I have been trying to find out how to do an unattended update/upgrade of all packages, in order to save some mouse clicks. To do that, you start
> setup-x86_64.exe with --quiet-mode. During experimentation, I found out the following:
> 
> 1) Apparently, it will close all running Cygwin software automatically as needed, in order to upgrade it. That may be a nasty surprise for the unwary.

One of the features of --quiet-mode is that setup doesn't bother the 
user with a lot of popup dialogs.  For the most part it simply proceeds 
with the defaults, corresponding to what would happen if the user 
pressed ENTER when running interactively.  In particular, this applies 
to the dialog that pops up when running processes need to be stopped.

> 2) If you start it from a Cygwin console, or from an unprivileged Windows console, you will not see the console messages like this:
> 
> 
> Starting cygwin install, version 2.891
> User has backup/restore rights
> 
> Current Directory: C:\CygwinInstall
> Could not open service McShield for query, start and stop. McAfee may not be installed, or we don't have access.
> root: C:\cygwin64 system
> Selected local directory: C:\CygwinInstall
> net: Direct
> connection error: 12007
> site: http://linux.rz.ruhr-uni-bochum.de/download/cygwin/
> connection error: 12007
> connection error: 12007
> ...
> 
> If you run it from a unprivileged console, you will not see the message either that tells you about the log file where to look for errors.
> 
> 
> I would suggest documenting those things. I could not find mention of that anywhere in the web pages.

The documentation could certainly use improvement.  Patches would be 
welcome.  AFAICT, the main documentation is at

   https://cygwin.com/cygwin-ug-net/setup-net.html,

the source for which is in winsup/doc/setup-net.xml in the Cygwin source 
repository.  See also winsup/doc/faq-setup.xml.  And see 
https://cygwin.com/git.html for information about getting access to the 
source repository.

> More seriously, the setup program does not indicate any failure (it always yields an exit code of 0). In the above example, where I disabled the network card, you get the following lines at the end:
> 
> connection error: 12007
> connection error: 12007
> mbox note: Unable to get setup from <http://linux.rz.ruhr-uni-bochum.de/download/cygwin/>
> unattended_mode is set at mbox: returning default value
> download/verify error in unattended_mode: out of retries
> note: Installation incomplete.  Check C:\cygwin64\var\log\setup.log.full for details
> Ending cygwin install
> 
> 
> 
> I tried printing $? from a Cygwin shell afterwards, and %ERRORLEVEL% in a Windows console, and it always showed an exit status of 0.

setup is a Windows program, not a Cygwin application, so I don't think 
you can expect $? to contain its exit status.  I don't know enough about 
Windows programming to know what would have to be changed in the setup 
sources to support %ERRORLEVEL%.

On the other hand, if you're running setup from a script, you could 
probably achieve what you want by grepping /var/log/setup.log.full.

There's been a proposal on the cygwin-apps list to have a Cygwin "setup" 
package, possibly including a wrapper script for setup.exe.  Maybe that 
script could be tweaked to provide a useful exit code.  See

   https://sourceware.org/ml/cygwin-apps/2018-04/msg00016.html

Ken


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019