Web lists-archives.com

Unattended upgrade does not report errors via the exit code




Hi all:

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.


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.

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.


I did not try what happens if the selected mirror is out of date.

This is a serious drawback, because there is no way to know whether the unattended install or upgrade failed or not.

Best regards,
  rdiez

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