Bug 441053

Summary: you starts twice
Product: [openSUSE] openSUSE 11.1 Reporter: Michael Calmer <mc>
Component: YaST2Assignee: Ruediger Oertel <ro>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: jsrain, jsuchome, novellbmw, tmisilo, werner, wolfgang
Version: Beta 4   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: y2log

Description Michael Calmer 2008-11-03 13:13:43 UTC
How to reproduce:

user~:> su -
$> you

you starts with graphical UI.

=> press accept

After SuSEconfig is finished, it starts again in ncurses mode, also if no patch was selected in the grafical UI. 

Logs follow...
Comment 1 Michael Calmer 2008-11-03 13:15:21 UTC
Created attachment 249372 [details]
y2log
Comment 2 Jan Kupec 2008-11-06 15:49:06 UTC
Jirko, do you have a clue? There is no indication of a problem with the GUI YOU run. It just finished, and right after that the ncurses YOU starts:

2008-11-03 14:02:53 <1> tait(10522) [liby2] genericfrontend.cc(main):608 Launched YaST2 component 'y2base' 'online_update' '-S' 'ncurses'
Comment 3 Jiří Suchomel 2008-11-07 07:18:30 UTC
gorgon:~ # alias | grep you
alias you='test "$EUID" = 0 && /sbin/yast2 online_update || su - -c "/sbin/yast2 online_update"'


/sbin/yast2 online_update returns 17 and this clause causes it to run twice. I think it does not make sense to test it like a boolean. 17 is probably mapping from some symbol... Stano?

BTW, don't you know who defines that 'you' alias?
Comment 4 Stanislav Visnovsky 2008-11-07 08:56:05 UTC
I see this in the log:

2008-11-03 14:09:48 <1> tait(11196) [liby2] genericfrontend.cc(main):777 Finished YaST2 component 'y2base'
2008-11-03 14:09:48 <1> tait(11196) [liby2] genericfrontend.cc(main):782 Exiting with client return value '1'

I don't know why the client returns 1, but this will be translated to 16+1=> 17
Comment 5 Jiří Suchomel 2008-11-07 09:13:16 UTC
It has integer return value, which is used for detecting the need for restart. 

But this restart is caused by the new return value of YaST defined recently.

I do not want to dig in the return values of online_update in this phase, so I vote for removing or rewriting 'you' alias. Jiri, do you know where it comes from?
Comment 6 Jiri Srain 2008-11-07 09:46:52 UTC
No, I don't remember when we had done any changes. Maybe Martin does?
Comment 7 Jiří Suchomel 2008-11-07 09:52:00 UTC
I'm not asking for changes, the change of behavior is because of Stano's patch with return values, I'm asking where is the alias defined....
Comment 8 Jiří Suchomel 2008-11-07 12:40:32 UTC
It's defined in  /etc/bash.bashrc

Regardless the fact that return value of yast may be incorrect in this case, the condition should not check it at all, it does not make sense.

Rudi, could you please rewrite the 'you' alias?

I'm not sure if it is possible to use if-else branching inside alias definition (which would make it clear), other variant offered by jsrain is:


alias you='test "$EUID" = 0 && (/sbin/yast2 online_update; exit 0) || su - -c
"/sbin/yast2 online_update"'
Comment 9 Ruediger Oertel 2008-12-08 00:51:53 UTC
this one should preserve the return value of "yast2 online_update"
and seems to work:

alias you='if test "$EUID" = 0 ; then /sbin/yast2 online_update ; else su - -c "/sbin/yast2 online_update" ; fi'
Comment 10 Jiří Suchomel 2009-01-08 07:15:39 UTC
*** Bug 463966 has been marked as a duplicate of this bug. ***
Comment 11 Jiří Suchomel 2009-01-27 08:32:15 UTC
*** Bug 467487 has been marked as a duplicate of this bug. ***
Comment 15 Jiří Suchomel 2009-02-13 12:54:22 UTC
*** Bug 469197 has been marked as a duplicate of this bug. ***