Search Results: "dpk"

23 September 2006

Joey Hess: The Top Ten Unix Shell Commands

I'm mostly participating in this particular thing because it seems to have changed since I tried this last. For one thing, ikiwiki didn't exist last time I tried it, also I don't remember seeing svn on the list last time.
joey@kodama:~>history 1 awk ' print $2 ' awk 'BEGIN  FS=" "   print $1 ' sort uniq -c   sort -r  head -10 
    229 l
    129 cd
    126 e
     48 mutt
     43 fg
     42 svn
     40 w
     26 ..
     24 ./ikiwiki.pl
     22 build
I use zsh, so this summarises several thousand lines of history shared amoung all my zsh sessions, and also .. is used to go up a directory. l is my shorthand for ls; e is my shorthand for "vim or the closest available substitute"; w is mostly a nervous habit since this is a single user machine -- my hands tend to type w and ls at the terminal when my mind is off working on something; build is my dpkg-buildpackage wrapper.

20 September 2006

Simon Richter: Wacky ideas #6: cross-only architectures

There are a few packages that provide headers or libraries for platforms that there is no Debian port to, prominent examples being mingw32 and Palm. Usually, there aren't more than just a few libraries for each, so that in real world scenarios, you end up adding a fair bit of stuff on your own. Now, wouldn't it make sense to define these as "cross-only" architectures, split out the runtime into the new arch, and use dpkg-cross to install them. For this to work, we need cross-architecture dependencies; mingw would depend on libkernel32-dev for mingw32, and I'd patch libz to compile out of the box for it, because this is usually the first library I need.

Simon Richter: Wacky ideas #3: encoding the ABI outside of the package name

Debian has had a big problem in the past when ABIs changed in incompatible ways. We would have to recompile all shared libraries after changing their package names, and then recompile the applications that used them, in the entire process always making sure that a compiler that generated code for the "new" ABI was installed on the autobuilders. Therefore, I'd like to suggest a new field, ABI: that would list the ABI versions a package was compiled against. The source package's control file would list those that the package was sensitive against, and dpkg-gencontrol would then, with the help of a few plug-ins, fill in the versions. In order to know for which dependencies matching ABI versions are important, we'd have to split the Depends field. On the archive side of things, when a new binary package is uploaded that is already present with a different ABI, the package would get renamed (by adding the differing ABI fields between version number and architecture name) in order to keep the archive cacheable.

Simon Richter: Wacky ideas #4: using symbol versioning information in dpkg-shlibdeps

This one has progressed a bit already, thanks to formorer, and IMHO it would be really cool to see it in etch. Currently, the shlibs file maps library name and soname version to a dependency specification that is added to shlibs:Depends. However, some libraries have more fine-grained version information than the one in the soname, in their symbol version table, which basically allows us to create less strict dependency relationships for versioned libraries. If a program only requires symbols versioned GLIBC_2_0, we know that the minimum required version is the one that has all of these symbols, which is probably some pre-sarge version. Incidentally, the libraries where a version bump in the shlibs file is most annoying, namely libc, libstdc++ and libdb, are already versioned, and no changes are required in the application packages, so there is an instant win here (and the main reason I want to see this in etch is that we can use it afterwards)

4 September 2006

Margarita Manterola: Maintainer Scripts diagrams updated

When looking at 372148, I found out that my maintainer scripts diagrams had the same bug that Policy currently has. Also, these diagrams used to document a bug in dpkg, regarding the state a package was left when removed or purged; which was fixed long ago, but I had never had the time to update them accordingly. Tonight, finally, I've updated them. And I've also made my test-suite package much more tidy, so that now I can publish it for anyone to grab it, and use it to test which maintainer scripts are called in some particular case. The dia sources, the png images, and the packages I used for the tests are all available here.

28 August 2006

Alexander Schmehl: Note to myself:

When moving packages from one package to an other, take special care for proper Replaces: and Conflicts: lines. Oh... and when finally testing the upgrades, don't waste your time testing it with plain dpkg on the command line. It will fail. You'll need to test it with apt-get or aptitude directly.

22 August 2006

Alexander Schmehl: Note to myself:

When moving packages from one package to an other, take special care for proper Replaces: and Conflicts: lines. Oh... and when finally testing the upgrades, don't waste your time testing it with plain dpkg on the command line. It will fail. You'll need to test it with apt-get or aptitude directly.

Jordi Mallach: XFS nightmares

Following up to madduck's and gwolf's recent horror stories on XFS, last Thursday, my desktop greeted me after the fantastic week around Asturies with a series of I/O errors whenever I tried to execute something. I rebooted, and then the kernel wasn't happy.
I/O error in filesystem ("hda1") meta-data dev hda1 block 0x4a9778  ("xlog_iodone") error 5 buf count 1024
/dev/hda1 is my / partition, and the machine would not boot at all. To make things more interesting, the box refused to boot from any of my old CD and DVD drives. Yesterday, with my mail piling up already at Sindominio's mailserver, I managed to find a spare CD writer, which would not open its tray, and a DVD reader which managed to boot a Breezy Live CD I had around. The good guys at #xfs were helpful as always and helped me in the process of not fucking up my valuable root filesystem while trying to fix it. The filesystem ended up having quite some corruption here and there, but after xfs_repair, nubol was able to boot again. Only it was missing libldap.so.2, libX11.so.6, debconf programs and other minor details like those. Some reinstall rounds later, GNOME was able to startup without errors and now the box is up and running. Does anyone know of some script that compares dpkg's contents database with that the filesystem has, so I can easily find the rest of damaged packages to reinstall them?

