Search Results: "spa"

28 September 2006

Evan Prodromou: 5 Vend miaire CCXV

Being an inveterate domain-name registerer, I've got a lot of domains sitting around doing nothing. I've only recently stumbled across Bruce Perens's Open Source Parking site. It's a clever idea -- transferring those parked domains on GoDaddy and other registrars to a page with ads for FOSS projects. tags:

Adieu John Our friend John Usher bugged out to wt:Banff today. He's off to the Banff Centre to finish up the research he did on his Ph.D. and do some more work on goofy, crazy audio projects in the healthsome mountain air. According to John, it's really nice at the Centre, but if you go outside you have to clap all the time to keep grizzly bears away. I'm not sure if that's for real or just a prank that the locals play on visiting scientists. John's been here a few weeks -- it was really good to have him. Our apartment is just a bit too big, and I've enjoyed the space most when we have a friend or relative staying in the guest bedroom. I think in the year or so that we've lived here it's been occupied about 30-40% of the time. I know Amita June will miss having Mononc John around. They get along really well, and I was hoping that AJ would pick up some UK turns of phrase like "tickety-boo" and "manky". I'm particularly charmed by the English use of the word "cheers", which seems to be analogous to the way like Hawaiians use "aloha"; it means hello, good bye, thank you, and Mmmm! Beer!. A fine word used by fine people. tags:

Postfix fix Over the last few days I've been tightening down on the amount of spam I get in my Inbox by trying to cut it off at the MTA (mail server) level. I have a lot of different email addresses, and I use a mix of mail forwarding and multiple IMAP or POP3 inboxes to bring everything together into one nice little bundle. I do some Bayesian filtering on the client side, and I have a call to use Vipul's Razor in my .procmailrc files, but it's great to filter this stuff further up the data path, too. Fortunately the three servers that get me the most mail all run Postfix. Postfix has some nice common-sense features that cut down on spam right out of the box. First, I made sure all three servers used wp:DNSBL lists to block open relay servers. Second, I added some checks for validity on sender address domain and domain in the HELO command. Finally, I added a filter to check the Sender Policy Framework to see if the connecting server is authorized to send mail for the sending address's domain. Of the three changes, I've found that the basic checks -- making sure that sender address domains and HELO hostnames are valid -- are blocking the most mail. But the other two kinds of checks help, too. This all came not a moment too soon, as the wikitravel.org mail server seems to be under another DDOS attack. Check out the numbers on the mail that's queued versus what's getting rejected!
evan@antipater:~$ sudo grep NOQUEUE /var/log/mail.log.0   wc -l
119150
evan@antipater:~$ sudo grep qmgr.*removed /var/log/mail.log.0   wc -l
590
Gee, three orders of magnitude difference... I'm getting about 50-50% on other servers. This is over the last 24 hours or so -- what a huge waste of time. tags:

27 September 2006

Uwe Hermann: Towards a moderately paranoid Debian laptop setup [Update]

