Search Results: "xam"

2 October 2006

Meike Reichle: A few firsts

It's been a while. Again.
I've been horribly busy. Still. Did some cool stuff though, among the usual daily blurb I am proud to announce a few firsts: I uploaded my first package, fixed my first serious bug, went to my first Wizards of OS and passed the final exam in my second minor with the best possible grade (I passed the other one last summer. Only the major, information science, is left now.) One of these days I'll write posts beyond "Been a while, did this and that." again. Really.

Benjamin Mako Hill: Working in Concert

Unfortunately, I couldn't make it to the Creative Commons Concert in New York City last weekend. All proceeds for the concert went to Creative Commons. Now I may be wrong about this and will happily stand corrected if I am, but, as far as I can tell, none of the artists performing at the benefit have ever released an album or a major piece of work under a Creative Commons license -- even the restrictive and non-free licenses. The free culture movement needs some things more than money. For example, it needs high quality creative works under permissive licenses. We'd be better off with the good press associated with one hit single under a CC BY-SA license than all of the proceeds of a benefit like Friday's. It might also be nice to highlight the great work being done by artists who are risking more secure economic models in favor of releasing their works under free licenses. Or perhaps this reminds us of another important conversation: Why are many popular musicians who are willing to support CC unwilling or unable to use the licenses? More importantly, how are we going to change this?

30 September 2006

Zak B. Elep: More on being 0 16

Its the close of September. And just a week ago I turned 16: in hex, that is. Although I do distinctly remember how I wished coming back to being a 16-decimal-year-old then… So, how does it feel being one? I’ve barely begun to feel it. There has been a lot of distractions to keep me from contemplating too much about $age: That’s just the tip of the iceberg. Moving back to Manila again has its own issues; I still have to look for a better place to stay (not that I’m complaining about my Tita’s place in Malate, but hey, we’re already overcrowded… I suppose I’ll get my own flat once I think I can stay out beyond the 3 months,) and I have to get better internet connectivity (all the better for my chroots to keep updated, and finally get back on the Debian/Ubuntu packaging scene.) I also have to find some time to get a passport, a haircut, some nice pair of sneakers, and a Wii. I’ve yet to know what this being 0×16 business is all about, but this I have to say: Thanks $DEITY for all the fish.

29 September 2006

Edd Dumbill: A deployment pattern for Rails and bzr

I can't get enough of the bzr revision control system, and I'm quite fond of Rails too. So, I thought I'd share my deployment setup for Rails applications using Capistrano and bzr. Capistrano works on the assumption that you're deploying from a revision control system. Secondly, it requires that your deployment server is aware of how to access this system. This leaves you with various options, the most obvious of which are:
  1. Host your source repository on your deployment server
  2. Have your deployment server equipped with remote access to your source repository
  3. Mirror your repository to your deployment server
Of these, option 1 is out for all but somewhat casual projects, option 2 either opens up your source repository more than I like, or needs fiddly tunnelling of SSH which I don't think Capistrano is up to yet (I only like to use key-based access with SSH, rather than password based access, which seems at the moment complicate life where Capistrano is concerned.) I've opted for option 3. The pattern I use is this. On setting up the deployment server, I push a copy of the bzr repository to a private directory. Then, on deployment I first update that repository securely from the master repository inside my network, then export the new release locally on the server. Here are the relevant bits of my Capistrano configuration:
set :repository, "/opt/repo_mirror/# application "

…

set :scm, :bzr
set :checkout, "branch"

…

task :before_update_code do
bzr push sftp://deploy.example.org/opt/repo_mirror/# application
end
One big advantage of this over option 2, a remote source repository, is that only the changes are sent up to the server, and the bandwidth-intensive application checkout happens locally on the deployment machine. The final bit of improvement this could stand is to have the bzr checkout use export and not branch, but I think I'll have to alter the Capistrano's bzr plugin in order to do this.

Edd Dumbill: Locking down portmap on Debian

