Assuming you enter your password upon running sudo, isn’t there the risk of sudo’s privilege timing out if pacman takes too long to complete? I believe I tried something similar, intending to run a one-liner I could start then walk away from. However, I ended up returning to see the system not rebooted hours later.
Or is yes somehow supposed to take care of this? Sorry, newish Debian user here who hasn’t ventured outside the distribution much.
The command after && runs only if the previous command returns non-error exit status (0), if pacman returns error the latter command won’t be executed.
Additionally there’s probably a configuration option for sudo for it to not time out, but it doesn’t matter since you can just use systemctl reboot as a normal user to reboot your system (at least on Debian). If that’s too long I recommend to add this to your .bashrc (if you use Bash): alias reb='systemctl reboot' or something similar.
Maybe this is just a yay thing but I think if sudo priveleges run out while downloading the files it prompts you for your password again before performing the changes. That would lead to it either trying to use the yes output or getting stuck in the password prompt, only failing in the prior.
This entire problem could be solved by just running it as the root user.
There’s no timeout for sudo. When permitted, a process runs as root and then closes.
Also, the system will still shutdown when update fails because pipes do not care if previous commands exit with a nonzero code, unless pipefail is set.
Assuming you enter your password upon running
sudo
, isn’t there the risk ofsudo
’s privilege timing out ifpacman
takes too long to complete? I believe I tried something similar, intending to run a one-liner I could start then walk away from. However, I ended up returning to see the system not rebooted hours later.Or is
yes
somehow supposed to take care of this? Sorry, newish Debian user here who hasn’t ventured outside the distribution much.The command after
&&
runs only if the previous command returns non-error exit status (0), ifpacman
returns error the latter command won’t be executed.Additionally there’s probably a configuration option for
sudo
for it to not time out, but it doesn’t matter since you can just usesystemctl reboot
as a normal user to reboot your system (at least on Debian). If that’s too long I recommend to add this to your.bashrc
(if you use Bash):alias reb='systemctl reboot'
or something similar.Maybe this is just a
yay
thing but I think if sudo priveleges run out while downloading the files it prompts you for your password again before performing the changes. That would lead to it either trying to use theyes
output or getting stuck in the password prompt, only failing in the prior.This entire problem could be solved by just running it as the root user.
Yes, in this
commandone liner, the system should not power off when the update took too long.No,
yes
is simply answering all questions asked during the update procedure (start upgrade, replace config files, restart services) with “yes”.There’s no timeout for sudo. When permitted, a process runs as root and then closes.Also, the system will still shutdown when update fails because pipes do not care if previous commands exit with a nonzero code, unlesspipefail
is set.Edit: i’m blind.