[pbs-devel] [PATCH proxmox-backup v2] client: mount: flush output before exiting
Friedrich Weber
f.weber at proxmox.com
Tue Jun 18 14:32:35 CEST 2024
Hi Chris,
On 18/06/2024 13:41, Christian Ebner wrote:
> On 6/18/24 13:20, Friedrich Weber wrote:
>> Thanks for tackling this! I ran into this issue (sometimes missing error
>> output) when I was running `sudo proxmox-backup-client mount [...]` and
>> forgot that PBS_REPOSITORY was not passed through by sudo. It looks like
>> in this case, the patch doesn't completely fix this issue -- seems like
>> I'm still missing the error output sometimes:
>>
>> $ sudo ./proxmox-backup-client mount \
>> "$SNAPSHOT" $FILE $PATH \
>> --keyfile $KEYFILE --ns $NS
>> $ sudo ./proxmox-backup-client mount \
>> "$SNAPSHOT" $FILE $PATH \
>> --keyfile $KEYFILE --ns $NS
>> $ sudo ./proxmox-backup-client mount \
>> "$SNAPSHOT" $FILE $PATH \
>> --keyfile $KEYFILE --ns $NS
>> Error: unable to get (default) repository
>
> Hi Friedrich,
> I just double checked by invoking the command in a for loop 10 times,
> for all of which I do get the error message as output.
>
> ```bash
> for i in $(seq 0 9)
> do
> sudo proxmox-backup-client mount ct/100/2024-06-13T10:38:54Z
> root.pxar /mnt
> done
> ```
>
> Interestingly, I do also get the output without the patch applied, so
> therefore I did not notice (and obviously forgot to do the negative test
> during review).
>
> Maybe some difference in setup?
Thanks for double-checking! That's quite weird. Could it be related to
sudo's `use_pty` setting?
With `Defaults use_pty` in /etc/sudoers (the default for me) ...
$ for i in $(seq 10); do sudo ./proxmox-backup-client mount foo bar baz;
done
... gives me only 2-5 lines of output.
If I comment out the `Defaults use_pty` line in /etc/sudoers, I get 10
lines of output consistently.
More information about the pbs-devel
mailing list