Most sensible people are very wary of NFS and its potential for security holes. If you can at all help it, it's a good idea not to run NFS and portmap on a network interface with direct internet connectivity. However, this isn't always convenient. As I needed to have NFS sharing on a host exposed to the internet, I set about finding the various places I needed to firewall. The tools I typically use to verify I've done the right things are netstat -nap on the machine concerned, to check for listening processes, and nmap from remote hosts to sniff for open ports. Portmap and its associated programs mostly use 'tcpwrappers' for controlling access. The first step you ought to take in securing portmap is to ensure that your hosts.allow and hosts.deny files are set up to control access properly. In /etc/hosts.deny, deny access to allcomers:
mountd: ALL
statd: ALL
portmap: ALL
rquotad: ALL
Then in /etc/hosts.allow, let the good guys through (adjust for your network):
mountd: 192.168.0.
statd: 192.168.0.
portmap: 192.168.0.
rquotad: 192.168.0.
On top of this, however, you should firewall off the ports that these programs use. As I found out, this is not as easy as it sounds. Portmap assigns random ports for some of the services it starts. You can run rpcinfo -p to see the ports in use. An example run on one of my machines looks like this:
program vers proto   port
 100000    2   tcp    111  portmapper
 100000    2   udp    111  portmapper
 100003    2   udp   2049  nfs
 100003    3   udp   2049  nfs
 100003    4   udp   2049  nfs
 100003    2   tcp   2049  nfs
 100003    3   tcp   2049  nfs
 100003    4   tcp   2049  nfs
 100021    1   udp  32770  nlockmgr
 100021    3   udp  32770  nlockmgr
 100021    4   udp  32770  nlockmgr
 100021    1   tcp  32788  nlockmgr
 100021    3   tcp  32788  nlockmgr
 100021    4   tcp  32788  nlockmgr
 100005    1   udp   1005  mountd
 100005    1   tcp   1008  mountd
 100005    2   udp   1005  mountd
 100005    2   tcp   1008  mountd
 100005    3   udp   1005  mountd
 100005    3   tcp   1008  mountd
 100024    1   udp    863  status
 100024    1   tcp    866  status
