| View previous topic :: View next topic |
| Author |
Message |
steveL Veteran

Joined: 13 Sep 2006 Posts: 1441 Location: The Peanut Gallery
|
Posted: Mon Dec 17, 2007 8:02 am Post subject: |
|
|
Lovely set of tips from bssteph, which I'm quoting directly (not put in quotes as it makes it harder to read):
Random incomplete tips for the budding Gentoo user:
* Use a breakbox if you can early on, when you're still getting your Gentoo legs. Put it on something you don't care about too much and go nuts. Even if it isn't your only Gentoo box, have that be the one where you try out an overlay, or switching to ~arch, or whatever.
* Don't plow through big updates. My "rule" is as follows: less than a month, unless the package list is huge, emerge -uDN world is safe. Otherwise, do things in parts, if the system is working fine. emerge -uDN cups, make sure that works, make sure everything works with the new glibc, and then (and ONLY then) move on to KDE or the next thing with 20 or so packages to upgrade. It saves a lot of headache, leaves a system with a better chance of being usable after each step, and makes determining what broke much easier.
* NEVER plow through dispatch-conf (or whatever you use to update your config files). If you can't spend time on each config file immediately after an update, making sure you merge the configs correctly, leave it be and don't reboot/restart any related services until you can get to the configs. NEVER reboot with a dispatch-conf run pending.
* Pay attention to every new package and changed USE flag in an emerge -pvuDN world. A new package here means new deps, obviously. Find out if the deps are optional, see if you should perhaps be using a different (new) package to replace that USE flag that just went away. Trust emerge, but never blindly accept it.
* Clean out your world file every now and then, removing packages that are deps of other packages in world, unless you remember wanting that specific package. (That is, unless you were writing code that used it, you probably don't need libpng in your world file, you only want USE="png".) This can clear up funny problems or point you to better alternatives, especially with virtuals. (Example: I had a FAM library in my world file (I don't even remember the name of it) and it would occasionally spin and take 100% CPU in KDE. One day I did some cleaning and let emerge install gamin, which was the default choice for FAM, which turned out to work much better.)
* Use --depclean. Even if you always --pretend it, just do it to get a sense of things. You may not run the --depclean, but you may still identify some packages you can remove. Look for stuff you don't use anymore when poking around in your world file (or the bold items in emerge output, these days).
* Run one of those cruft scripts, or write your own, for older boxes, but by all means, only if you're perfectly comfortable with it. Verify its output before removing anything.
* Look at /var/log/messages every now and again.
If those points worry you or seem wholly unacceptable, this may not be the distro for you. Sorry. It's a tough thing to say, especially without offending, but in my experience, not being mindful of things like the above will just lead to worse problems later. |
|
| Back to top |
|
 |
bssteph l33t


