On Mon, Nov 28, 2016 at 01:32:00AM +0000, qubenix wrote:
> 
> Unman:
> > On Mon, Nov 28, 2016 at 12:16:00AM +0000, qubenix wrote:
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA512
> >>
> >> When there is nothing to upgrade for dom0 the qubes-dom0-update script
> >> exits with a "1". Is this intended behavior?
> >>
> >> A snippet from my term running qubes-dom0-update with "bash -x":
> >>
> >> + qvm-run --nogui --pass-io sys-update 'script --quiet --return
> >> --command '\''/usr/lib/qubes/qubes-download-dom0-updates.sh --doit
> >> --nogui
> >> --exclude=qubes-template-debian-8,qubes-template-whonix-gw,qubes-template-whonix-ws,qubes-template-fedora-23,
> >> -v -y --enablerepo=qubes-dom0-current-testing'\'' /dev/null'
> >> Checking for dom0 updates...
> >> Config time: 0.111
> >> repo time: 0.000
> >> repo time: 0.000
> >> Setting up Package Sacks
> >> pkgsack time: 0.087
> >> No Match for argument Config
> >> No Match for argument repo
> >> No Match for argument Yum
> >> No Match for argument Setting
> >> No Match for argument pkgsack
> >> No Match for argument rpmdb
> >> No Match for argument Building
> >> No Match for argument up:Obs
> >> No Match for argument up:simple
> >> No Match for argument up:obs
> >> No Match for argument up:condense
> >> No Match for argument updates
> >> rpmdb time: 0.016
> >> Nothing to download
> >> + RETCODE=1
> >> + '[' '' == 1 ']'
> >> + '[' 1 -ne 0 ']'
> >> + exit 1
> >>
> >> - -- 
> >> qubenix
> > 
> > If I remember right dnf returns 100 if there are updates, 0 if none, and
> > 1 if an error occurs.
> > I'm pretty sure that qubes-dom0-update returns the dnf exit code, but
> > also reports "Nothing to download" if no packages have been downloaded.
> > You should check to see what's happening on the update qube, and whether
> > there was any error there.
> > (I really should look at the code - I may be way off.)
> > 
> > unman
> > 
> > 
> 
> Looks like it returns the exit code from qvm-run
> (https://github.com/QubesOS/qubes-core-admin-linux/blob/master/dom0-updates/qubes-dom0-update
> - lines 168..174):
> 
> qvm-run $QVMRUN_OPTS --pass-io $UPDATEVM "script --quiet --return
> --command '/usr/lib/qubes/qubes-download-dom0-updates.sh --doit --nogui
> $ALL_OPTS' /dev/null"
> RETCODE=$?
> if [ "$CHECK_ONLY" == "1" ]; then
>     exit $RETCODE
> elif [ "$RETCODE" -ne 0 ]; then
>     exit $RETCODE
> fi
> 
> qvm-run
> (https://github.com/QubesOS/qubes-core-admin/blob/master/qvm-tools/qvm-run)
> is python so I need to study it hard to understand it.
> 
> -- 
> qubenix

qvm-run in dom0 does propagate exit codes.

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-devel/20161128015525.GC12088%40thirdeyesecurity.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to