I was planning to set up my laptop from scratch for a while now... so I did. Preparation BIOS Installation / Setting up full-disk encryption using dm-crypt
  • Enable shadow passwords. Allow login as root (I feel confident that I won't do stupid things as root).
  • Choose a good root password, and a (different) good user password. Don't enter a full name for the user.
  • Choose the latest kernel (old kernels might have security issues). Do not participate in popcon.
  • Do not install any tasks (no "desktop", no "base system"). We want the smallest installation possible, and add only the packages we really need. Fewer packages means fewer security issues (statistically).
  • That's it. Eject the CD-ROM, reboot, change the BIOS to only allow booting from hard drive.
  • Post-installation tasks Networking, Upgrading and Apt-secure SELinux Now install and set up SELinux. This section is based on notes from Erich Schubert (thanks!), and will soon appear in the SELinuxSetup wiki page, too. Behaviour Further ideas That's it. You can take off that stupid tin-foil hat now. Update 2006-09-29: Fixed typos. Mentioned sxid. Added two-factor authentication.

    Uwe Hermann: Towards a moderately paranoid Debian laptop setup

    I was planning to set up my laptop from scratch for a while now... so I did. Preparation BIOS Installation / Setting up full-disk encryption
  • Enable shadow passwords. Allow login as root (I feel confident that I won't do stupid things as root).
  • Choose a good root password, and a (different) good user password. Don't enter a full name for the user.
  • Choose the latest kernel (old kernels might have security issues). Do not participate in popcon.
  • Do not install any tasks (no "desktop", no "base system"). We want the smallest installation possible, and add only the packages we really need. Fewer packages means fewer security issues (statistically).
  • That's it. Eject the CD-ROM, reboot, change the BIOS to only allow booting from hard drive.
  • Post-installation tasks Networking, Upgrading and Apt-secure SELinux Now install and set up SELinux. This section is based on notes from Erich Schubert (thanks!), and will soon appear in the SELinuxSetup wiki page, too. Behaviour Further ideas That's it. You can take off that stupid tin-foil hat now.

    Gunnar Wolf: Fell pray to the meme...

    Sigh... Here I go again :)
    gwolf_at_mosca:~$ history awk ' print $2 ' awk 'BEGIN FS=" " print $1 ' sort uniq -c sort -rn head -10
         81 svn
         33 cd
         29 find
         28 perl
         28 ls
         27 grep
         26 for
         21 man
         17 export
         14 cat
    At least, it clearly shows that I've been teaching my workmates on the benefits of Subversion. Anyway, with only 500 lines of Bash history I'm keeping, it's hard to make this into a trend. I doubt this would coincide with the pkg-perl sprint a bit over a week ago.
    Still, I call perl interactively (well, if that's what "interactive" means) a little bit too much :)

    Russell Coker: tcpdump and ps

    Today I was doing some network tracing and figured out how to track the start and end of TCP connections. The following tcpdump command will get all SYN, FIN, and RST packets on port 80 and all ICMP packets:

    tcpdump -i bond0 -n "port 80 and tcp[tcpflags] & (tcp-syn tcp-fin tcp-rst) != 0 or icmp"

    Also recently I was tracking down some minor security issues related to programs that call setuid() to drop privs but never call setgid() and therefore always run with GID==0 which gives them a lot of access to the system. The following ps command gives the real, effective, saved, and filesystem UIDs and GIDs mapped to names. Note that with some versions of ps different fields have different truncation lengths.

    ps -eo pid,user,euser,suser,fuser,group,egroup,sgroup,fgroup,comm

    The next thing I have to do is to patch PS to show the supplementary groups.

    26 September 2006

    Alexander Sack: mozilla-thunderbird / mozilla security updates available for preview

    I uploaded another round of security updates for mozilla and mozilla-thunderbird to my security preview archive. The preview build for firefox will be made available from the same location in a day or two. The versions of concern here are:
    CODE:
    mozilla 2:1.7.8-1sarge7.3.1
    mozilla-thunderbird 1.0.2-2.sarge1.0.8c.1
    If you see any NEW bugs, let me know. Thanks

    Amaya Rodrigo: $age++, 0x1F

    I became 31 yesterday. On a Monday. It had to be a Monday.

    The coolest part was this "you are too old to get the right amount of candles on your cake, so you'll get hexadecimal candles". It was a loving hack.

    0x1F

    Thanks to all those came for dinner, I loved the presents, and your company, inmensely.
    To all those who called (and called, and called)... sorry for turning off the phone. Damn, I hate calls on Mondays!

    Evan Prodromou: 3 Vend miaire CCXV

    We had a busy day today. Our friend John Usher, an ebullient genius from the bubbly town of wt:Beer in wt:Devon has spent the last few years on a Ph.D. in Music (sound recording) at McGill University here in Montreal. He finished his thesis last spring, but due to scheduling conflicts with his board of advisors he couldn't defend the darn thing for several months. So he's been bopping around different parts of the world -- Chile, Beer (of course), France and such -- and has been crashing in our extra room for the last week or so now that he's back in town. He defended his thesis today, so Maj and I went to see the presentation. I'd never been to a thesis defense before, and it was different than I expected. I was picturing something along the lines of a parole hearing, with perhaps some fraternity hazing thrown in, but it was actually a very public lecture about his research. There were maybe 30 people in attendance -- friends, board, and curious department members -- and John gave a great lecture about his work. As one of his panel members from the Psychology department said, "You've done a good job making this really complicated issue clear enough that I could almost understand it." It's pretty great when you see someone you like and respect really shine in what they do best, and John absolutely shone today. His thesis is on the abstruse subject of audio-spatial imaging -- how we can tell where the source of a sound is -- but he made it clear enough that I could follow along -- almost. tags:

    25 September 2006

    Aurelien Jarno: Cheap ARM development machine

    You want a cheap ARM development machine to test your packages? You can actually have one for free (both as in beer and as in speach :) ) provided that you have a not to slow i386, AMD64 or PowerPC computer. The solution is called QEMU, a generic and open source processor emulator which can emulate i386, x86_64, ARM, MIPS, PowerPC and Sparc systems. Running an Athlon 64 3800+ the emulated system is around 20% faster than the popular NSLU2 and possibly with much more RAM (my emulated system has 256 MB of RAM). I have written a small howto explaining how to install Debian Etch on such an emulated ARM machine. Note: I have written this howto very quickly, so there are probably some mistakes. Comments are welcome.

    Russell Coker: Ethernet bonding

    Bonding is one of the terms used to describe multiple Ethernet cables used to form a single virtual network link. This can be done for performance or reliability.

    Bonding for performance used to be common when 100baseT was the fastest network technology that was commonly available. In 1999 servers could usually sustain considerably more than 10MB/s so a single 100baseT network interface was a performance bottleneck. At that time I worked with Cisco switches and Solaris machines that had up to four 100baseT links bonded for performance.

    Nowadays Gigabit Ethernet is commonly available, most laptops have Gigabit Ethernet on the motherboard. Gigabit PCI cards are as cheap as $35, and Gigabit switches can be purchased for as little as $139. Server hardware is a little more expensive, but it's still quite cheap and commonly available.

    Most people don't need more than Gigabit speed, in fact most systems can not saturate a Gigabit link due to poor application design, a slow operating system, or slow disks used to provide the data. So at this time there is little speed for bonded Gigabit networking for performance.

    There is still the issue of reliability. Often you want to have two ethernet cards and cables configured so that if one breaks the network won't go down.

    One annoying thing about bonding in Linux (in 2.6.x kernels) is that the module has to be loaded separately for each bond interface, and the parameters for an interface can't be changed without unloading and loading the driver (very painful if you log in to the machine via ssh over the bonded interface to do sys-admin work).

    The parameters I have in /etc/modprobe.conf for bonding are:

    alias bond0 bonding
    options bond0 mode=1 arp_interval=500 arp_ip_target=192.168.0.1

    This means that if there is no traffic on the link then every 500ms an ARP request will be sent for the address 127.128.129.130 (I used the address of my router but substituted a different value for this blog entry). An ARP request for a machine on the local LAN is a request that will always be satisfied if the machine in question and the network link are working.

    The idea is that you have two switches and every computer that matters has two ethernet ports. If one port stops working (broken Ethernet card, cable, or router) then the other takes over.

    The special file /proc/net/bonding/bond0 can be used to view the current configuration of the bond0 device.

    Below are sample configuration files for Fedora and Red Hat Enterprise Linux to configure bonding:


    /etc/sysconfig/networking/devices/ifcfg-bond0:
    DEVICE=bond0
    IPADDR=192.168.0.2
    NETMASK=255.255.255.0
    NETWORK=192.168.0.0
    BROADCAST=192.168.0.255
    ONBOOT=yes
    BOOTPROTO=static
    # GATEWAY should be the IP address to ARP ping
    GATEWAY=192.168.0.1
    TYPE=Ethernet

    /etc/sysconfig/networking/devices/ifcfg-eth0
    DEVICE=eth0
    BOOTPROTO=none
    HWADDR=xx:xx:xx:xx:xx:xx
    ONBOOT=yes
    SLAVE=yes
    MASTER=bond0
    TYPE=Ethernet

    /etc/sysconfig/networking/devices/ifcfg-eth1
    DEVICE=eth1
    BOOTPROTO=none
    HWADDR=xx:xx:xx:xx:xx:xx
    ONBOOT=yes
    SLAVE=yes
    MASTER=bond0
    TYPE=Ethernet


    Note that there is nothing preventing you from having more than two devices bonded together for reliability, but I doubt that you really need that.

    Adam Rosi-Kessel: Philadelphia Orchestra

    The Philadelphia Orchestra just announced the launch of an online store, where they are selling tracks directly from their own website. Following in the tentative steps of MySpace, eMusic, and Yahoo!, the Orchestra is selling unencumbered (i.e., DRM-free) MP3’s. Even better, for a slightly higher price, you can download content in the higher quality (lossless) FLAC format. Performances currently seemed to be priced at approximately $5 for the MP3 version and $6 for the FLAC version. This seems just about right to me. As an added bonus, they’re offering Beethoven’s Fifth in C minor for free. I’d love to see more of the industry move in this direction, particularly for longer-tail type cultural content like classical and world music. These recent developments are certainly a good start. It will be interesting to see if the iTunes Store eventually is forced to respond to these pressures.

    Philipp Kern: Trac spam

    Are you fighting Trac spam? We are, and receive massive amounts of it. We made most of the Wiki pages read-only and denied ticket state changes to anonymous users. But obviously this wasn't enough. It seems that Trac only deactivates the corresponding form on the ticket page. Of course we also deployed a little word list, but it needed to be hacked directly into the source code, so it's not something to provide as a patch. I wrote a little tool in Ruby which deals with ticket spam. It's the result of only two hours of work, thus there is some potential for extensions. It is supposed to work directly on the sqlite3 database, so it needs to run on the web server. So to despam our site we use this little wrapper (of course, that would need some adaption for others):
    #!/bin/sh
    ssh -t obby@darcs.0x539.de "\$HOME/despam.rb" $*
    Currently it provides the following functions:
    comment-spam -- Removes comment spam on a ticket.
    Parameter: ticket id
    state-change -- Removes spammed ticket state changes.
    Parameter: ticket id
    ticket-delete -- Removes a ticket with all correspondinginformation.
    Parameter: ticket id
    The interface is a bit darcs-alike, but sometimes you might get back to the beginning of the dialogue on invalid keystrokes and when you request help (i.e. a list of options). It works for me, and maybe it's helpful for others.

    24 September 2006

    Benjamin Mako Hill: PyBlosxom and Comment Spam

    Over the past few months, I've dealt with something of a blog spam nightmare on Copyrighteous: my blog running the PyBlosxom weblog software. Wiser and less stubborn individuals might given up on either PyBlosxom or the ability to receive public comments. However, I find PyBlosxom unique in its flexibility and great ReStructured Text support and am always frustrated with others' blogs that don't accept comments. At the end of the day, I couldn't bring myself to part with either. Historically, my blogspam protection has been to use a simple weak CAPTCHA and to have my blog software email me each time a comment is successfully submitted so that I can (with a built-in macro in mutt) delete each spam comment that slips in. This has worked well for the last couple years. This summer, Mika pointed out that my blog was full of Chinese link spam that I had not noticed or been notified about. Around the same time, I realized that my website had been dealt a massive spam penalty by Google and was basically not showing up in any search results. I have spent a significant amount of time over the last month repairing the damage and working to prevent it from reoccuring. I'm documenting this process here in the hopes that it might save other time and energy. Upon reflection, the situation could have been prevented the in three relatively easy ways -- all of which I have now implemented.
    • Had the PyBlosxom comment.py plugin's mail function been working properly, I would have known that I was being spammed.
    • Had PyBlosxom been configured to only make blog entries (and not comments) indexable by search engines, Google and others never would have seen the link spam.
    • Had I installed a stronger CAPTCHA, I might have blocked the spam from being submitted in the first place (although at the expense of the participation in comments by visually impaired users).
    A month or so, hours of work, and a Google reinclusion request later, my website is beginning to show up in search entries again. Hopefully this message will help save others from a similar fate. Fixing PyBlosxom's Comment Notification The most critical problem was a bug in PyBlosxom's contributed comment.py plugin and its comment notification system. In short, the email based comment notification system failed silently if the body of the email -- which included the full text of the comment -- included any non-ASCII UTF-8 encoded text. I've filed a bug against PyBlosxom and included a patch that fixes this issue. However, since this is a rather critical problem and because PyBlosxom releases tend to be few and far between, it might be worth patching your system now. My patch is against version 1.3 but can easily be modified and applied to version 1.2. Hiding Comments from Search Engines The major reason that the successful spam became a problem was that it triggered Google's abuse detector, resulted in a spam penalty, and made all of the (non-spam) material on my website more difficult for others to find. A simple way to prevent this is to hide all comments from the search engines. I've done this by creating a new PyBlosxom flavor that shows comments (and allows them to be input) which is not indexed by search Engines and to remove comments altogether from the default indexable flavors. To do this, I removed all of the comment-* templates from html flavor and created a new flavor called comment.flav that included the comment templates. I also had to make the comment submit action point to the new flavor and to change the "Comments: N" link to point instead to .comment flavor rather than the .html. The rest of the template is simply symbolic links to the the HTML template. The next step is to ensure that the comment flavor is not indexed by search engines. I found two ways of doing this and did both. The first was to add a "no index" meta tag to the header of each .comment page. It looked like this:
    <meta name="robots" content="noindex, nofollow">
    
    This is necessary because the robots.txt standard, the normal way to tell search engines not to index a page, does not support wildcards. Luckily, Google (and others I imagine) do support an extension to Robots.txt that allows you to use wildcards. To take advantage of this, I created a robots.txt for mako.cc that blocks indexing all of the comment flavor. The following robot.txt did the trick for me:
    User-agent: Googlebot
    Disallow: /copyrighteous/*.comment$
    
    An Improved CAPTCHA Ultimately, the best solution would be to keep the spam from showing up on the blog at all. The only decent PyBlosxom CAPTCHA is the "nospam" plugin by Steven Armstrong. It is a simple image-based CAPTCHA and I was running it when I was spammed. It uses PIL but generates purely number-based strings and does some minimum obfuscation. Basically, spambots were able to break the CAPTCHA and toward the end, I was receiving thousands of pieces of a blog spam a day. I've incorporated the PIL image generation code from Mediawiki's ConfirmEdit/FancyCaptcha extension into nospam.py with this patch which I have also sent to Steven Armstrong -- nospam.py's original author. It's much stronger. Apologies, of course, go to all of my vision impaired users. Image-based CAPTCHAs really are evil. In this situation though with many thousands of attempts of a day, the alternative is that I will turn off comments altogether -- the standard (and poor) lesser of two evils argument. Ultimately, I will write a python implementation of a new strong text-based CAPTCHA I've invented that uses commonsense knowledge and pulls off some cool data acquisition in the process. I presented this project at the Wikimania Hacking Days and at a Media Lab open house for AAAI 2006 where I got universally positive and useful feedback. CAPTCHA inventor and recent genius-grantee Luis von Ahn seemed to like the idea too. I'll write more about this on another day though.

    23 September 2006

    David Moreno Garza: Music in my brain on the last weeks

    Tato, Raquel and me headed to Cat Power’s concert last Wednesday. Luckily, I won two tickets for the concert on a morning radio show (it was around 6 am, so when the speaker asked a question, I had plenty of time to open my notebook, confirm the answer on Wikipedia and call the station; because of the time, the call entered quite quickly, on the 3rd try). It was a double, so Tato had to buy his own ticket. Chan Marshall, Cat Power’s real name, is quite interesting. She asked previously that people people should be quiet while performing because of her stage fright (!). She also likes to cut her songs abruptly complaining on the sound of the piano, tunes on the guitar, her voice, the accoustics on the place, etc. We also realized that her live performance is completely depressive, and the ambient of people (quiet, clapping to support her, proposals to marry her from girls) makes an outstanding and not common at all atmosphere. She played for like two hours in complete absense of noise (except when people clapped or shouted to ask for some songs, or to laugh at her jokes -like the one asking people what would be a better place to live, Mexico or Japan, guess the answer of people-). You could even hear beer bottles rolling in the halls and people doing like “shhhh”: the silence was terrific. She also played the day after, but that date was announced like one week before and didn’t get much people. No pics since from previous experiences, photos of my cell phone are completely sucky in darkness. Other concerts I’ve gone in the last weeks: The Strokes and Babas nicos. Next concerts I’ll be going: Yeah Yeah Yeahs (that’ll be fucking awesome, can’t wait for it). MiG and his girlfriend went yesterday to watch the Kung Fu Monkeys, a nice ska-punk band from Tijuana, but we were too tired to show up in the place. The day before, on Thursday, he also invited us to watch some surf bands, which scene is awesome in Mexico City, it was really nice and we had the chance to dance a bit. :-)

    Steve McIntyre: Tenerife conference (continued)

    I already started describing my time at JSLULL, the Free Software conference at La Laguna in Tenerife. It's been a few days since, and I'm now back at home and ready to summarise the rest. I should apologise up front that my memory of people's names is awful... :-( The slides from the talk are on my website now, in case anybody is interested, and my photos are up too. The original plan for Tuesday afternoon was to run a small Bug Squashing Party in one of the computer labs at ULL, but unfortunately this week the main internet link from ULL to Madrid had failed. It's a little difficult to work on bugs when you can't even get to the list, so we changed tack. Instead, I led a small workshop for interested people, demonstrating how to create Debian packages. About 8 people got involved, taking turns to drive the keyboard, ask and answer questions. People were keen to learn; there is a very active group in the University running the labs and other machines, and they were hoping to create packages of some of their own software to make maintenance and installation easier. I'm glad to help! ULL We went out to one of the beaches near Santa Cruz that evening, then headed back into the city later on for drinks and dinner. We had a very animated conversation about the use of Free Software in schools and local government, with the Spanish people and Knut Yrvin from Skolelinux trading interesting stories about their experiences. On Wednesday morning, a group of us rented a car and headed inland to visit El Teide, the huge volcano that dominates the Tenerife skyline. It's the first time I've ever looked down on clouds from the passenger seat of a car! We headed almost to the top, and visited the desolate plain just down from the last summit. It looked almost like a lunar landscape, untouched by water... Clouds! Later on that day, I headed back to the hotel in Santa Cruz and then on to the airport to catch my return flight to England. Carlos (again) had given up his time to chauffeur me around, and we chatting about all sorts of things while he drove south. Unfortunately, the flight was delayed by several hours because of mechanical problems. I would have been happy enough to have simply waited at the airport, but Carlos was having none of it. :-) He insisted we should go and have dinner together; we went for drinks at a beach bar, then up to his home village for a lovely meal. Eventually I caught my plane at 2:30am, and got back to England just in time to catch the rush hour traffic on the M25. Me and Carlos I spent a lovely couple of days in Tenerife, spending time and making friends with the very enthusiastic local Free Software hackers. I'd love to go back again soon and see more of the place. Thanks to all the of the people involved, you were very welcoming!

    22 September 2006

    Scott James Remnant: Upstart in Universe

    upstart is a replacement for the init daemon, the process spawned by the kernel that is responsible for starting, supervising and stopping all other processes on the system. The existing daemon is based on the one found in UNIX System V, and is thus known as sysvinit. It separates jobs into different “run levels” and can either run a job when particular run levels are entered (e.g. /etc/init.d/rc 2) or continually during a particular run level (e.g. /sbin/getty). The /etc/init.d/rc script is also based on the System V one (and is in the sysv-rc package), it simply executes the stop then start scripts found in /etc/rcN.d (where N is the run level) in numerical order. Why change it? Running a fixed set of scripts, one after the other, in a particular order has served us reasonably well until now. However as Linux has got better and better at dealing with modern computing (arguably Linux’s removable device support is better than Windows’ now) this approach has begun to have problems. The old approach works as long as you can guarantee when in the boot sequence things are available, so you can place your init script after that point and know that it will work. Typical ordering requirements are: This worked ten years ago, why doesn’t it work now? The simple answer is that our computer has become far more flexible: We’ve been able to hack the existing system to make much of this possible, however the result is chock-full of race conditions and bugs. It was time to design a new system that can cope with all of these things without any problems. What we needed was an init system that could dynamically order the start up sequence based on the configuration and hardware found as it went along. Design of upstart upstart is an event-based init daemon; events generated by the system cause jobs to be started and running jobs to be stopped. Events can include things such as: In fact, any process on the system may send events to the init daemon over its control socket (subject to security restrictions, of course) so there is no limit. Each job has a life-cycle which is shown in the graph below: The two states shown in red (“waiting” and “running”) are rest states, normally we expect the job to remain in these states until an event comes in, at which point we need to take actual to get the job into the next state. The other states are temporary states; these allow a job to run shell script to prepare for the job itself to be run (“starting”) and clean up afterwards (“stopping”). For services that should be respawned if they terminate before an event that stops them is received, they may run shell script before the process is started again (“respawning”). Jobs leave a state because the process associated with them terminates (or gets killed) and move to the next appropriate state, following the green arrow if the job is to be started or the red arrow if it is to be stopped. When a script returns a non-zero exit status, or is killed, the job will always be stoped. When the main process terminates and the job should not be respawned, the job will also always be stopped. As already covered, events generated by the init daemon or received from other processes cause jobs to be started or stopped; also manual requests to start or stop a job may be received. The communication between the init daemon and other processes is bi-directional, so the status of jobs may be queries and even changes of state to all jobs be received. How does it differ from launchd? launchd is the replacement init system used in MacOS X developed as an “Open Source” project by Apple. For much of its life so far, the licence has actually been entirely non-free and thus it has only become recently interesting with the licence change. Much of the goal of both systems appears initially to be the same; they both start jobs based on system events, however the launchd system severly limits the events to only the following: Therefore it does not actually allow us to directly solve the problems we currently have; we couldn’t mount filesystems once the “filesystem checked” event has been recived, we couldn’t check filesystems when the block device is added and we certainly couldn’t start daemons once the complete filesystem (as described by /etc/fstab) is available and writable. The launchd model expects the job to “sit and wait” if it is unable to start, rather than provide a mechanism for the job to only be started when it doesn’t need to wait. Jobs that need /usr to be mounted would need to spin in a loop waiting for /usr to be available before continuing (or use a file in a tmpfs to indicate it’s available, and use that modification as the event). This is not especially surprising given that Apple have a high degree of control over both their hardware and the actual underlying operating system; they don’t need to deal with the wide array of different configurations that we have in the Linux world. Had the licence been sufficiently free at the point we began development of our own system, we would probably have extended launchd rather than implement our own. At the point Apple changed the licence, our own system was already more suitable for our purposes. How does it differ from initng? Initng by Jimmy Wennlund is another replacement init daemon intended to replace the sysvinit system used by Linux. It is a dependency-based system, where upstart is an event-based system. The notion of a dependency-based system is interesting to talk about at this point. Jobs declare dependencies on other jobs that need to happen before the job itself can be started. Starting the job causes its dependencies to be started first, and their dependencies, and so on. When jobs are stopped, if running jobs have no dependencies, they themselves can be stopped. It’s a neat solution to the problem of ordering a fixed boot sequence and the problem of keeping the number of running processes to a minimum needed. However this means that you need to have goals in mind when you boot the system, you need to have decided that you want gdm to be started in order for it, and its dependencies, to be started. Initng uses run levels to ensure this happens, where a run level is a list of goal jobs that should be running in that run level. It’s also not clear how the dependencies interact with the different types of job, a dependency on Apache would need the daemon to be running where a dependency on “checkroot” would need the script to have finished running. Upstart handles this by using different events (“apache running” vs. “checkroot stopping”). Again while interesting, Initng does not solve the problems that we wanted to solve. It can reorder a fixed set of jobs, but cannot dynamically determine the set of jobs needed for that particular boot. A typical example would be that if the only dependency on the job that configures networking is the mount network filesystems job, then should that job fail or notbe a goal (e.g. because there are no network filesystems to be mounted) the result is that network devices themselves will not be configured. You could make everything a goal, and just use the dependencies to determine the order, however this is less efficient than just ordering the existing sysv-rc scripts (which can be done at install time). Another example is that often you simply don’t know whether something is a dependency or not without reading other configuration, for example the mount network filesystems may be a dependency of everything under /usr or may just be a dependency of anything allowing the user to login if it just mounts /home. The difference in model can be summed up as “initng starts with a list of goals and works out how to get there, upstart starts with nothing and finds out where it gets to.” How does it differ from Solaris SMF? SMF is another approach to replacing init developed by Sun for the Solaris operating system. Like initng it’s a dependency-based system, so see above for the differences between those systems and upstart. SMF’s main focus is serive management; making sure that once services are running, they stay running, and allowing the system administrator to query and modify the states of jobs on the system. Upstart provides the same set of functionality in this regard, services are respawned when they fail and system administrators can at any time query the state of running services and adjust the state to their liking. Will it replace cron, inetd, etc? The goal of upstart is to replace those daemons, so that there is only one place (/etc/event.d) where system administrators need to configure when and how jobs should be run. In fact, the goal is that upstart should also replace the “run event scripts” functionality of any daemon on the system. Daemons such as acpid, apmd and Network Manager would send events to init instead of running scripts themselves with their own perculiar configuration and semantics. A system administrator who only wanted a particular daemon to be run while the computer was on AC power would simply need to edit /etc/event.d/daemon and change “on startup” to “on ac power”. What about compatibility? There’s a lot of systems administrators out there who have learned how Linux works already and will not want to learn again immediately, there’s also a large number of books that cover the existing software and won’t cover upstart for at least a couple of years. For this reason, compatibility is very important. upstart will continue to run the existing scripts for the forseeable future so that packages will not need to be updated until the author wants. Compatibility command-line tools that behave like their existing equivalents will also be implemented, a system administrator would never need to know that crontab -e is actually changing upstart jobs. Does it use D-BUS?
    “To D-BUS people, every problem seems like a D-BUS problem.” —Erik Troan
    The UNIX philosophy is that something should do just one job, and do it very well. upstart’s one job is starting, supervising and stopping other jobs; D-BUS’s one job is passing messages between other jobs. D-BUS does provide a mechanism for services to be activated when the first message is sent to them, thereby starting other jobs. Some people have taken this idea and extended it to suggest that all a replacement init system need do is register jobs with D-BUS and turn booting into a simple matter of message parsing. This seems wrong to me, D-BUS would need to be extended to supervise these services, provide means for them to be restarted and stopped; as well as deal with being process #1 which means cleaning up after children whose parent’s have died, etc. It seems far simpler to arrange for D-BUS to send an event to init when it needs a service to be started, and focus on being a very good message passing system. The IPC mechanism used by upstart is not currently D-BUS because of various problems, however it’s always been expected that even if init itself doesn’t communicate with D-BUS directly, there would be a D-BUS proxy that would ensure messages about all init jobs and events would be given to D-BUS and D-BUS clients could send messages to init to query and change the state of jobs. What is the implementation plan? Because this is process #1 we are changing, we want to make sure that we get it right. Therefore instead of releasing a fully-featured daemon and configuration to the world, we’re developing it in the following stages:
    1. Principal development; at the end of this stage the daemon has been implemented and can manage jobs as described.
    2. Replacement of /sbin/init while running the existing sysv-rc scripts. This is the shake-down test of the daemon, can it perform the same job as the existing sysvinit daemon without any regressions?
    3. /etc/rcS.d scripts replaced by upstart jobs. These consitute the majority of tasks for booting the system into at least single-user mode, and contain many of the current ordering problems and race conditions. If the daemon solves the problems here, it will be a success.
    4. Other daemon’s scripts replaced by upstart jobs on a package-by-package basis; this will be an ongoing effort during which upstart will continue running the existing sysv-rc scripts as well as its own jobs. During this time the event system may be tweaked to ensure it truly solves the problems we need.
    5. Replcement of cron, atd, anacron and inetd. This will happen alongside the above and result in a single place to configure system jobs.
    6. Modification of other daemons and processes to send events to init instead of trying to run things themselves.
    The current plan is that we will be at least part of the way into stage #3 by the time edgy is released, with that release shipping with upstart as the init daemon and the most critical rcS scripts being run by it to correct the major problems For edgy+1 we hope to have completed stage #5 and be at least part of the way into the implementation of stage #6. From the start of development of edgy+2, no new packages will be accepted unless they provide upstart jobs instead of init scripts and init scripts will be considered deprecated. What state is it in now? The init daemon has been written and is able to manage jobs as described above, receiving events on the control socket to start and stop them. This has now been uploaded to the Ubuntu universe component in the upstart package for testing before it becomes the init daemon. We welcome any experienced users who want to help test this; install the package and follow the instructions in /usr/share/doc/upstart/README.Debian to add a boot option that will use upstart instead of init. If your system boots and shut downs normally (other than a slightly more verbose boot without usplash running) then it is working correctly. Other types of events will be added as required during development and testing. Currently only a basic client tool (initctl) has been written, compatibility tools such as shutdown will be written over the next week or two before it replaces our sysvinit package.

    Scott James Remnant: Parallel Peer Programming

    Here at Canonical Towers we have several staff who worship at the altar of Extreme Programming, and as such many of the methodologies and rituals prescribed by that religion find their way into our day-to-day working practices. A few of these came together in an interesting way a few weeks ago, and it was suggested by a cow-orker that I blog about it so he could give the URL to people. The first ritual is that of the sprint, I don’t think this is orthodox XP but rather something inspired from it that we picked up from the Python community. With all of the Canonical developers scattered across the globe mostly working from their own homes, it’s become a useful tool; particularly for the Launchpad team. The basic idea for those that haven’t heard of it is simple, and perhaps obvious; you get a selection of the team together in one place, sit them around the same table with particular goals to complete. In effect it’s highly compressed facetime and high bandwidth interaction to nail those tasks that need it, before you head off again and work at a more sedate pace. The second is directly from XP doctrine and is that peculiar observance known as pair programming, something that is often coupled with sprints. For anybody who hasn’t encountered this before, it’s something I’ve always found rather odd. You get two programmers together, both itching to code, and you take one of them’s laptop away; and you don’t just force them to fight over the keyboard either, the laptop-less soul isn’t allowed to touch it. The theory here is that it frees the deprived individual of the hassle of coding and allows them to direct the programmer in ways that may not be immediately obbious, or alternately think about the next bit of work that needs doing. Another interesting side-effect is it can be an interesting way to learn code you’ve not worked with before, if you’re the one doing the coding and you’re being guided what to do by a sage who already knows it. I have a funny story here, so I’m going to digress from the main stream for a moment to tell it. A few months ago I was working in the London office, Mark had been up all night coding and had then given me responsibility to get his changes landed onto the Launchpad mainline. I’m not that hot on quite a bit of Launchpad, and fade to utterly clueless the nearer the code gets to the web application itself; and when trying to merge the two there were conflicts which I needed Mark’s help to resolve. Now as anybody who’s met Mark knows, he’s a pretty good example of a Type-A personality, yet he suggested that we do a spot of pair programming to get the code in and I’d be the one with the laptop as it’d help me get to grips with the affected parts. This hilighted something I’ve always seen as a problem with pair programming, dealing with it when the a person with the keyboard has a totally different way of working to you. In particular, I’m an emacs user, whereas Mark is a die-hard vim user; but also right down to the working directory I would work from, how I test results, etc. When you’re the one without the laptop, this can be quite infuriating, as you know exactly how to solve a problem and the idiot with the keyboard is dithering about doing things you don’t understand just to get there. If you’re a Type-A personality, you generally snatch the laptop away at this point and do it yourself; or at least you would, if you could drive the strange editor the other person uses. I swear Mark was sulking as he gave the laptop back and let me do it. Anyway, there is some relevance to that and we’ll come to it in a moment. The third and final methodology is the concept of unit tests and more specifically test driven development. For anyone who hasn’t come across this before, I highly recommend it; I was suspicious too when Robert Collins took it upon himself to teach me the true way, but now I’m sold. Simply the idea is that if you have any code that doesn’t have another piece of code in a test suite that checks that it’s working correctly, that code is broken. More particularly unit testing involves checking just one feature or requirement at a time, and stacking them together to test all of the code paths. I’ve actually found that this improves the APIs I design, as I write the code in small blocks and functions to make them easier to test. Test driven development takes it even further, you write the unit tests first, before you write the code they’re supposed to test; usually one or two at a time. Obviously these tests will fail at first, it’s then your job to write as little code as possible to make them pass. If your code isn’t right, you add a unit test that will fail, and modify the code to make it pass. This really comes into its own when you’re fixing bugs later, once you’ve identified the bug you write a test case or two that cause the problem; these will of course fail. You can then modify the code to make them pass, and at the same time be sure you’ve not broken other functionality because of the existing test suite. I’ve also found it really useful for particularly complicated or tricky pieces of code, especially those intricate algorithms that do particularly heavy lifting. So onto the event itself, this was a sprint in our London office to indoctrinate Gustavo Niemeyer with the various projects he’d be working on. The goal for this sprint was decided to start the conversion of HCT to Bazaar-NG, and to do this Gustavo and I would pair program. Now my last experience of pair programming had been that story with Mark (see, it had some relevance) and I knew I’d be just as bad if I wasn’t allowed to have the keyboard. I was also acutely aware that if Gustavo was just sitting by and watching, he wouldn’t get much benefit from it either, so he needed to be actively involved in the coding so he could learn the things he’d be working on. I came to what I thought was a pretty neat, and obvious, solution to these problems. We set up my laptop with the code we’d be working on, and on my display were two side-by-side terminals both running screen sessions. Gustavo then set up two same-sized terminals on his, ssh’d into my laptop from both of them and joined the screen sessions. In the left-hand one he ran vi, and in the right-hand one I ran emacs. Thus we both had keyboards, and both had editors, yet could see each other working and even steal the keyboard without danger of violence. We didn’t just sit side-by-side and code on different things though, that’s not pair programming and is just ordinary programming with a bit of a voyeuristic twist. What we did was: in my terminal I started writing the test cases for the code we needed, it was Gustavo’s job to write the code that would make them pass. We actually added a third terminal in which we could run the test cases themselves; so I could run them when I’d added something that would fail, and Gustavo could run them when he thought he’d made them pass again. This turned out to be a rather fun way to work, and at one point I was almost able to try and convince myself that the code was writing itself to pass the test cases I was writing. It also got me thinking that it’d be really neat to use genetic algorithms to breed code to pass test cases.

    Sam Hocevar: Decision-making in Debian

    Quoting Rapha l Hertzog :
    My long term project always involved that decision-making would be shared between the donors and all Debian developers.
    IF THIS HAPPENS I SWEAR I QUIT. FUCK MONEY-BASED DECISION MAKING. I SHALL WISH FOR HERPES SIMPLEX AND ETERNAL HELLFIRE UPON THE INSOLENT WHO BRING IT TO DEBIAN. KEEP YOUR DUNG-TANK OUTSIDE DEBIAN.

    Martin F. Krafft: Why I don't work on Ubuntu (or at least one reason)

    Yesterday, the Debian package tracking system notified me of a new patch Ubuntu applied to mdadm:
    diff -pruN 2.4.1-6/debian/mdadm.init 2.4.1-6ubuntu4/debian/mdadm.init
    --- 2.4.1-6/debian/mdadm.init 2006-09-21 21:13:04.000000000 +0100
    +++ 2.4.1-6ubuntu4/debian/mdadm.init  2006-09-21 21:10:08.000000000 +0100
    @@ -1,4 +1,4 @@
    -#!/bin/sh -eu
    +#!/bin/sh -e
    #
    # Start the RAID monitor daemon for all active md arrays if desired.
    #
    
    The changelog entry goes out of its way to reason the change:
    Do not invoke init scripts with -u. Fixes dist upgrade from dapper to edgy mostlikely caused by /bin/sh pointing to dash.
    Of course, it's debateable whether set -u is applicable to an init.d script it causes the shell to barf when uninitialised variables are used, just like Perl's use strict;. I think set -u is good practice and I use it everywhere. My /bin/sh also points to /bin/dash, and I cannot say that I've never run into problems. However, the fixes are usually quite trivial. I consider Ubuntu's change a hack fixing symptoms, not causes. Due to the immense time pressure under which the core team is maintaining the main parts of the distribution, I can imagine such hacks to be quite common. I'd hate for that to be my job as a maintainer. NP: Explosions in the Sky / How Strange, Innocence

    21 September 2006

    Ian Murdock: What s new with the LSB

    It’s been a while since I’ve written about the LSB here, so I figured I was overdue to give an update. In short, it’s been a great year. Highlights include: » All major distributions, including Asianux, Debian, Mandriva, Red Hat, SUSE, and Ubuntu, are either already certified to LSB 3, in the process of certifying, or planning to certify their next version (see our list of expected distribution coverage for LSB 3). » A number of ISVs (independent software vendors), including MySQL and RealNetworks, are in the process of certifying applications to LSB 3. For ISVs, LSB certification means fewer distribution specific packages without sacrificing distribution coverage (take a look at the MySQL download page for an example of how crazy it can get). For users, LSB certification means greater application availability with a minimum of hoops to jump through. Expect a lot more announcements about LSB certified applications in the coming months. » We’ve put together a solid roadmap for the LSB going forward. The LSB aims to provide a “highest common denominator” across the various Linux distributions—in other words, to provide a single target for ISVs writing or porting to the Linux platform, where “the Linux platform” is defined by a short (and potentially different from ISV to ISV) list of distributions on which their applications must run. To serve as an effective highest common denominator, it needs to be easy to map from LSB versions to distributions and vice versa; and it needs to be possible to target a version of the LSB with assurance that the application will work not only on that version but on future versions as well (i.e., an LSB 3.0 application will run on LSB 3.0, 3.1, 3.2, 4.0, … compliant distributions). We’ve made great strides toward these goals in the past few months. To satisfy the “easy mapping” requirement, each major version of the LSB now corresponds to a major version, or “generation”, of the enterprise distributions. So, for example, LSB 3.x corresponds to the current generation (Red Hat Enterprise Linux 5, SUSE Linux Enterprise 10, etc.), LSB 4.x corresponds to the next generation (RHEL 6, SLE 11, etc.), etc. To satisfy the application compatibility requirement, LSB versions both major and minor beginning with 3.0 are strictly backward compatible with previous versions. At a high level, then, the LSB roadmap looks something like this:
    LSB 3.x (2006-2008) LSB 4.x (2008-2010)
    Asianux 2.0
    Debian 4.0 (”etch”)
    Mandriva Corporate 4.0
    Red Hat Enterprise Linux 4 & 5
    SUSE Linux Enterprise 9 & 10
    Ubuntu 6.06 LTS (”dapper”)
    […]
    Asianux 3.0
    Debian “etch” + 1
    Mandriva Corporate 5.0
    Red Hat Enterprise Linux 6
    SUSE Linux Enterprise 11
    Ubuntu LTS “dapper” + 1
    […]
    » Speaking of the LSB roadmap, we’re hard at work on LSB 3.2, to be released Q2 2007. The short list of new features include the addition of Perl, Python, several freedesktop.org specifications for desktop interoperability, CUPS, HPIJS, ALSA, and more. For LSB 4.0, we’ll be uplifting LSB Core to GCC 4.1 and glibc 2.4 and looking at two longstanding issues, the addition of Java and a packaging facility for ISVs, among many other things. The roadmap will be posted for public comment shortly. » We’re making it easier than ever to build portable applications using the LSB. We released the LSB SDK (Software Development Kit), which bundles everything a developer needs to write or port to the LSB, with LSB 3.1. We’re building something called the LSB Application Testkit, which aims to be the LSB’s validator.w3.org, an easy to use tool that developers can use to test for application portability. And we quietly launched a beta version of the LSB Developer Network last month. » In July, we hired Till Kamppeter, making linuxprinting.org, the de facto standard repository of Linux printer drivers, an FSG project. We’re adding both distribution neutral printer drivers (delivered, naturally, as LSB packages) to the linuxprinting.org foomatic database as well as an API that third party printer management tools can use to install and update printer drivers. We also plan to extend the LSB certification program to cover printers in addition to distributions and applications. If all goes well, you’ll be able to look for the LSB Certified mark on a printer at the store and know that it will work on your distribution of choice in the not too distant future. » Last, but certainly not least, we’re embarking on an exciting new project in partnership with the Institute for Systems Programming at the Russian Academy of Sciences to build the next generation LSB database and test suite infrastructure. The new system will interlink the various moving parts that make up the Linux platform to an unprecedented degree, providing upstream developers and distribution vendors a powerful set of tools for coordinating their work and improving the quality of the platform, as well as giving ISVs a more efficient way to provide feedback to both parties. This is a key tool for enabling the backward compatibility guarantee mentioned earlier, and it will also vastly improve the coverage and quality of the LSB tests, an area where we’ve been criticized in the past (our goal is 75% interface coverage by LSB 4.0). More details here. I’ll drill down on all of these topics and more in the coming months. In the meantime, you can keep up with the latest at the FSG and LSB by visiting the FSG web site or by signing up for the FSG newsletter (sorry, no RSS feed yet, though I’m told we’re working on it). Finally, if you’re interested in participating in the LSB project, join the lsb-discuss mailing list or the IRC channel #lsb on irc.freestandards.org, where the bulk of LSB development happens.

    Next.

    Previous.