Joined: 26 Feb 2003 Posts: 648 Location: Wisconsin
|
Posted: Tue Dec 18, 2007 12:50 am Post subject: |
|
|
Hah! Very nice, I approve. (I thought while writing that maybe hidden in some unrelated thread isn't the best place for them, but looks like you solved that.) Feel free to clean them up or whatever. There are probably dozens of such little tips/headache avoiders floating around, keep threads like this coming. _________________ Website - All sorts of nonsense (some of it actually Linux related) |
|
| Back to top |
|
 |
steveL Veteran

Joined: 13 Sep 2006 Posts: 1441 Location: The Peanut Gallery
|
Posted: Mon Dec 31, 2007 1:42 am Post subject: Reinstalling python |
|
|
Great post from delta407 on reinstalling python if you're unfortunate enough to lose it (written *ages* ago and still working in Dec 2007 apparently!):
You might be able to reinstall Python using this:
| Code: | # cd
# tar xzf /usr/portage/distfiles/Python-2.2.1.tgz
# cd Python-2.2.1
# ./configure --with-fpectl --infodir=/usr/share/info/ --mandir=/usr/share/man
# make
# make install prefix=/usr
# rm /usr/bin/python 2>/dev/null
# ln -s /usr/bin/python2 /usr/bin/python |
Hopefully this will be enough of Python to let you "emerge python" again.
---
Another in same thread from desultory: (more recent)
If the python interpreter is actually nonfunctional, as opposed to some mishap with configuration or selection, try the following.
Download the package from the tinderbox repository which matches the architecture of the system. Place that file in $PKGDIR on that system. Then unpack that package directly under /, tar xvjf $PKGDIR/python-2.4.4-r6.tbz2 should do it, though $PKGDIR will likely need to be manually expanded as it is not typically present in the environment. Next ln -s /usr/bin/python2.4 /usr/bin/python. Finally, emerge -K dev-lang/python. |
|
| Back to top |
|
 |
steveL Veteran

Joined: 13 Sep 2006 Posts: 1441 Location: The Peanut Gallery
|
Posted: Sat Jan 12, 2008 8:29 am Post subject: Using a binhost |
|
|
PORTAGE_BINHOST="http://tinderbox.dev.gentoo.org/default-linux/<arch>"
PKGDIR="/path/to/store"
in make.conf; http://tinderbox.dev.gentoo.org/html/ is the browse page.
PORTAGE_BINHOST="http://dev.gentooexperimental.org/binpkg/i686-stable" is another good one (there's an amd64 one as well, and unstable variants), with more desktop stuff.
If you do use these, consider donating some money to help the people who provide the binhosts, or they'll get shut down if they use too much resource. For gentoo, it's solar who runs it: I'm sure any help can just go to Gentoo itself, and for gentooexperimental, it's bonsaikitten who you can find in #gentoo-chat on irc.freenode.org.
You can use update with -g or -G for nice support for binhosts over the web. You can also put binHost=1 or binOnly=1 in /etc/update to do this on every run. |
|
| Back to top |
|
 |
steveL Veteran

Joined: 13 Sep 2006 Posts: 1441 Location: The Peanut Gallery
|
Posted: Sun Feb 03, 2008 8:53 pm Post subject: How to get a package stabilised |
|
|
From this post by Coldwind:
You can look through your package.keywords and spot those that annoy you, then you look if they work fine and have been for at least 30 days in ~arch. If those requisites are met, then file a stabilisation bug. That's an easy way to contribute to make stable tree better ;-)
this applies to anybody who is capable of checking the ChangeLog to see how much time was the ebuild in the tree, search bugzilla for related bugs, and file a bug.
A template bug is something like this:
Product: Gentoo Linux
Severity: Enhacement
Summary: Stabilize foo/bar-1.0
Description:
foo/bar-1.0 is in the tree for X time and works fine on amd64.
emerge --info:
<Paste emerge --info output here>
..or something like that. If the maintainer thinks it's fine to stabilize, he'll CC ATs and they'll stabilize the package, if not, the bug will stay open or closed with LATER.
If bug is closed or ATs are not CC'ed, DON'T TAKE IT AS AN OFFENSE, probably there's a reason for not stabilizing the package yet. |
|
| Back to top |
|
 |
steveL Veteran

Joined: 13 Sep 2006 Posts: 1441 Location: The Peanut Gallery
|
Posted: Thu Apr 17, 2008 10:29 am Post subject: |
|
|
Here's a one line fn to search for a package in any overlay (blame xenoterracide ;), stick it in .bashrc. NB you need to emerge html2text first.
| Code: | | search() { [[ $1 && $1 != *[[:space:]]* ]] && curl -s "http://gentoo.zapto.org/packages/search?description=$1" | html2text -nobs|awk '/results for query/ { i=1 }; (i && $1 != "[Home]") { print }'; } |
Note that it requires network connectivity and thanks to zapto :)
Last edited by steveL on Thu Apr 17, 2008 11:11 am; edited 1 time in total |
|
| Back to top |
|
 |
XenoTerraCide Veteran


Joined: 18 Jan 2004 Posts: 1418 Location: MI, USA
|
Posted: Thu Apr 17, 2008 10:33 am Post subject: |
|
|
it's all my fault  _________________ I don't hang out here anymore, try asking on http://unix.stackexchange.com/ if you want my help. |
|
| Back to top |
|
 |
steveL Veteran

Joined: 13 Sep 2006 Posts: 1441 Location: The Peanut Gallery
|
Posted: Thu Apr 17, 2008 11:40 am Post subject: |
|
|
Hehe, yup :)
I like your blogs and the ideas xenoterracide, but don't agree with forking Gentoo. Yeah there are some people in it I can't stand, and I think they do a grave disservice to everyone else, most especially the people who provide the software, but I don't care about them. Hopefully they'll leave me alone (and my /ignore list includes all of them;) and it'd be doing the other 99.99% a disservice to tar them with the same brush.
Hopefully things'll get better once the new Trustees sort out the Foundation, the officers and the finances. I don't really expect them to make much of an impact on the social side (which is under their remit and always has been) until they get that done, and I wouldn't want them to shirk it in any way.
In any event I can just go offline for a bit when I get fed up of the trolls: life's too short to let other people spoil the fun ;P |
|
| Back to top |
|
 |
