Gentoo Archives: gentoo-server

From: Matthew Lange <mmlange@×××××.com>
To: gentoo-server@l.g.o
Subject: Re: [gentoo-server] A few questions about portage
Date: Mon, 12 Sep 2005 19:56:13
Message-Id: 4325DC70.9040200@yahoo.com
In Reply to: [gentoo-server] A few questions about portage by "Ian P. Christian"
1 I have the following as an emerge.sh script in my croon.daily directory.
2 I used to have a lock file to prevent multiple copies from running, but
3 I now use fcron, which has this feature built-in. By default, all
4 output gets mailed to root, which I have aliased to me.
5
6 ---snip---
7 emerge sync 2>&1 > /dev/null
8 echo 'emerge system:'
9 emerge -pv --nocolor system
10 echo 'emerge world:'
11 emerge -pv --nocolor world
12 /usr/bin/revdep-rebuild --pretend --quiet --nocolor
13 ---snip---
14
15 Unfortunately, ANSI color is hard-coded into the utilities, so I get a
16 few control-characters in the output...but it works OK.
17
18 I have a better one I wrote, but I'll need to find it...I'll post it later.
19
20 Matt
21
22
23
24 Ian P. Christian wrote:
25 > I've recently been spending some time getting to know a little more about
26 > portage, and I've run into a few issues.
27 >
28 > $ emerge --update --deep --newuse world
29 >
30 > It's reasonably well known that the above doesn't update all packages
31 > installed on a system - I think it only updates packages that are in the
32 > world file. Recently, this issue has left a server of mine with a insecure
33 > version of apache (apache was installed due to a dependency caused by PHP, or
34 > some application I installed that pulled in php, which in turn pulled in
35 > apache.).
36 > The man page does cover this, but it's by no means made obvious - and I think
37 > this is rather a large issue, as a log of users of gentoo probably don't know
38 > this.
39 >
40 > From the manual:
41 >
42 > "When you install a package with uninstalled dependencies and do not
43 > explicitly state those dependencies in the list of parameters, they will not
44 > be added to the world file. If you want them to be detected for world
45 > updates, make sure to explicitly list them as parameters to emerge."
46 >
47 > It should have a big WARNING or something next to it IMO.
48 >
49 > emerge --depclean will point out what isn't in your world file for you, so you
50 > can go ahead and add things to the world file manually. Having done this,
51 > when you uninstall whatever it was that dragged that dependency in in the
52 > first place, you will get unneeed packages on the system.
53 >
54 > Lets say for examples sake I install mail-client/squirrelmail. This will pull
55 > in PHP, which will pull in apache. In this case, -uD will not update apache
56 > should a new version appear. An emerge --depclean will show apache as being
57 > removable- so apache will need manually adding to the world file. Now, when
58 > I uninstall squirrrelmail, apache is no longer needed, but depclean won't
59 > show that, because I was forced to add it to the world file. In a lot of
60 > situations, the package might be a lot more obscure, perhaps some odd
61 > libraries which now are in the world file, and will stay there, because
62 > unless I manually look though the world file, and run an 'equery depends' on
63 > each one, I won't notice they are no longer needed.
64 >
65 > So it seems that I either suffer packages not being updated, or am forced into
66 > adding things into the world file and then face the problem that dependencies
67 > will not be removable by depclean.
68 >
69 > Also, I don't understand why emerge --depclean will show a package, which upon
70 > doing an 'equery depends' on that package will show that actaully that
71 > package is needed. Why do these tools contradict each other? Surly depclean
72 > should have the logic that equery uses to see when a dependency really is
73 > needed?
74 >
75 > glsa-check goes some way to solving the problem, it does check to see if there
76 > are outdated packages that have been effected by security issues - but it
77 > doens't update libraries that were installed but aren't in the world file.
78 >
79 > Is there a script that's been developed to be cronned to email the sys admin a
80 > report saying what packages need updating? I noticed that in the last month
81 > on this list there has been some useful information about running glsa-check
82 > and rsynicng just part of the portage tree. This kind of thing is intregal to
83 > running a server, and if no such script exists in the portage tree, I will
84 > attempt to write one.
85 >
86 > Kind Regards,
87 >
88 --
89 gentoo-server@g.o mailing list

Replies

Subject Author
Re: [gentoo-server] A few questions about portage z3rosix@×××××××.ch