You are not logged in.

#1 2012-06-07 20:58:41

senjin
Member
Registered: 2006-09-15
Posts: 180
Website

filesystem upgrade - manual intervention required - bad advice?

The recent news post suggests to type the following thing:

pacman -Syu && reboot

It looks like a bad advice to me. If pacman fails in the middle of upgrade, immediate reboot can make bad things much worse. And pacman can fail, in particular because the problems can come not only from pacman itself, but also from a bad package. It happened several times before. I believe it's not safe to assume everything will go fine with "pacman -Syu".

Edit: ok, now I realized "&&" will prevent rebooting in most "fail" situations, but still I'd feel uneasy typing such command.

Last edited by senjin (2012-06-07 21:01:42)

Offline

#2 2012-06-07 21:03:41

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,697
Website

Re: filesystem upgrade - manual intervention required - bad advice?

&& will not prevent rebooting in most fail situations, it will prevent rebooting in ALL fail situations.  The reboot is only executed if pacman returns 0 (aka success).


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#3 2012-06-07 21:49:23

senjin
Member
Registered: 2006-09-15
Posts: 180
Website

Re: filesystem upgrade - manual intervention required - bad advice?

It won't work if the problem is not detected by pacman. What I'm trying to point out, it's not safe to assume that something will go fine only because we can't immediately imagine how it can go wrong. This approach has already lead to trouble with pacman in the past. It has something to do with Murphy laws, I think... wink concluding, one should stay on the safe side when touching critical parts of the system.

Offline

#4 2012-06-07 21:50:52

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,697
Website

Re: filesystem upgrade - manual intervention required - bad advice?

Do you have an example of a problem that wouldn't be detected by pacman that could be detected by a user who ran those two commands sequentially?


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#5 2012-06-07 22:18:22

senjin
Member
Registered: 2006-09-15
Posts: 180
Website

Re: filesystem upgrade - manual intervention required - bad advice?

Pacman -Syu can leave system in a state, that makes system unable to boot, although technically upgrade is successful. If user can realise this by reading the pacman output, then problem can be solved before rebooting.

Example? What about bug in post_install script? Or bug in a package that some part of upgrade relies on, which is not realised by the developer, because he used fixed version?

Offline

#6 2012-06-07 22:19:45

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,071

Re: filesystem upgrade - manual intervention required - bad advice?

senjin wrote:

Pacman -Syu can leave system in a state, that makes system unable to boot

But you won't know that unless you reboot correct?

So if you issue the command to reboot immediately or issue it separately, it doesn't matter in your example.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#7 2012-06-07 22:24:24

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,697
Website

Re: filesystem upgrade - manual intervention required - bad advice?

A bug in a post install script would make the pacman command return non-zero.

Any error that would be presented to the user at the command line would also make the command return non-zero.

Given this, I actually find the && version much safer than telling a user to do

pacman -Syu
reboot

as separate commands.  I trust the computer to follow the meaning of the && instructions much more than I trust the average user to pay attention to pacman's output.

Anything that would be missed by the && version, would also be missed by even the most attentive and responsible user as pacman would not give any notice of an error.

So, in summary:
VERSION              INATTENTIVE USER            ATTENTIVE USER
&& version:         mostly safe                       mostly safe
separate:             unsafe                               mostly safe (no more so than above)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#8 2012-06-07 22:36:35

senjin
Member
Registered: 2006-09-15
Posts: 180
Website

Re: filesystem upgrade - manual intervention required - bad advice?

Inxsible wrote:
senjin wrote:

Pacman -Syu can leave system in a state, that makes system unable to boot

But you won't know that unless you reboot correct?

Maybe I will, if I realise from the pacman output.

Inxsible wrote:

So if you issue the command to reboot immediately or issue it separately, it doesn't matter in your example.

Exactly. So the point is to give user chance to not reboot immediately.


Trilby wrote:

A bug in a post install script would make the pacman command return non-zero.

Only if it's a syntax bug.

Trilby wrote:

VERSION              INATTENTIVE USER            ATTENTIVE USER
&& version:         mostly safe                       mostly safe
separate:             unsafe                               mostly safe (no more so than above) [1]

OK, here I agree, except of [1]. Unless you have a very good argument, that pacman -Syu can't do bad things and still return 0 under any conditions.

Last edited by senjin (2012-06-07 22:40:32)

Offline

#9 2012-06-07 23:06:15

Roken
Member
From: UK
Registered: 2012-01-16
Posts: 653

Re: filesystem upgrade - manual intervention required - bad advice?

I tend to agree with the thrust, if not necessarily the reason. Quite often, pacman packages will provide advice/information (e.g. additional packages, non-compulsory config changes etc.) An immediate reboot would likely prevent the user seeing such messages (unless they were watching the output attentively as it happened). Perhaps advising reboot after review of output is a better option.


[img=Speedtest]http://www.speedtest.net/my-result/5145583518[/img]

Nvidia GTX 670 2Gb, AMD Phenom II X4 (965BE) @ 3.6 Ghz (Overclocked) 8GB RAM
Linux user #545703

Offline

#10 2012-06-08 21:38:26

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: filesystem upgrade - manual intervention required - bad advice?

I agree that I might have excluded a bit too many details in an attempt at brevity. The point is that one should reboot at soon as possible after doing the upgrade, but you might of course want to update some .pacnew files in the meantime, or check that everything else is as it should (though in practice I don't think this is going to be a problem).

Offline

#11 2012-06-13 21:07:14

Lux Perpetua
Member
From: The Local Group
Registered: 2009-02-22
Posts: 64

Re: filesystem upgrade - manual intervention required - bad advice?

Trilby wrote:

Do you have an example of a problem that wouldn't be detected by pacman that could be detected by a user who ran those two commands sequentially?

Sure: sometimes during a kernel update, mkinitcpio will fail one of the hooks (lvm2 being the usual culprit for me). pacman returns 0 in these cases. I just checked my log, so I'm sure about this. What I did in the past is reinstall the kernel or rerun mkinitcpio, and this has always worked, but had I tried to reboot immediately, I would have found my installation unbootable.

To answer the OP, yes, pacman -Syu && reboot is a bad idea. On the contrary, there is no excuse for not carefully reading pacman's output after every update.

In summary:

VERSION              INATTENTIVE USER            ATTENTIVE USER
&& version:          unsafe                      unsafe
separate:            unsafe                      mostly safe

Last edited by Lux Perpetua (2012-06-13 21:09:19)

Offline

Board footer

Powered by FluxBB