XenoTerraCide Veteran


Joined: 18 Jan 2004 Posts: 1418 Location: MI, USA
|
Posted: Thu Apr 17, 2008 11:59 am Post subject: |
|
|
| Quote: | | but don't agree with forking Gentoo |
The nice thing is, you don't have to .
Honestly though, I hope it doesn't come down to that. I hope new council/trustees whatever do better, than what has been happening. But something just seem to be in grid lock (in other words the people making the decisions don't seem to care). Like I said though, I hope that a fork isn't the solution.
| Quote: | | I like your blogs and the ideas xenoterracide |
Thanks, hopefully enough like them to actually implement them. _________________ I don't hang out here anymore, try asking on http://unix.stackexchange.com/ if you want my help. |
|
| Back to top |
|
 |
steveL Veteran

Joined: 13 Sep 2006 Posts: 1441 Location: The Peanut Gallery
|
Posted: Sun Aug 24, 2008 4:20 am Post subject: DEBUG build: the officially approved method ;p |
|
|
Something like this is how we do phase hooks; this is in bashrc, but you can do similar stuff in an /etc/portage/env/cat/pkg file by just using the function and not the surrounding if.
| Code: |
DEBUG_PKGS='sys-libs/glibc some-other/thing'
if hasq "$CATEGORY/$PN" $DEBUG_PKGS; then
pre_pkg_setup() {
local x
for x in installsources splitdebug ; do
if ! hasq "$x" $FEATURES; then
elog "bashrc is adding $x to FEATURES for $PN"
FEATURES+=" $x"
fi
done
if ! hasq -ggdb $CFLAGS; then
elog 'bashrc is adding "-ggdb" to CFLAGS for '"$PN"
CFLAGS="$CFLAGS -ggdb"
fi
}
fi
unset DEBUG_PKGS
|
Many thanks to zmedico for this, and ofc for the excellent package manager that we know and love, which has built every Gentoo system out there ;-)
Bear in mind the earlier post on the first page; I'd use this for supporting libs/apps, and add -g3 (CFLAGS) and -gdb (LD) for stuff we actually follow. wrt splitting, it's not an issue for stuff compiled via gcc (including C++, Fortran..) but would be for any other compilation system afaik. If you're on 32-bit, you'll want to strip -fomit-frame-pointer (it doesn't have any effect on 64-bit aiui) as in the previous post. |
|
| Back to top |
|
 |
steveL Veteran

Joined: 13 Sep 2006 Posts: 1441 Location: The Peanut Gallery
|
Posted: Sat Sep 06, 2008 1:36 am Post subject: Getting cron jobs to run as a service |
|
|
Running a cronjob as a service which isn't allowed to login will give pam errors. This topic from gagern shows how to fix it:
To solve this, edit /etc/pam.d/fcron and add the option "broken_shadow" to the account line like this:
| Code: | -account required pam_unix.so
+account required pam_unix.so nullok broken_shadow |
This tells fcron that it is OK to run as a user that has no password, not even a password line in the shadow password file. On my system, the "apache" user has no shadow line. In that case "broken_shadow" alone without "nullok" would be OK. But I guess there might be other setups or other system accounts where there is a shadow line but the password is empty. In those cases the "nullok" would be required. As only root's crontab can designate jobs to be run as different users, there should be not much of a security impact in loosening both those restrictions.
With this in place, a job like this (in root's crontab) should work:
| Code: | | @runas(apache) 1d /some/cleanup/script |
Alternatively, Casshan shows how to use the apache user's crontab:
| Code: | | crontab -u apache -e |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|