Of these, nfs and portmapper always use the same ports, 2049 and 111, so ensure you block off these. What about the rest? Happily, there's a way to configure them to use constant ports so we can reliably firewall them. Life would be too easy if all this configuration was in the one place, so here's how to find the different places you need to change. Finally, if you're running quotas, be sure to do something similar with RPCRQUOTADOPTS in /etc/default/quota. See also: Finally, I ought to note that I've written this up in case it helps anybody else. As with everything I write here, I make no warranty about its accuracy. Security is hard and obscure (but that's no reason not make our best efforts!)

Antti-Juhani Kaijanaho: Graph reduction

Graph reduction is the basic operational model of lazy functional programming. The idea is that the program is represented as a huge λ-term abstract syntax tree, and the program is executed by performing outermost-leftmost β-reductions to this tree, and whenever a subtree must be replaced by another tree (such as, when performing the substitution operation), the root node of the replacee is overwritten by the root node of the replacement (or a redirection node pointing to the replacement) instead of making copies (the body of an abstraction still needs to be copied, of course). The effect is the familiar laziness: when a function refers to its parameter more than once, the argument term is shared between the parameter references instead of making copies, and so any reduction in any one of them is shared by all of them. For some strange reason, I decided I must write a set of C functions that demonstrate graph reduction. I wrote them, and then in order to test them I expanded them to become a complete implementation of λ-calculus (extended with integers) graph reduction. The program can be found here; it is written in portable ANSI–C. It is able to show the complete trace of reductions. It is intended for demonstrating the technique, and therefore is effectively a stupid interpreter and does not implement any of the sophisticated optimization techniques that industrial-strength functional language implementations routinely use. Example usage:
$ cat examples/fib
TRUE = t.f.t
FALSE = t.f.f
IF = x.x
NIL = x. IF x TRUE NIL
ISNIL = x. x TRUE
CONS = car. cdr. x. IF x FALSE (y. IF y car cdr)
CAR = cell. cell FALSE TRUE
CDR = cell. cell FALSE FALSE
MAP = f. xs. IF (ISNIL xs) NIL (CONS (f (CAR xs)) (MAP f (CDR xs)))
AT = n. xs. CAR (DROP n xs)
DROP = n. xs. IF (n = 0) xs (DROP (n - 1) (CDR xs))
TAKE = n. xs. IF (n = 0) NIL (CAR xs (TAKE (n - 1) (CDR xs)))
FIBS = CONS (CONS 0 1) (MAP GENFIB FIBS)
GENFIB = pair. CONS (CDR pair) ((CAR pair) + (CDR pair))
FIB = n. (CDR (AT n FIBS))
$ ./graph-reduction -t -S10K -H1M examples/fib
graph-reduction 1.0 by Antti-Juhani Kaijanaho, report bugs to antkaij@mit.jyu.fi
[heap_size=1048560,stack_size=2621440]
examples/fib> FIB 3
[...]
1 + (1 + (0 + (f[4].f[4]) (y[11].(x[5].x[5]) y[11] 0 1) (t[3].f[4].f[4])))
1 + (1 + (0 + (y[11].(x[5].x[5]) y[11] 0 1) (t[3].f[4].f[4])))
1 + (1 + (0 + (x[5].x[5]) (t[3].f[4].f[4]) 0 1))
1 + (1 + (0 + (t[3].f[4].f[4]) 0 1))
1 + (1 + (0 + (f[4].f[4]) 1))
1 + (1 + (0 + 1))
1 + (1 + 1)
1 + 2
3
examples/fib>
(In the trace output, each bound variable is annotated by a scope identifier that effectively allows me to ignore variable caputure problems.) I plant to further extend the language to handle algebraic data types and simple pattern matching, to get rid of the noise of simulating these concepts in the traces. Technically, perhaps the most interesting part of the program is that it contains a fully portable copying garbage collector.

Andreas Schuldei

Future beach front property

Today I watched the "An Inconvenient Truth" film which was recommened to us at the foo camp preceeding Euro OSCon. Steve had already blogged about it shortly. While i enjoy the summer evenings at the end of september that I experienced this week, I think we are heading for very serious and even hard times. I would guess that we all will soon have to cut back on many areas of our compfortable lifes: less warm showers, more sweaters in winter, not keeping your computer on 24/7, no more car, no more flights. I have been thinking on where to move, given the delicate position that europe is in with its dependency on the gulf stream.

Incidently i also ran into this cool website today, which makes one consequence of global warming a little bit more realistic. If you are lucky your house in the middle of the city will be beach front property soon.

Yet another example of that positive crisis awareness is needed. Act today and we might just get a major global crisis. Don't act and we might get mass extinction.

28 September 2006

Enrico Zini: debtags-interesting-times

Debtags interesting times An unbelievable amount of interesting, fun and bleeding-edge things to do are coming out with Debtags. Erich did some javascript tag cloud. Interactive tag clouds are probably the coolest thing to provide as a link for packages.debian.org when people click on a tag. They can also replace the current navigator we have at http://debtags.alioth.debian.org/cgi-bin/index.cgi I started using Xapian, which is cool. It does fast text search with all the cool things like stemming and whatnot. Check out a prototype package search interface using it. Xapian can also find packages similar to a given one by looking at the description, which is cool. I can already use it to suggest tags, until we manage to put some of the bayesian code we are accumulating into production. Plus, I had an IRC chat with a Xapian developer: he was really nice. We had one of those neat chats in which really cool ideas keep coming out and it won't be so hard to implement even and wow, that'd be so cool, let's do it! Then there's the new web-based tag editing interface to do to replace the old one. I can add the smart search idea to it allowing to display tags giving keywords: and that'd give suggestions that automatically follow existing tag practices, which rocks. The C++ daemon backend that we now have for the website is great to allow to quickly intermix tag updates and queries, and still hope to scale. Maybe it means that soon we finally can start handling debtags mail submissions on Alioth as well. Distro-wise I have a plan to finally get rid of apt-index-watcher. The plan is already working in my computer, and just needs some more tests before hitting unstable. I'd also like to have the Python Debtags interface packaged somewhere, so that people who don't grok C++ can have fun with the Debtags data. Work is underway. Then there's the debtags-updatecontrol experiment, which didn't go quite as I expected, but still went well. I've already sent my first tag override update to aj incorporating data from control files. Other ideas? For example, implementing Xapian indexing in libept, and finally have a package manager with an amazingly fast search-as-you-type. And that, as a side effect, would create a Xapian package description in /var/something that is ready for any installed software to use. Then there's popcon. That's another piece of data to make available to package managers, and I already know how to do it. With Phil Hands at Debconf6 we had also started designing a way to use the unaggregated popcon database to implement an Amazon-style functionality that would go like "users which have a system similar to yours also have packages X and Y installed: would you like to have a look at them?" Joey Hess suggested to filter popcon analysis data with debtags, so that one can get suggestions, for example, only limited to game packages. Oh so cool! And this all feels like just a beginning...

Simon Richter: Wacky ideas #9: alternate system roots

When building images for embedded systems or bootstrapping, it is sometimes necessary to configure a package on the host system. This is somewhat doable when host and target system are the same architecture, but becomes difficult when they are not, and downright impossible for packages that configure themselves for the particular machine they've been installed on, like xorg for example. The idea to solve this is actually three ideas:
  1. split the package dependencies into installation time and runtime dependencies, and a third category for "needed for both"
  2. if a package install-depends on itself, then it can only be configured on the target system, such packages should not be pre-depended on for obvious reasons
  3. to actually allow installation when host and target are different architectures, the maintainer scripts need to be able to handle alternate system roots.

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.

    Dirk Eddelbuettel: Announcing 'littler'

    Earlier today, Jeff announced our new toy r (aka 'littler') with this post on the r-help list. What is 'littler'? We summarized it briefly in the post and on our respective or pages:
    GNU R, a language and environment for statistical computing and graphics, provides a wonderful system for 'programming with data' as well as interactive exploratory analysis, often involving graphs. Sometimes, however, simple scripts are desired. While R can be used in batch mode, and while so-called 'here' documents can be crafted, a long-standing need for a scripting front-end has often been expressed by the R Community. littler (pronounced 'little R' and written 'r') aims to fill this need. It can be used directly on the command-line just like, say, bc(1):
    	$ echo 'cat(pi^2,"\n")'   r
    	9.869604
    
    http://ftp-master.debian.org/new.html Equivalently, commands that are to be evaluated can be given on the command-line
    	$ r -e 'cat(pi^2, "\n")'
    	9.869604
    
    But unlike bc(1), GNU R has a vast number of statistical functions. For example, we can quickly compute a summary() and show a stem-and-leaf plot for file sizes in a given directory via
    	$ ls -l /boot   awk '!/^total/  print $5 '   \
    		 r -e 'fsizes - as.integer(readLines());
    			print(summary(fsizes)); stem(fsizes)'
    	   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
    	     13     512  110100  486900  768400 4735000
    	Loading required package: grDevices
    	  The decimal point is 6 digit(s) to the right of the  
    	  0   00000000000000000011112223
    	  0   5557778899
    	  1   112233
    	  1   5
    	  2  
    	  2  
    	  3  
    	  3  
    	  4  
    	  4   7		
    
    And, last but not least, this (somewhat unwieldy) expression can be stored in a helper script:
    	$ cat examples/fsizes.r
    	#!/usr/bin/env r
    	fsizes - as.integer(readLines())
    	print(summary(fsizes))
    	stem(fsizes)
    
    (where calling /usr/bin/env is a trick from Python which allows one to forget whether r is installed in /usr/bin/r, /usr/local/bin/r, ~/bin/r, ...) A few examples are provided in the source directories examples/ and tests/.
    At least one shortcoming already became apparent: by calling it r to not trample on the real R binary, we obviously overlooked that there are certain operating systems on which case is ignored -- ouch. So Mac users may have to install it as a littler binary. Other comments, as seen in the mailing list thread, are mostly supportive. littler can either be downloaded from either the Vanderbilt BioStat Wiki or my local archive. Also available is SVN access via
    	svn  http://littler.googlecode.com/svn/trunk/ littler
    
    Debian users shall get it via apt-get install littler as soon as it leaves Debian's NEW queue. In the meantime, the configure && make && make install three-step works for us under any of Debian testing, Ubuntu Dapper, OS X, and with both R 2.3.1 and the pre-releases of R 2.4.0.

    Benjamin Mako Hill: Who Gets to Define Freedom?

    Recently, I had an opportunity to publicly discuss my projects around definitions of freedom for creative work with Lawrence Lessig at a workshop at Wizards of OS. In particular, we talked about my article Toward a Standard of Freedom in which I advance a call for a list of essential freedoms, a definition of free culture or content, and a goal around which a social movement for free creative works can be based. At WOS, Lessig and I agreed that its likely that, eventually, some standard (or standards) of freedom will take hold. Like me, Lessig seems to think that this is a good thing. We both agree that there will be, and should be, competing definitions of freedom, competing social movements, and a long conversation about what essential freedom really to creative works is before we get there. Our most fundamental differences seem to stem from a disagreement about who gets to define freedom or, perhaps more precisely, who the communities of producers should listen to in order to find out what essential freedoms in the domain of different types of creative works are. Lessig is extremely reticent to make any claims about what essential freedoms might be: he does not want to speak for creative communities that he does not intimately understand. While he seems to be suspect of any project making normative claims in this regard, he disagrees most strongly with projects like mine that offer definitions of free content and expressions that are intended to be applied broadly and outside of the explicit domain of the definition's initiators recognized experience (in our case, online encyclopedias and software). Lessig explained that he trusts musicians -- and in particular, Gilberto Gil, the progenitor of the CC Sampling license -- when it comes to defining essential freedoms for music. Similarly, he trusts programmers -- and in particular, Richard Stallman -- when it comes to defining essential freedom for software. Since Richard and I are less accomplished, less well known, and less experienced musicians, Lessig feels most comfortable erring in favor of Gil where there's a disagreement between us about the scope of essential freedom for music. While his is a convincing argument, I disagree with Lessig's position for a series of reasons I'll try to discuss here. First, it is important to remember that Gilberto Gil does not represent all musicians. There are many artists and musicians who support my definition. There are many (and probably more if the CC license usage statistics are any indication) who support Gil's lower base-line. It's worth remembering that, even though we disagree, both Gil and I are offering controversial and extreme positions. Today, most creators think that giving away their work at no cost, even non-commercially and barring derivatives, is crazy. To illustrate why this is not a problem, we can look again to free software. In the free software community, we see that Richard Stallman does not speak for the programming community at large when it comes to defining essential freedoms to code. In the mid-eighties, Stallman spoke for himself and a tiny handful of like-minded others. Today he speaks for many more but it's still a tiny fraction of all programmers. It's hard to remember when you're down in the trenches but the idea that software should be free remains a marginal and kooky idea to this day. Due to the hard work of the free software movement, many people have adopted Stallman's definition of essential freedom for software and many more will. But it is not mainstream and it didn't get here by being so. Setting an ethical standard and a goal for a social movement should not be about being popular. It should be about describing an ideal. It should be about standing up to injustice. It should be about answering the question, "what sort of world do I want to live in?" Not only is this process not a popularity contest, it will, in all likelihood, stand to make one very unpopular. Being respected or seen as an expert within a field will help with the adoption of one's ideal. Programmers trusted Richards Stallman because he'd written large parts of the very popular programming tools like GNU Emacs and GCC. However, it wasn't from his experience in programming that this insight into the importance of software freedom stemmed. It was from his desire to be a good, ethical, neighbor and member of a technical community. To this day, most great programmers continue to disagree with Richard. Second, I'm interested not only in talking about the ability of authors to choose how their works are used but in the rights of readers. You don't need to have a platinum album under your belt to have an informed and important opinion about how music should be heard, experienced and distributed. Lessig's current push for a "Read-Write Culture" is very fixated on creators and re-mixers. That's only one important piece of the community that frames and deals with this problem. Third, while I agree with Lessig that discussions around definitions of free culture must happen separately in each separate artist community, I see several compelling reasons why a single definition of freedom may be a very good idea both tactically and philosophically. For example, it provides a common rallying cry around which different creative groups can collaborate and it mirrors the common treatment of different types of works in current IP systems. More importantly, there are fundamental similarities between information goods and the way they are created, distributed, and consumed on computers and in digital networks. I've highlighted this before in quoting Eben Moglen on the ethics of creating artificial scarcity in goods with zero marginal cost. As a final note, it's worth stating that one doesn't need to feel that all works should be free to support a definition of freedom. Richard Stallman provides a great example of this. Stallman doesn't think that works of opinion or works that are designed primarily to entertain need to be free. However, he does believe that the term "free" should refer to a fixed set of freedoms so that he can take such a position. Without a definition of "free," a position on what should or should not be "free" is impossible. I believe that freedom to distribute and produce information goods like art and content and software are embedded in a set of freedoms and rights for both the producers and consumers. I think that to some degree (and quite probably a less extensive degree), Lessig agrees with this. Unlike Lessig, I don't believe that one needs extensive expertise in the creation of a particular type of creative good to make true statements about what is ethical or unethical in the production, distribution, and control of it. To use admittedly extreme analogies, you don't need to be a slave owner (or slave for that matter) to say that slavery is wrong. You don't need to be a farmer to make arguments against or in favor of vegetarianism or in favor of free range animals. I don't believe you have to be a technologist to claim that certain freedoms to technology are essential. I don't believe that you need to be an musician (successful or not) to make claims about essential rights to music. I welcomed the conversations and challenges that Lessig offered and it was encouraging to see agreement on the process of discussion and debate going forward. After the workshop, Lessig suggested that we continue the conversation. I look forward to doing just this in other venues and in other ways.

    25 September 2006

    Simon Richter: I'm #1, again

    Recently, planet appears to bump edited posts to the front. Which is bad since I tend to blog from the train categorise (and reflow) later when I get home. Some posts (the "wacky ideas" ones for example) even got out of order. Since my perl foo does not exist at all (I suck at languages with weak type systems) I cannot even look into what happened. I'd be grateful for hints.

    Jordi Mallach: Visited the opthalmologist

    Today I went to the hospital to visit the opthalmologist. The good news: as expected, what happened the other day was just a case of optical migraine, which needs no treatment and I shouldn't worry about. Thanks to everyone who mailed me or commented in the blog giving advice or wishing me luck! The doctor examined my retina, and found nothing wrong with them that would cause lights or total blindness. He did find what he described as the start of retinal folding , which might be congenite, but I should keep an eye on in case it becomes a real problem. Apparently I should be vigilant to objects appearing with deformed shapes, etc. So I came back earlier that expected to office, but I really can't do anything here due to the pupil dilation. Everything is blurry, light is extremely annoying, and I'm writing this using a ridiculously big terminal font. The get decent sleep plan continues, and I've been sleeping the expected amount of hours since last Tuesday.

    24 September 2006

    John Goerzen: Yellow

    There are a lot of beautiful fall colors that will be showing up in forests around the world shortly.

    But here in Kansas, we get a little jump on the colors because this is sunflower season.

    If you drive around Kansas this time of year (roughly August and September), you'll see sunflowers all over the place. The wild sunflowers thrive anywhere there's nobody to plow them under or mow them down. If you pick the right country road, you can drive along and see what looks like a yellow wall in the distance. As you get closer, you realize that you're seeing sunflowers growing along a small stream or creek, though they've completely hidden it.

    Although I grew up here, I had never really paid attention to the sunflowers. Back in 2002, as we were moving to Kansas from Indiana, Terah noticed the wild sunflowers. She'd never seen wild sunflowers and has really enjoyed them ever since (and so have I).

    So, here are some sunflower photos, for those of you that have never had the chance to travel some of the back roads of Kansas.

    First we start with a small bunch of wild sunflowers:



    This small patch is growing in the ditch by our farm (our house is in that clump of trees in the background). These sunflowers are pretty young, so they aren't very tall yet. Also, there's a butterly fluttering around in that photo.

    Most of the wild sunflowers get much taller than these. They seem to usually grow to about 5 to 7 feet (1.5 - 2.1m) tall. Here's a taller patch, about 1/2 mile away from the first one:



    Neither of these two example photos show a very "deep" view of a group of sunflowers, because they are so dense that it's hard to really see what the individual plants look like in such a photo.

    But here's a photo of a sunflower field:



    These sunflowers don't grow as tall as their wild cousins, but their flower heads are quite a bit larger. This type of sunflower can be found many places. Wild sunflowers like we have here can be found in different places, too, but I've never seen them so common as here in Kansas.

    23 September 2006

    Simon Richter: Efficiency

    I've mentioned democracyplayer a few times now. I really think the platform has quite some potential, however a number of things have to be addressed. For example, the system load while a download is active is between three and four. I have a certain feeling that this is related to the threads that paint the wonderful spinning arrows. Unfortunately, the load does not decrease when I put another window in front. Or play a movie. Seriously, what happened to the art of stopping pointless threads?

    Lucas Nussbaum: Random chat using XMPP/Jabber, anyone ?

    A Random Chat applet hit digg recently. It allows you to chat with a random stranger visiting the website at the same time as you. It’s a good idea, but it would really be much better to have something similar based on Jabber (and maybe it could become a Jabber killer app’ ?) Some thoughts: So, is somebody interested in working on this ? It would be quite easy to do with XMPP4R or another Ruby library. (This was from my list of things that I would really like to see implemented, but I won’t have time to work on it myself) Related links:

    22 September 2006

    Scott James Remnant: Upstart can now replace sysvinit

    Today I reached another milestone in the development of upstart, the packages in universe can now replace the existing sysvinit package. Before trying this, make sure your installation is up to date as we’ve had to split out some parts of sysvinit into a new sysvutils package. If you’re up to date, and want to try it out, install the upstart and upstart-compat-sysv packages from universe. Note that the first reboot after you’ve installed the packages (from sysvinit to upstart) will be a little tricky … use reboot -f. If your system boots and shuts down normally, everything’s working just fine. Note that both will be somewhat more quiet than you’re used to, unless you have usplash running. Throughout the rest of this entry, I’ll try to answer some of the questions and comments that I’ve received since the last post. Events As I talked about previously, upstart is an event-based init daemon. Events are the primary force for having your services and tasks started and stopped at the appropriate time and in the appropriate order. So what are events and where do they come from? (Note that this part is under development, so may change in later releases). Events are just simple strings that may be sent by any process when something it is tracking the state of changes. They have no state or longevity, and if, when queued, they do not cause any job state changes, then they have no effect unless they are sent again. Jobs can list which events cause them to be started if they are not already running and which events cause them to be stopped if they are running. Multiple start and stop events may be listed, in which case the first to occur changes the job until the next one occurs. upstart itself generates the following system events: The shutdown tool included in the package also causes one of the following events to be sent once the “shutdown” event has been handled: Jobs also generate events whenever they change state, this is the primary source of events for ordering: And as mentioned, any other process on the system may send events through the control socket or just by using initctl trigger EVENT. For now this is just the event string, however it’s intended that the event may include other details including environment variables and even file descriptors. Typical example To clarify how it all hangs together, here’s an example (using fictional names) of how the tasks and events can be arranged to provide race-free mounting of filesystems. By breaking this job into these small tasks, we can see how the pieces fit together. Because everything is now done on events, there are no race conditions; we know that any filesystem listed in /etc/fstab will be checked and mounted. The only reason they wouldn’t be is if there’s an error of some kind, and that means you have larger problems anyway and the system administrator would have a shell to fix it. Of course, the moment they finish checking the filesystem and mount it, the boot process would carry on. There’s no reason that any of these events need to be generated by the upstart daemon itself, it can receive them from any other daemon on the system such as udev, acpid, etc. This keeps the focus of the init daemon narrow. A large part of the future development will be working out exactly what kinds of events we want init itself to generate, what kinds we want to come from elsewhere, and what the contents of an event can be. Getting Involved If you want to get involved with trying to nudge the direction of upstart development, you can join the upstart-devel mailing list at http://lists.netsplit.com/ Or if you just want to grab the source code, tarballs are published at http://people.ubuntu.com/\scott/software/upstart/ and the bzr archive is at http://bazaar.launchpad.net/\keybuk/upstart/main

    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.

    Next.

    Previous.