qubenix: > Marek Marczykowski-Górecki: >> 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 >> >> This is interesting. I guess it's result of "-v" you've given and some >> yum/dnf genius printing diagnostic messages to stdout instead of stderr, so >> it >> interfere with the actual output (which is later feed back to yum/dnf to >> actually download available updates)... >> >>>>> Nothing to download >>>>> + RETCODE=1 >> >> And here we've got 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. >> >> > > Even stranger, if I run something like this: > > sudo qubes-dom0-update -v -y --enablerepo=qubes-dom0-current-testing > while [[ "$?" != "0" ]]; do > sudo qubes-dom0-update -v -y --enablerepo=qubes-dom0-current-testing > done > > It will, almost every time, run the first update with exit 1 and the > second time with exit 0. I will try some tests (when I have some time, > today is busy) without "-v". > >
Without "-v" seems to work as expected, "exit 0" every time on 3 tries. -- qubenix GPG: B536812904D455B491DCDCDD04BE1E61A3C2E500 -- 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/e1a09920-2467-0520-5202-a77654663be4%40riseup.net. For more options, visit https://groups.google.com/d/optout.