19 August 2006

Erich Schubert: Frustrating reuse of applications

Debian has a small app named "savelog" which can rotate logfiles, compressing the old versions and rotating filenames. It's used in a couple of startup scripts and cron jobs. The script is labeled logrotate_exec_t in SELinux, giving it the appropriate permissions to modify logfiles. However, it's also used to rotate backup files of e.g. /var/lib/dpkg/status; which is not a log file; the backups are kept in /var/backups, which is somewhat appropriate. However, the files in the backup dir are labeled backup_store_t, and I'm not sure if I want all logrotate apps to be able to write there... It would be nice if we wouldn't have

10 August 2006

Martin F. Krafft: Through with XFS

I am through with XFS, once and for all. Well, at least for laptops. I still think it's a good filesystem when you can ensure that the power never goes, and your hardware is reliable, but it's just not adequate for laptops or even desktops. I ran into some serious problems a while ago, but managed to recover. Two nights ago, however, three XFS filesystems on my laptop decided to blow up and left my system thoroughly broken. I guess as the hibernate maintainer, I should really start doing my tests somewhere else than my main system... It all started out with a dist-upgrade and this output:
dpkg: error processing /var/cache/apt/archives/dpkg_1.13.22_i386.deb
(--unpack): unable to make backup link of
'./usr/share/man/man1/dpkg-deb.1.gz' before installing new version: Unknown
error 990
Looking at /usr/share/man/man1, I started to anticipate the apocalypse:
# ls -l /usr/share/man/man1
total 7956
?????????? ? ? ?    ? ? ? 7zr.1.gz
?????????? ? ? ?    ? ? ? 822-date.1.gz
?????????? ? ? ?    ? ? ? CA.pl.1ssl.gz
?????????? ? ? ?    ? ? ? Defoma::Common.1.gz
So I look at the log, and amidst kernel oops notices, there's this lovely cookie:
Filesystem "hda6": Corruption of in-memory data detected.  Shutting down
filesystem: hda6
Filesystem hda6 is /usr, so at that time I figured "it could have been worse", booted to single user, and remade the filesystem with the intention to simply reinstall all packages... when I found /var/lib/dpkg/info to be in similar condition. The rest of /var seemed fine, but I resolved then that there was no hope in reviving this system. Fortunately I brought an external drive that had just enough free space to hold my /home and some other stuff, but since USB is really slow when it comes to shifting large amounts of data, I decided to do something productive in the mean time and to answer some outstanding mails. It wasn't difficult to get SSH back up, so I started to work on a remote machine and used the time efficiently. Some time later, though, I got confused in the mist of screen sessions and was browsing my home directory on the laptop, thinking I was elsewhere (my home directories are mostly synchronised), when I noticed a directory in similar condition as the above. Oh shit. Imagine my pain and fear as I first thought my remote machine was also dying, imagine the sigh when I found out I was on the local filesystem, and imagine the shock when I realised that /home was also affected by the XFS breakage... A glance around /var confirmed that the XFS breakage was actually spreading and had now affected three filesystems on this machine. Fortunately, by that time, I had copied everything to the external drive, and decided to put my laptop and myself to sleep. I woke the next morning to the task of reinstalling the thing and decided to be optimistic about it. After all, a reinstall would mean I could finally try partman-crypto and encrypt my laptop's data to protect against leaking sensitive stuff in the case of loss or theft of my laptop. The installation was not as painless as I had hoped, but that was mainly because I ran into a known problem with the graphical installer and partman-crypto, which does not allow to set up volumes with random encryption keys (e.g. swap; see the forthcoming announcement for the beta3 release of the installer), and a bunch of smaller bugs. I had to restart the installation with the traditional frontend to get what I wanted, but other than that, I was very impressed with what our installer development team has accomplished! And a special round of gratitude to Frans Pop for not losing his patience while helping me on several occasions throughout the process. Now, 24 hours after the incident, I am back to normal with a fresh laptop and no data lost (except for one directory which I pulled from a mirrored remote machine; it had no local modifications (so why did XFS screw it up anyway?)). The fonts are all jaggy, so there's something I have to figure out. All things considered, I am sad to have lost 24 hours, but I can also relax more now, without fear of further XFS breakage or loss of private data. Update: Oh, and despite this, I did choose ext3 for all my laptop's filesystems. JFS was really cumbersome and slow last time I tried it, and I surely would not touch RazorFS after experiencing serious data loss on numerous occasions. Update: Two responses so far. Full ack for Julien (except for him laughing at me), Ingo's post warrants a reply though. First, ext3 is also journaled, and if you're about to say "yeah, but it's a hack on top of ext2, well... ext2 is damn mature, and journaling isn't really rocket science, so that "hack" isn't going to be too complicated. In fact, I like the idea of journaling being an option rather than a built-in feature. Second, of course you're supposed to keep backups. But since you keep backups, my top requirement of a filesystem is not "how to get the data back", but "how to ensure it does not break. If it breaks, I can reinstall and restore from backup, but that's a certain amount of time lost. If it doesn't break, well, that's like stealing a little something back from death then, isn't it? Third, I do follow the linux-xfs mailing list, but so what? I did not have write cache enabled, and I was running the 2.6.17.7 kernel at the time of the mishap. Lastly, you point to "excellent tools" to recover the filesystem. I am not sure how excellent xfs_repair really is when it reports "bad magic number 0x0 on dir inode 4696727" during the run, claims to have fixed it, I mount the filesystem, unmount it, run xfs_repair again and get the same message. No filesystem is perfect, and as we know from Biella's problems (among many others, ext3 is no exception. But we did get her data off! So then it's really an open field again, crap filesystem against crap filesystem. I guess at this point it helps to know that ext3 actually follows VFS semantics, while on XFS, a completed sync() syscall does not actually mean it has written the data to disk (see e.g. #317479). And then there are bugs like #239111... ext3 it is for now. If that let's me down, I'll try JFS. If that fails and noone has actually implemented a proper filesystem, I might have a go myself. Haha. Update: Alceste Scalas adds:
Ingo is right when he says that every filesystem has bugs --- but bugs apart, the design of Ext3 (i.e. its physical-block journaling) makes it a far more reliable choice for desktop and laptop PCs, expecially for people without an UPS. An Ext3 filesystem could only crash because of a bug or an hardware failure, while an XFS filesystem can be trashed even without bugs or hardware failures, due to the unavoidable consequences of a power loss on PC-class hardware.
He also alerted me to this mailing list post, which compares data=ordered journaling of ext3 (which almost noone does for performance reasons) with XFS and RazorFS. Update: You may also be interested in this post. Update: Otavio Salvador points me to this FAQ entry, which SGI must have added very lately. It explains how to deal with the directory corruption that was part of my problem. I guess I would have liked to know earlier, but I consider the outcome with dm-crypt + ext3 a win anyhow.

6 August 2006

Daniel Jacobowitz: Look Ma, I can blog too!

I've been meaning to set up a blog to keep track of random things that I run into and feel like sharing. One of those happened today, so I finally figured out how to install blosxom. I haven't gotten around to making a pretty CSS for it yet (not sure if I ever will, but I can pretend...) so for now it's somewhat utilitarian and default-looking. Blosxom is pretty bare-bones without plugins, and while Blosxom itself seems well documented the plugins are much less so. I spent about ten hours mucking around with the minimal set of plugins I needed to get something acceptable (timezone, autoblock, feedback, entriescache, interpolate_conditional, permalink, cooluri2, lastmodified, and a bunch of modified templates to use feedback and permalink). I tried and then discarded followsymlinks and metadate (for not playing well with other plugins I was using) and entries_index (lastmodified wanted something which set %others, so I used entriescache instead). I needed to hack lastmodified to work with entriescache, since it cleverly gets the timestamps from the cache, which are now publication dates. So here's a slightly modified lastmodified plugin which stats files directly. I spent a while getting RSS to behave, too. I used lastmodified to set lastBuildDate, modified the story template to use permalinks which were acceptable to feedback (it wants .rss on the end or it decides they aren't story pages), and eventually figured out that I needed to set <guid> to prevent liferea from thinking each modified post was new by comparing descriptions. All in all it was far more work than I meant to do last night when I decided this was a good idea. Hopefully I haven't messed it up too badly. We'll see whether I upset Planet. Leave me a note if it makes your feed reader unhappy, or something. I was actually going to use ikiwiki, but chickened out at the last moment; blosxom had fewer dependencies and I didn't want to mess around with getting ikiwiki to install on sarge. And it still seems to be evolving - so while it's wicked cool, I think I'll let it have a little more time to settle first. I spent most of this morning messing around with OpenWRT. I bought a LinkSys WRT54G quite a while ago (to replace a flaky D-Link DI-614+), and put OpenWRT on it. It took a little work to get it to do what I wanted, including fixing a quoting bug in the WPA startup script and tracking down an updated dnsmasq, but eventually I got it set up. Mostly the stock things: NAT, firewalling, wireless with WPA2, DHCP, internal DNS. Except that it can do one thing that none of the stock firmwares could: provide static DHCP addresses to specific boards, including custom options. This was absolutely essential for me to retire my old DHCP server, since I keep an embedded board lab in my office. I need the DHCP server to be able to tell boards where to get kernels and root filesystems. Anyway, it works well. Except that I've been having too many dropped connections lately and I have no way to track down whether it's the laptop (Dell Latitude D400, ipw2200 - mostly in Windows lately, I haven't retested it in Ubuntu in a bit) or the AP. I updated the Windows drivers and now it periodically tries to rekey, fails, reports "duplicated RSN" whatever that means, and periodically reports authentication failures. About the same as before except that now it has better diagnostic tools to tell me in undocumented messages what went wrong, instead of just telling me that something went wrong. So I next went looking for an updated driver for the other end. Which was a mistake. Note to others: if most of your packages are on a cromfs, running "ipkg update" is going to tear through your available MTD space really fast. And ipkg is not graceful at updates the way dpkg is; it failed to upgrade base-files due to file conflicts, leaving the updated dnsmasq unable to start. These are the same sorts of conflicts that you see in apt-get upgrade periodically: files moving from one package to another without sufficient package relationships (or in ipkg's case, maybe sufficient package manager support) to do it seamlessly. Then when I retried the update it succeeded, but it wiped out my firewall config and password file without asking. I don't really blame OpenWRT for this. "ipkg update" just isn't a good idea with their tools. But I miss apt. And I really miss 2.6 kernels; the binary-only Broadcom drivers that power the WRT54G only work on 2.4.30. And it's tight on flash/RAM anyway. So I went looking at options. Obviously, I can't get something that does exactly what I want for the kind of mass-market price the WRT54G sells at. But a suggestion from a coworker sent me looking at Mini-ITX systems, like the nice-looking Mini-Box M200. And at smaller things, like the WRAP WiFi and Soekris boards. I haven't done a hardware project of any sort since last summer, so I'm thinking about building myself an access point with benefits. I haven't decided what the benefits will be yet - if I get something like one of the Soekris boards, probably just bigger compact flash and back to dnsmasq for internal DHCP. But if I get a Mini-ITX system, I can throw a hard drive in it, arrange over-the-network backups, and use it as an incoming mail hub. This would let me decomission one of the always-on computers in my office. A mighty attractive proposition, although a bit less so now that the heat wave has broken.

5 August 2006

Junichi Uekawa: Big fan of sshfs.

You can mount remote filesystems if ssh (sftp) works.Local commands can be used with remote filesystems.Handling too large files may cause network bandwidth problems, but it's useful.For example, Packages and Sources files, the index files forDebian packages, requires dpkg-scanpackages/dpkg-scansourcesto build.When the remote server isn't Debian based, it's abit difficult to execute these commands on the remoteserver.Here comes sshfs.You can mount the remote filesystem, and use the commands locally.

2 August 2006

Luciano Bello: cuasi-custom kernel in a non-traditional way

I'm averse to compile programs for productive machines. Lot's of developers and maintainers have been working (and work) hard to make a wonderful binary for you. But sometimes you need a customization. Especially if it's about a kernel. I was needed support for 8GB ram.

Most of the people would download a kernel from www.kernel.org, would configure it and would compile it.

If it's about a Debian user, he would probably compile it by-the-Debian-way, with make-kpkg.

But I only needed a really small change from the debian official kernel image. So, I tried to made a custom kernel image, without wasting the work from the kernel team, making as less changes as possible.

$ apt-get source kernel-image-2.6.8-3-686-smp
$ vi kernel-image-2.6.8-i386-2.6.8/config/686-smp

Add support for HighMem64G:

CONFIG_HIGHMEM64G=y

wq!

In order to not generate all the images for all the platforms (I'm not sure that i386, k7, etc. are platforms) I delete those files from kernel-image-2.6.8-i386-2.6.8/config:

$ rm 386 686 k7 k7-smp

Then... let's bulid a package (compile in a DD-way :P)!

dpkg-buildpackage

And now I have a package with my non-too-much-custom-kernel-image, ready to be used.

31 July 2006

Enrico Zini: ninth-day-in-addis

Ninth day in Addis SSH To enable remote logins with ssh apt-get install openssh-server Then you can login with:
$ ssh efossnet@proxy.dream.edu.et
To verify the host key fingerprint of a machine:
$ ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub
Note: you need to verify it before logging in! More information at http://www.securityfocus.com/infocus/1806 Example ssh usages To log in:
    $ ssh efossnet@proxy
To run a command in the remote computer:
    $ ssh efossnet@proxy "cat /etc/hosts"
To copy a file to the remote computer:
    $ scp Desktop/july-18.tar.gz efossnet@proxy:
To copy a file from the remote computer:
    $ scp efossnet@proxy:july-18.tar.gz /tmp/
Beware of brute-force login attempts Warning about SSH: there are people who run automated scans for ssh servers and try to login using commonly used easy passwords. If you have an SSH server on the network, use strong passwords, or if you can it's even better to disable password authentication: in /etc/ssh/sshd_config, add:
    PasswordAuthentication no
To log in using public/private keys:
  1. Create your key:
    ssh-keygen -t rsa
    
  2. Copy your public key to the machine where you want to log in:
    ssh-copy-id -i .ssh/id_rsa.pub efossnet@proxy
    
  3. Now you can ssh using your RSA key
If you use ssh often, read these: proxy Problems we had today with the proxy: ssl does not work Reason: squid tries to directly connect to the ssl server, but the AAU network wants us to go through their proxy. Ideal solution: none. There is no way to tell squid to use a parent proxy for SSL connections. Solution: update the documentation for the Dream university users telling to setup a different proxy for SSL connections. Longer term solution: get the AAU network admins to enable outgoing SSL connections from the Dream university proxy. Other things that can be done: Browsing normal pages returns an error of 'Connection refused'. In the logs, the line is:
1153294204.912    887 192.168.0.200 TCP_MISS/503 1441 GET http://www.google.com.et/search? - NONE/- text/html
That "/503" is one of the HTTP error codes. Explanation of the error codes: Reason: the other proxy is refusing connections from our proxy. Solution: none so far. Will need to get in touch with the admins of the other proxy to try to find out why it refuses connection to our proxy, and how we can fix the problem. postfix on smtp.dream.edu.et Basic information is at http://www.postfix.org/basic.html. Difference between mail name and smarthost: Quick way to send test mails:
apt-get install mailx
echo ciao   mail efossnet@localhost
To configure a workstation not to do any mail delivery locally and send all mail produced locally to smtp.dream.edu.et:
  1. install postfix choosing "Satellite system"
  2. put smtp.dream.edu.et as a smarthost.
To setup a webmail: apt-get install squirrelmail (on a working apache setup). To setup mailing lists: apt-get install mailman, then follow the instructions in /usr/share/doc. Mail server issues we encountered When a mail is sent to efossnet@localhost, the system tries to send it to efossnet@yoseph.org Investigation: Cause: the user efossnet had forgotten that he or she had setup a .forward file in the home directory. Solution:
 rm ~efossnet/.forward
Apache To add a new website:
  1. cd /etc/apache2/sites-available
  2. sudo cp default course
  3. sudo vi course:
    1. Remove the first line
    2. Add a ServerName directive with the address of your server: ServerName course.dream.edu.et
    3. Customize the rest as needed: you at least want to remove the support for browsing /usr/share/doc and you want to use a different document root.
  4. sudo a2ensite course
  5. sudo /etc/init.d/apache2 reload
More VIM Undo: u (in command mode) Redo: ^R (in command mode) You can undo and redo multiple times. To recover a lost password for root or for the ubuntu admin user Boot with a live CD, mount the system on the hard disk (the live CD usually does it automatically), then edit the file /etc/shadow, removing the password:
enrico:$1$3AJfasjJFHa234dfh230:13343:0:99999:7:::
becomes:
enrico::13343:0:99999:7:::
You can edit the file because, in the live CD system, you can always become root. After you do this, reboot the system: you can log in without password, and set yourself a new password using the command passwd. Installing packages not on the CDs To get a package for installing when offline:
  1. apt-get --print-uris install dnsmasq
  2. Manually download the packages at the URLs that it gives you
Otherwise, apt-get --download-only install dnsmasq will download the package for you in /var/cache/apt/archives. You can install various previously downloaded debian packages with:
dpkg -i *.deb
Backups There are various ways: Some data requires exporting before backing it up: You can schedule these dumps to be made one hour before the time you make backups. Scheduling tasks As a user:
crontab -e
As root: add a file in one of the /etc/cron.* directories. In cron. hourly,daily,weekly,monthly you put scripts. In the other directories you put crontab files (man 5 crontab). If the system is turned off during normal maintainance hours, you can do two things:
  1. Change /etc/crontab to use different maintanance hours
  2. Install anacron (it's installed by default in ubuntu)
For scheduling one-shot tasks, use at(1):
$ at 17:40
echo "Please tell Enrico that the lesson is finished"   mail efossnet@dream.edu.et
^D
When and how to automate
  1. First, you manage to do it yourself
  2. Then, you document it
  3. Then, you automate it
Start at step 1 and go to 2 or 3 if/when you actually need it. (credits to sto@debian.org: he's the one from which I heard it for the first time, said so well). Interesting programs to schedule during maintanance Important keys to know in a Unix terminal These are special keys that work on Unix terminals: Therefore, if the terminal looks like it got stuck, try hitting ^Q. Problems we had today with postfix Problems found yesterday and today

27 July 2006

Enrico Zini: Ninth day in Addis

SSH To enable remote logins with ssh:
apt-get install openssh-server
Then you can login with:
$ ssh efossnet@proxy.dream.edu.et
To verify the host key fingerprint of a machine:
$ ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub
Note: you need to verify it before logging in! More information at http://www.securityfocus.com/infocus/1806 Example ssh usages:
  • To log in:

    $ ssh efossnet@proxy
    
  • To run a command in the remote computer:

    $ ssh efossnet@proxy "cat /etc/hosts"
    
  • To copy a file to the remote computer:

    $ scp Desktop/july-18.tar.gz efossnet@proxy:
    
  • To copy a file from the remote computer:

    $ scp efossnet@proxy:july-18.tar.gz /tmp/
    
Warning about SSH: there are people who run automated scans for ssh servers and try to login using commonly used easy passwords. If you have an SSH server on the network, use strong passwords, or if you can it's even better to disable password authentication: in /etc/ssh/sshd_config, add:
PasswordAuthentication no
To log in using public/private keys:
  1. Create your key:

    ssh-keygen -t rsa
    
  2. Copy your public key to the machine where you want to log in:

    ssh-copy-id -i .ssh/id_rsa.pub efossnet@proxy
    
  3. Now you can ssh using your RSA key

If you use ssh often, read these:
proxy Problems we had today with the proxy:
  • ssl does not work. Reason: squid tries to directly connect to the ssl server, but the AAU network wants us to go through their proxy. Ideal solution: none. There is no way to tell squid to use a parent proxy for SSL connections. Solution: update the documentation for the Dream university users telling to setup a different proxy for SSL connections. Longer term solution: get the AAU network admins to enable outgoing SSL connections from the Dream university proxy. Other things that can be done:

    • report a bug on squid reporting the need and requesting the feature
    • download squid source code and implement the feature ourselves, then submit the patch to the squid people
  • Browsing normal pages returns an error of 'Connection refused'. In the logs, the line is:

    1153294204.912    887 192.168.0.200 TCP_MISS/503 1441 GET http://www.google.com.et/search? - NONE/- text/html
    
    That "/503" is one of the HTTP error codes. Explanation of the error codes:
    Reason: the other proxy is refusing connections from our proxy. Solution: none so far. Will need to get in touch with the admins of the other proxy to try to find out why it refuses connection to our proxy, and how we can fix the problem.
postfix on smtp.dream.edu.et http://www.postfix.org/basic.html Difference between mail name and smarthost:
  • The mail name is the name of the mail server you're setting up (TODO: need more details on what's it used for)
  • The smarthost is the name of the mail server that will relay mail for you.
Quick way to send test mails:
apt-get install mailx
echo ciao   mail efossnet@localhost
To configure a workstation not to do any mail delivery locally and send all mail produced locally to smtp.dream.edu.et:
  1. install postfix choosing "Satellite system"
  2. put smtp.dream.edu.et as a smarthost.
To setup a webmail: apt-get install squirrelmail (on a working apache setup). To setup mailing lists: apt-get install mailman, then follow the instructions in /usr/share/doc. Mail server issues we encountered:
  • When a mail is sent to efossnet@localhost, the system tries to send it to efossnet@yoseph.org

    Investigation:
    • "yoseph.org" does not appear anywhere in /etc or /var/spool/postfix
    • postfix configuration has been reloaded
    • postfix logs show that the mail has been 'forwarded'
    Cause: the user efossnet had forgotten that he or she had setup a .forward file in the home directory. Solution:
    rm ~efossnet/.forward
    
Apache To add a new website:
  1. cd /etc/apache2/sites-available

  2. sudo cp default course

  3. sudo vi course:

    1. Remove the first line

    2. Add a ServerName directive with the address of your server:

      ServerName course.dream.edu.et
      
    3. Customize the rest as needed: you at least want to remove the support for browsing /usr/share/doc and you want to use a different document root.

  4. sudo a2ensite course

  5. sudo /etc/init.d/apache2 reload

More VIM Undo: u (in command mode) Redo: ^R (in command mode) You can undo and redo multiple times.
To recover a lost password for root or for the ubuntu admin user Boot with a live CD, mount the system on the hard disk (the live CD usually does it automatically), then edit the file /etc/shadow, removing the password:
enrico:$1$3AJfasjJFHa234dfh230:13343:0:99999:7:::
becomes:
enrico::13343:0:99999:7:::
You can edit the file because, in the live CD system, you can always become root. After you do this, reboot the system: you can log in without password, and set yourself a new password using the command passwd.
Installing packages not on the CDs To get a package for installing when offline:
  1. apt-get --print-uris install dnsmasq
  2. Manually download the packages at the URLs that it gives you
Otherwise, apt-get --download-only install dnsmasq will download the package for you in /var/cache/apt/archives. You can install various previously downloaded debian packages with:
dpkg -i *.deb
Backups There are various ways:
  • dump (for ext2/ext3 file systems) or xfsdump (for xfs file systems). Makes a low-level dump of the file system. It must be used for every different partition. It makes the most exact backup possible, including inode numbers. It can do full and incremental backups. To see the type of the filesystems, use 'mount' with no parameters. To restore: restore or xfsrestore.

  • tar Filesystem independent. It can work accross partitions. It correctly backups permissions and hard links. It can do full and incremental backups. Example:

    tar lzcpf backup.tar.gz /home /var /etc /usr/local
    tar lzcpf root.tar.gz /
    
    To restore:
    tar zxpf backup.tar.gz
    
  • faubackup Filesystem independent. Uses hard drive as backup storage. Always incremental. It cannot do compression. Unchanged files in new backups are just links to old backups, and do not occupy space. Any old backup can be deleted at any time without compromising the others. It can be used to provided a "yesterday's files" service to users (both locally and exported as a read-only samba share...). To restore, just copy the files from the backup area.

  • amanda apt-get install amanda-client amanda-server It is a network backup system. It can do full and incremental backups. You can have a backup server which handles the storage and various backup clients that send the files to backup to the server. It takes some studying to set up. To restore: it has its own tool.

Some data requires exporting before backing it up:
  • To save the list of installed packages and the answer to configuration questions:

    dpkg --get-selections > pkglist
    debconf-get-selections > pkgconfig
    
    To restore:
    dpkg --set-selections < list
    debconf-set-selections < pkgconfig
    apt-get dselect-upgrade
    
    If you do this, they you only need to backup /etc, /home, /usr/local, /var.
  • To save the contents of a MySQL database:

    mysqldump name-of-database   gzip > name-of-database.dump.gz
    
    To restore:
    zcat name-of-database.dump.gz   mysql
    
You can schedule these dumps to be made one hour before the time you make backups.
Scheduling tasks As a user:
crontab -e
As root: add a file in one of the /etc/cron.* directories. In cron. hourly,daily,weekly,monthly you put scripts. In the other directories you put crontab files (man 5 crontab). If the system is turned off during normal maintainance hours, you can do two things:
  1. Change /etc/crontab to use different maintanance hours
  2. Install anacron (it's installed by default in ubuntu)
For scheduling one-shot tasks, use at(1):
$ at 17:40
echo "Please tell Enrico that the lesson is finished"   mail efossnet@dream.edu.et
^D
When and how to automate
  1. First, you manage to do it yourself
  2. Then, you document it
  3. Then, you automate it
Start at step 1 and go to 2 or 3 if/when you actually need it. (credits to sto@debian.org: he's the one from which I heard it for the first time, said so well).
Interesting programs to schedule during maintanance
  • rkhunter, chkrootkit
  • checksecurity
  • debsecan
  • tiger
Important keys to know in a Unix terminal These are special keys that work on Unix terminals:
  • ^C: interrupt (sends SIGTERM)
  • ^\: interrupt (send SIGQUIT)
  • ^D: end of input
  • ^S: stop scrolling
  • ^Q: resume scrolling
Therefore, if the terminal looks like it got stuck, try hitting ^Q.
Problems we had today with postfix
  • Problem: mail to efossnet@dream.edu.et is accepted only if sent locally. Reason:

    $ host -t mx dream.edu.et
    Host dream.edu.et not found: 3(NXDOMAIN)
    
    Solution: tell dnsmasq to handle a MX record also for dream.edu.et:
    mx-host=dream.edu.et,smtp.dream.edu.et,50
    
  • The problem not solved with the previous solution. Reason: postfix was making complaints which mentioned localhost as a domain name. Solution: fixed by changing 'myhostname' in main.cf to something different than localhost. Note: solved by luck. Investigate why this happened.

Problems found yesterday and today:
  • there is no way to tell squid to use another proxy for SSL connections: it only does them directly

  • if you want to configure evolution to get mail from /var/mail/user, you need to explicitly enter the path. It would be trivially easier if evolution presented a good default, since it's easy to compute. It would also be useful if below the "Path" entry there were some text telling what path is being requested: the mail spool? the evolution mail storage?

  • In Evolution: IMAP or IMAPv4r1? What is the difference? Why should I care?

  • apt-get --print-uris doesn't print the URIs if the package is in the local cache, and there seems to be no way to have it do it.

  • in /etc/apache2/sites-available/default, is the NameVirtualHost * directive appropriate there? It gets in the way when using 'default' as a template for new sites. Otherwise, one can add a new (disabled) site that can be used as a template for new sites instead of default.

  • the default comments put by crontab -e are not that easy to read.

23 July 2006

Amaya Rodrigo: The /usr/doc transition

Quote from Joey Hess: In 1999, Debian began moving /usr/doc to /usr/share/doc to comply with the FHS. Due to unfortunate dpkg issues at the time, we couldn t simply move the directory and be done with it, but decided to move things peicemeil by updating all packages. Due to some silly concerns about users having to look in two places during the transition, we decided to start by making /usr/doc/ -> /usr/share/doc/ symlinks. In 2001, putting any documentation in /usr/doc became a serious policy violation. The symlinks were still allowed. In 2002, we completed the first stage of the transition, released woody with complete /usr/share/doc and /usr/doc directories, and policy was changed to not require the /usr/doc symlinks. debhelper was changed to stop adding postinst and postrm fragments to manage the links, and so most packages only needed a recompile to finish the transition. As a result, More than 250 bugs were filed, blockers of #322762. Most of these bugs, rot in peace in the BTS for years, some maintainers fixed them themselves, some other maintainers NMUed and others did QA uploads to deal with this issue. But it was not enough. It looks like at a certain point I decided we would not ship Etch with a transition from 2002 still in progress, so I did approximately 114 NMUs between the 11th and the 18th of July, fixing 152 bugs, 46 of which were not related to the /usr/doc transition. I also closed the ones affecting packages not in testing or unstable, unblocked the ones for packages that would not ship with etch (as exim3, that will be replaced by exim4), and updated the MIA info for several of the maintainers. At the same time, I revamped packaging a bit if I felt inspired to do so. Sure, things went wrong at bits and places, which I later fixed the best I could, but inmense love was poured in these NMUs. Several maintainers thanked me and the most NMU-unfriendly people didn't even complain. Lars Wirzenius pointed me to other related bugs, found by upgrading from testing to unstable with piuparts, and added blocking relationships with #322762 where needed. At this stage, less than 5 open bugs remain. I suspect that more packages once created this link and don t remove it on upgrade. I would need some help to find them. All this NMU fever happened while Joey was away on holidays, and when he returned, he confirmed my fears, I had DoSed his email and bandwidth: <joeyh> amaya: did you have to fix all the /usr/doc bugs while I was on vacation?
* joeyh watches his inbox and BW groan at the seams :-)
There is still several important and minor issues that we should deal with before Etch is released, Release Goals or not, just because we are Debian, and just because we care about this sort of things: Some of you will argue that these might not be transitions per se, just mass-bugfilings. I don t really care how you d rather call it. If you are looking for easy ways to help Debian, or to fill your lazy summer afternoons with, provide a patch today and CC: me. I intend to group these bugs either using user-tags or blocking bugs in the BTS. Help locating them and grouping them will also be appreciated. [Updated entry to reflect more accurate NMU and bug totals]

13 July 2006

Enrico Zini: First pratical lesson

Notes after today's training session. Small index of most used shell commands:
  • ls - list directory contents
  • cp - copy files and directories
  • mv - move (rename) files
  • rm - remove files or directories
  • find - search for files in a directory hierarchy
  • cat - concatenate files and print on the standard output
  • more - file perusal filter for crt viewing
  • less - opposite of more (quit with 'q')
  • cd - Change the current directory to DIR. (use "help cd" instead of "man cd")
  • mkdir - make directories
  • rmdir - remove empty directories
Small index of commands useful for combining in pipelines:
  • grep, egrep, fgrep, rgrep - print lines matching a pattern
  • tail - output the last part of files
  • head - output the first part of files
  • sort - sort lines of text files
  • uniq - report or omit repeated lines
  • sed - stream editor
  • wc - print the number of newlines, words, and bytes in files
Problems found during the lesson:
  • You set the system default locale to Amharic, and the gdm login will be in Amharic input mode. We didn't find out how to switch it back to input roman characters. Right click on the input field to set the input method doesn't work. Since usernames are not in Amharic, you're locked out.

  • So you CTRL+ALT+F1, login and try dpkg-reconfigure locales. On Ubuntu Dapper, it does not work anymore.

  • So you dig and dig and dig and finally find that you can force a locale in /etc/default/gdm (but not in /etc/gdm/locale.conf, nor in /etc/gdm/gdm.conf).

  • Then the internet works for a bit and you look up how to reconfigure locales in Ubuntu. Turns out you have to use localeconf, which is not installed by default, is not in universe and thus not on the CDs, and needs to be downloaded from the Internet.

  • The Ubuntu wiki is all on https, which defeats any attempt of proxy caching.

  • An Internet proxy needs to be configured 3 times: in Gnome, in Firefox and in Synaptic (well, apt). This is especially tricky when you forgot to setup the proxy in Synaptic and seemingly unrelated applications fail, like the Ubuntu language selector, which internally invokes the package manager to download missing langpacks.

  • Some short descriptions in the NAME section of manpages are hard to understand, or wrong. Noted on apt-get, apt-cache and less. Top prize goes to apt-cache:

    NAME
           apt-cache - APT package handling utility -- cache manipulator
    DESCRIPTION
           [...] apt-cache does not manipulate the state of the system but
           does provide operations to search and generate interesting output
           from the package metadata. [...]
    
    So apt-cache is a manipulator that doesn't manipulate. A possible improvement can be "query the APT package cache".
  • The language selector in Ubuntu Breezy doesn't really exit and keeps the package database locked. This seems to be fixed in Dapper, and probably had been fixed in some Breezy update. System updates here are a problem: my Dapper (with some Universe things in it) wanted to download more than 120Mb of data, and the Uni network was giving me 14Kbps. It's been a nice opportunity to teach about fuser -uva and kill.

  • dict, squid and many other packages from 'main' are not on the normal Ubuntu CDs: is there an easy way to build a CD with them? Or do Ubuntu CDs with extra packages already exist? I'll have to find out.

  • cupsys has documentation outside of /usr/share/doc, in /usr/share/cups/doc-root.

  • man works on all commands, except cd, which is an internal shell command and thus needs help instead of man. I should remember to ponder about autogenerating manpages from help output.

  • Is there an index-like manpage with a list of the core Unix commands and their short descriptions? It there's not, it's easy to generate:

    #!/bin/sh
    DIR=$ 1:-"/bin" 
    (
    find $DIR   while read FILE
    do
       if [ -x $FILE ] && ! [ -d $FILE ]
       then
               LANG=C COLUMNS=2000 man  basename $FILE    \
                     grep ^SYNOPSIS -B 100   grep ^NAME -A 100   \
                     tail -n +2   head -n +2   \
                     grep -v '^[ \t]*$'
       fi
    done
    )   sort   uniq   sed 's/^ \+//'
    
    Try running it on /bin and /sbin: it's great!. Also, since it doesn't redirect stderr, it nicely exposes a number of manpage problems.
Lots of bugs to report when I come home: from here it'll take ages, and lots of money on the hotel internet connection, and some are Ubuntu-specific so I'd need to do everything online with Malone. As usual, teaching is one of the best ways to find bugs. I propose an Etch training session a month before release. Other things to do:
  • Find more info about that Wikipedia live CD with Wikipedia browsable without the Internet.
  • Make a collection of Free technical E-books: even those Indian low-cost book editions are too expensive here, so E-books mean a lot.

12 July 2006

Carlos Villegas: testing ubuntu's readahead (SoC2006)

The base distribution I'm using for Sid changed slightly by installing ssh. There was no boot time difference. The new base bootchart (same time 49 sec) is here.

Based on a discussion in initscripts-ng-devel between Petter Reinholdtsen and Erich Schubert, I decided to try ubuntu's readahead to see if we will get a better or worst boot time. After installing ubuntu's readahead 1.0.1-2 but noticed not time difference. No difference was obtained by changing the boot order (S39 to S19 in rcS.d) nor by adding files read at /etc/readahead/readahead. The bootchart is here

Also tried the newer readahead from ubuntu readahead 0.20050517.0220-0ubuntu3 but now with a loss of 1 second. This includes two scripts S01readahead and S39readahead-desktop in rcS.d and S99stop-readahead in rc2.d. The bootchart is here

Next I'll try to analyze the SUSE static preload.

Besides I filed an bug (377941) to initramfs-tool I had with installing Etch on my laptop with a usb harddisk. Tried adding sleep 5 to /usr/share/initramfs-tools/scripts/init-premount/udev, then dpkg-reconfigure linux-image-.... but still fails :(

17 June 2006

Julien Blache: The joy of a rushed python upgrade

Here’s what you get when your python maintainer is too busy working on Ubuntu, unwilling to team maintain the thing in Debian, and finally rushes an upgrade :
dpkg: error processing python2.4 (--remove):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct NULL not valid
zsh: abort sudo apt-get -f install
Not happy at all. Even the modular X.org transition went better than this. Oh, and CUPS is b0rked too. Less than 6 months before our target release date for Etch, this really doesn’t sound too good.

13 June 2006

Bartosz Fe&#324;ski: What package is eating up my disk space?

What about something like that?
$dpkg-query -W --showformat='$ Installed-Size  $ Package \n'   sort -n

Next.

Previous.