Bug 346976 - [opensuse-updater][kde]stubborn opensuse-updater
Summary: [opensuse-updater][kde]stubborn opensuse-updater
Status: RESOLVED FIXED
Alias: None
Product: openSUSE 10.3
Classification: openSUSE
Component: YaST2 (show other bugs)
Version: Final
Hardware: i686 openSUSE 10.3
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Thomas Göttlicher
QA Contact: Jiri Srain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-07 20:11 UTC by Elmar Stellnberger
Modified: 2008-03-26 15:20 UTC (History)
0 users

See Also:
Found By: Community of Practice
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
upgrade refused (185.47 KB, image/png)
2007-12-07 20:15 UTC, Elmar Stellnberger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elmar Stellnberger 2007-12-07 20:11:44 UTC
Every now and then the OpenSuse-Updater its work with the following error message:
"A ZYpp transaction is already in progress. This means, there is another application using the libzypp library for package management running. All such applications must be closed before using this command.
Dienstprogramm gab zur��ck: Exit Status: 4"
This time, interestingly the following things have worked at the same time:
> zypper repos
> zypper se svgalib
* installing SW via YaST
Comment 1 Elmar Stellnberger 2007-12-07 20:15:34 UTC
Created attachment 186479 [details]
upgrade refused

After restarting the updater the following error message has occurred by an attempt to upgrade a singleton package (previously updater had been run as root and could not find any available upgrade though there had always been plenty).
Comment 2 Elmar Stellnberger 2007-12-07 20:21:18 UTC
As far as I can remember there had been another minor issue with a very likely truely missing lock release at Bug #333465 (if that has not been resolved yet).
Comment 3 Elmar Stellnberger 2007-12-17 20:15:19 UTC
  In the main it works quite reliable and well (no recurring errors). Nevertheless some improvements to the locking mechanism may be possible: consistency checks (f.e.release on finally handler), multiple read locks, possibly even activate/deactivate installation sources while software to be installed is selected - two different yast-modules; to be used exclusively by the time). 
  Another question is wheter it may be run as root (apart from the security risk) to avoid having to enter the root password subsequently (Comment#1).
  After an appropriate change an entry in the sudoers-table for zypp should  be sufficient for kdesu to directly start updating (without kdesu asking for any password).

kdesu --noignorebutton -d -c ( true ; zypper ...)
|->
kdesu --noignorebutton -d -c zypper ...
Comment 4 Elmar Stellnberger 2007-12-17 21:22:34 UTC
hanging zypp-update of opensuse-updater (absolutely no progress); remained after quit (os-updater should possibly kill updates in progress on quit):

ps ax|g zypp
30101 ?        S      0:00 /bin/bash /usr/sbin/zypper_install --patch --package lyx
30107 ?        S      0:00 kdesu --noignorebutton -d -c ( true ; zypper -q --terse --non-interactive in -l -t package --force --name  "lyx"  )?> /tmp/opensuseupdater.Yvooj30102/opensuseupdater_out 2> /tmp/opensuseupdater.Yvooj30102/opensuseupdater_err
(30107: both files of zero size)

kill and manual recreation of 30101: zypper has worked fast and correct
Comment 5 Thomas Göttlicher 2007-12-18 10:39:29 UTC
As far as I know kdesu ignores /etc/sudoes NOPASSWD. If you point me a solution without I will try to implement it in opensuseupdater's zypper call.

Comment 6 Thomas Göttlicher 2007-12-18 10:41:41 UTC
Jano, how is it possible that yast sw_single and zypper runs at the same time?
Comment 7 Elmar Stellnberger 2007-12-18 19:14:58 UTC
                                                      (in Reply to Comment #5)
Well, in the meanwhile kdesu takes /etc/sudoers into account (Bug 267399).
> tail -1 /etc/sudoers
elm     ALL = (root) NOPASSWD: /sbin/ifconfig, /usr/bin/zypper
> kdesu ifconfig         (or: kdesu -c ifconfig)
eth1      Protokoll:Ethernet  Hardware Adresse xx:xx:xx:xx:xx:xx
...

                                                      (concerning Comment #4,6)
found that zypp-process running after having quitted opensuse-updater;
and thought it had been issued by opensuse-updater; where else should it come from?
Comment 8 Elmar Stellnberger 2007-12-18 20:55:22 UTC
 activate/deactivate installation sources while software to be
installed is selected:                                                      
  It would be really groovy if that was possible without extensive changes. It likely means that sw_single must not pregrab any resource/lock on startup, but only lock for the time it is performing searches. Similarely yast2.inst_source would have to realease its locks after adding/changing/removing inst.sources in order to signal the interested (like f.e. sw_single processes). All of that required a fine grained but consistent locking and resource sharing.

  By the way could anyone explain what the invocation of 'true' before zypper was supposed to be good for (I know, I have already commited such basherys on my own $( true | (...) | ...), because bash didn`t like me to open a subshell as the first command inside $() )?
Comment 9 Thomas Göttlicher 2007-12-19 09:22:21 UTC
(In reply to comment #7)
> Well, in the meanwhile kdesu takes /etc/sudoers into account.
On my system (factory 11.0) kdesu opens a window with password prompt while sudo runs zypper as root without password prompt.
Are you sure Bug 267399 is fixed? I guess it is close because of no response.

(In reply to comment #8)
>   By the way could anyone explain what the invocation of 'true' before zypper
> was supposed to be good for [...]?
The "true" in the command is added by a script that automatically assembles the zypper calls. I will clean up this script.

Comment 10 Elmar Stellnberger 2007-12-19 14:53:22 UTC
  Unfortunately the kdesu-enhancement for consulting /etc/sudoers first has not been implemented yet. Nevertheless we should not mind since that can possibly be circumvented provisionally by a hack like the following replacing /opt/kde3/bin/kdesu (interestingly not /usr/bin/kdesu):

  kdo=""; while [ "$1" = "--noignorebutton" ]||[ "$1" = "-d" ]||[ "$1" = "-c" ]; do kdo="$kdo $1"; shift; done
  sudo -S "$@" </dev/null || /usr/bin/kdesu-orig $kdo "$@"

So what is 'true'
supposed to do?
do it stout, 
simply drop it out

so that the user of the updater
will not be freed any later
of a task
that for we do not want him to ask!
Comment 11 Elmar Stellnberger 2007-12-23 16:30:07 UTC
.
Comment 12 Jan Kupec 2008-02-12 13:33:13 UTC
(In reply to comment #6 from Thomas Goettlicher)
> Jano, how is it possible that yast sw_single and zypper runs at the same time?

No idea, really. zypper repos is allowed, but zypper search should not work.
Comment 13 Thomas Göttlicher 2008-03-26 15:20:54 UTC
Call of zypper is cleaned up in the kde4 version now. I will submit a package to STABLE soon.