Search Results: "eric"

16 April 2007

Eric Warmenhoven: No Apple Love

About eight months ago or so, Lisa and I decided to get a new laptop that both of us could use. I decided I didn’t want to buy a Windows computer, so we “compromised” (she gave in) and we got a 17″ MacBook Pro. I was pretty impressed with it, and she found it usable enough (though Quicken for Mac is quite different from the Windows version, and she still doesn’t like it much). Two weeks ago, we started having problems booting it. Problems like, the Apple logo on the boot screen would turn into a no sign and not boot. Or sometimes it would turn into a black screen and start printing console error messages before dropping me into a root shell. Or sometimes it would boot fine but then Finder would get into an infinite crash loop. Or sometimes it would boot fine and not have any problems at all for days. I backed up most of my data and took it to the Apple store this afternoon, where they had pretty severe problems just trying to boot from an external disk. They took it and said that they’d try replacing the logic board and possibly the hard disk, and give me a call in a week or so when it’s ready.

Matt Brubeck: 15 Apr 2007

A hacker remembers This story by David Humphrey from last week really hit home:
She told about how my grandfather made his living repairing radios, toasters, fans–anything and everything electrical. He’d only received a 4th grade education in Scotland, before he had to start earning a living to support the family. She described how their entire house, with its mechanical and other systems, was kept working through his creativity and persistence. When the well pump went, he made a new one out of parts from three others…
David could have been describing my own grandfather, who died last month. I knew him as Ojiichan ("Grandpa"). A child of immigrant farmers, his formal education stopped after the sixth grade. As a young man during the internment, he took a correspondence course in radio repair, and after the war started a life-long career in electronics. He worked on electronics at home too, building projects like a cruise control for his own car. Almost up until his death at 93, he lived alone, still drove, and still flew every year to keep his pilot's license up to date. At his memorial service, his family remembered his love of tricky, hard-to-solve problems. Many of Ojiichan's children and grandchildren have grown up to be engineers, but few of us could do some the things he did. He was a lively embodiment of the hacker spirit.y embodiment of the hacker spirit.

14 April 2007

Ben Hutchings: ACCU Conference

I've been meaning to attend the ACCU Conference for some years and finally decided to pay my own way for a couple of days this year. It was an opportunity to hear world experts on C++ and other programming topics and to a smaller extent to meet and socialise with other professional programmers. I attended the following sessions: Keynote: Improving Collaboration in Open Source Projects, Mark Shuttleworth This was a somewhat surprising choice of speaker and subject since I think most attendees work on proprietary software, but I think any sensible developer in the proprietary world will try to build on free libraries under non-copyleft licences, where appropriate. Mark talked about governance and leadership in "open source" projects (actually praising Debian for having a clear constitution) and about the need for good communication between projects, for example about release schedules. He seems to have accepted that Launchpad cannot be a single hub, and called for standard formats for, for example, exchanging information about related bugs between bug trackers. But it doesn't sound like he's ready to take the lead on that. Choose your Poison: Exceptions or Error Codes, Andrei Alexandrescu Andrei looked at the strengths and weaknesses of various error reporting mechanisms in C++ and introduced a technique for making error handling more flexible. Normally a function is designed either to indicate errors through its return value or to throw an exception on error. If a function returns an error indicator, it's easy for callers to ignore it. If it throws an exception on error, then a caller that provokes errors more often than the called function's author anticipated pays a high cost in processing time for those errors. Andrei's solution involves a class template Likely<typename T> whose instances hold either a return value of type T or an exception. A function that can fail has a specialisation of this template as its return type. The caller can check for failure if it knows how to handle it, or it can ignore it - in which case the conversion to T or the destructor will throw the exception. This is clever but doesn't seem to be entirely satisfactory. The destructor which throws does first check that no exception is already being processed, avoiding collision of the two exceptions and consequent abrupt termination of the program, but this can result in errors being unexpectedly ignored. Introduction to Component-Level Testing, John Lakos A marathon 3-hour talk on designing and testing software, particularly C++ programs (the subject of his well-known book) as a set of well-defined components. Lakos first defined these components as being "physical" i.e. sets of source files - normally a header file defining an interface, an implementation file, and a test driver file. They may also include metadata for the build system. He talked about the value of reusable components (as if this wasn't obvious!) and the risk of introducing circular dependencies - which essentially turn many components into one and reduce reusability - if we fail to keep track of dependencies. Software built out of components can be viewed as a hierarchy or stack defined by dependencies. In a large system, components with similar dependencies and dependents can be grouped together into packages or package groups to simplify a view of these dependencies. He explained that the test driver's dependencies count just as much as the implementation's, because we cannot reasonably test a component until we have tested its dependencies. Test drivers should also be written to avoid depending on environmental settings and configuration, so far as possible. Finally, and perhaps most importantly, he spent a long time talking about how to construct test cases and test data. I might try to summarise this in a later entry if anyone's interested. The Appliance of Science: Things in Computer Science that every practitioner should know, Andrei Alexandrescu Andrei began by complaining that OpenOffice Impress was even worse than PowerPoint, but being able to use Linux (specifically Ubuntu) more than made up for the pain. He briefly presented four key ideas that he believes programmers should understand and be ready to make use of: Writing for ACCU (BoF) I think I've been convinced to write an article about standardisation of multithreading in C++. C++ Threads, Lawrence Crowl Crowl gave an overview (similar to this) of the extensive work that's been done on standardisation of multithreading in the C++ language and library. This is one of the most important features in C++0x due to the increased parallelism mentioned above. The current semantics of multithreaded programs are not standardised, resulting in subtle but potentially serious differences between current C++ implementations that support multiple threads, and in the need for assembly-language code in programs that use lockless synchronisation. Much of this is also relevant to C and is being considered by the C standard committee. C++0x Initialisation: Lists and a Uniform Syntax, Bjarne Stroustrup Stroustrup recapped the 4 forms of syntax for initialising objects in C++, some inherited from C and some necessarily invented for C++, none of which are entirely generic. He noted the lack of a simple syntax to initialise the elements of containers, which violates the general principle that class types should have the same status as built-in types in C++. He then introduced a new initialiser syntax that he and others have defined for C++0x, which is a brace-enclosed comma-separated list of values, similar to that used for arrays and C-style structures (aggregates). Container types can define a constructor with a parameter of type const std::initializer_list<T> & and when constructed with this new form of initialiser they will receive this wrapper for a constant array of element values. For types that do not, the values in the list are treated as arguments to some other constructor, if one matches. Otherwise, for compatibility, this may be treated as aggregate initialisation. C++ Standard Library report, Alisdair Meredith There was far too much information here for me to even begin to summarise. Suffice to say there are lots of good things coming bu the library committee will have its work cut out to get them all properly specified in time for the Committe Draft coming late this year.
I also met old friends and new, put faces to names from newsgroups and books, and got too little sleep.

13 April 2007

Pete Nuttall: Cheap laughs from ars

I'm busy reading this, which outlines a concern that lots of Europeans have, which is how to comply with EU data protection laws and the US court system at the same time. SWIFT appear to be dealing with the problem, which is good. Ars then gives an example of a similar American massive surveillance system, Echelon, and how it feels the US has abused the system to catch Airbus bribing people. Now, I'm naive, but I feel that bribing people is wrong. And while two wrongs don't make a right, I'm not happy with the idea that Europe's main complaint about Echelon is that it was used to catch Europeans breaking their laws. This would be similar to UK drivers complaining about speed cameras by complaining that they catch speeders, rather than them causing accidents or being used as a way to make money. So could ars use a better example of abuse in the future, as I'm sure there must be one? Sorry for moaning, I'll return you to your normal diet of interesting stuff from DDs

Erich Schubert: DBus init changes

Just yesterday I mentioned that DBus contains an own set of init-like scripts. From todays new DBus package in unstable:
  * debian/dbus.init
    + Add functionality to start/stop dbus dependent services based on their
      LSB header.
      Instead of installing an init script into /etc/dbus-1/event.d, services
      depending on dbus should from now on install a regular sysv init script
      and add an LSB header with "Required-Start: dbus".
So the dbus init script now adds a 'workaround' (likely, since this is done in DBus, not in sysvinit) for the missing dependency handling in sysv-style init, by taking care of the restarting itself. This is good, because init scripts aren't distributed into two places anymore (soon).It probably highlights why we need to work on our init.

Sven Mueller: Init HackFest / New init systems in Debian

In his “Init followup” post, Erich posted a reference to his Debian-Wiki post about a proposed Debian HackFest after Etch was released (which would be about 5 days ago<smile />). Anyway, since that page at the wiki is protected, which means I can’t edit it, I’m posting my thoughts here. I agree with Erich and some other commentors at Gunnar Wolf’s blog post that it doesn’t make sense to add X init-script-only-packages for any daemon to support X init systems. Instead, each package containing one or more daemons should contain the meta information needed to create all init scripts. Basically, this would probably include script snippets which do the following operations: Additionally, some control information would be needed including, but probably not limited to: The script snippets listed above should allow basically any operation on a daemon, including the force-reload and try-restart commands not yet implemented by all current sysv-initscripts.

Erich Schubert: Init followup

Gunnar Wolf commented on my recent series of init script posts. Thanks for the feedback.The thing is that I've been doing a lot of Debian stuff these days (such as our GSoC coordination, and lots of stuff you saw in this blog). But I shouldn't... instead I should be trying to finally get my diploma thesis done.I had my exams last july. If I had been focused, I could have been finished with my degree last christmas. Now it will likely by this fall. :-( All that is remaining is my final thesis. It should be written in 6 months, but I still havn't submitted my topic yet. So if you are wondering what took me 8 months already: I investigated two topics, but they didn't work out. Then I started researching for my 'current' topic, and I have a vision for it, but I still havn't managed to convince my professor (which of course is largely due to me not being able to convey this idea, and that the topic is in information management and representation, where it's probaly often hard to find a solid theoretical part. I have examples I'd like to do, and I hope they are actually convincing, but I have no idea how to 'prove' something here; it's too much about social aspects and human perception I guess, and I'm not really qualified or capable to do solid research in that field.)(And as you can probably imagine, I'm pretty fed up with studying now. A year ago, I'd have considered to go for a PhD afterwards, but now I just want to get out, and work on my projects.)Anyway, I got distracted. Back to the init topic.I already posted this link: Init Hackfest, as well as a pointer to the initscripts-ng mailing list. I'd really like to get this topic on it's way for lenny. So please, join this effort. While I'd like to push it, I shouldn't; on contrary, I should suspend my Debian efforts.As for your (Gunnar) suggestion on how to handle multiple inits: what's wrong with just including multiple init scripts in one package? They are not particularly large and compress well. A single init script package might already be bigger than all the init scripts.The problem is more on how to write these init scripts; by the time we're done with this project, we might actually have hit 1000 init scripts. Yes; I didn't just make up this number: packages.debian.org has 890 hits for /etc/init.d; the init-like scripts in /etc/dbus-1/event.d not included. So if just want to add support to 5 alternate init systems, this means we would need to write 5000 new init scripts. Ouch. So we maybe should convert them to 1000 meta-init-scripts instead, and generate the 6000 real init scripts from them.Please join the discussion, and lets get this project going, despite having to face such scaringly high numbers...

12 April 2007

Biella Coleman: On My Aunt Enid, Cars, and History

Those who know me even moderately well (as well as every doctor I have ever seen), knows that my real first name as “Enid.” That is the mysterious E. that sometimes precedes the Gabriella. My mom’s intention was to call me Gabriella, the first name of some famous Italian Cabaret singer, Gabriella Ferranti. But when Enid, my aunt on my fathers side, passed away a few months before I was born, I was given the name Enid Gabriella. We have always used Biella or Gabriella but I like that I have Enid in there and have fancied from time to time to start using the name Enid. By all accounts, Enid was an amazing and energetic woman, who reared her four kids with passion, was very open to friends and family, and who, despite living a solidly upper middle class Jewish life, was also involved in interesting political work(like helping Americans doge the draft by escaping to Canada). My mom held a special fondness for her because, well, honestly I think she was one of the only members of my dad’s family who she deeply loved. And Enid always went out of her way to show her care and concern, as when she immediately went to Caracas after my mothers first child unexpectedly died of a high fever at the age of five months. Today as I was writing away, I received an email from my father that he sent to me and a bunch of cousins and other siblings where he attached a 9 page document of remembrances and memories of Enid. My dad, though in no way as bad off as my mother (health wise), is no spring chicken. And I think as he fast approaches 80 years old, he is committing a lot to writing and thus, keeping his memory alive for us. In fact, this reminded me of a really beautiful quote I recently came across on memory:
“You have to begin to lose your memory, if only in bits and pieces, to realize that memory is what makes our lives. Life without memory is no life at all, just as an intelligence without the possibility of expression is not really an intelligence. Our memory is our coherence, our reason, our feeling, even our action. Without it, we are nothing.” Luis Bu uel
But what was a little odd (but nonetheless very endearing) about most of the account is that it was not organized by stories, or date, but by car models. Yes, by technology. My dad organized the stories about Enid by virtue of the cars they had, which struck me a little strange because it is not like he was a car buff or anything (growing up we always had the most unsexy cars, like Ford Tauruses). The cars he covers are the following: The Model A Ford Convertible
The 1941 Oldsmobile
The 1948 Buick Convertible
A Chevy Convertible Once you read his little tribute, it becomes immediately clear that his choice of talking about cars is also way for him to talk about history which is my dad’s great love (he can talk to you straight for 5 hours about some odd event in WW II and why he should have become a historian) as it is about Enid. Case in point here:
This was the first General Motors car with automatic drive. It was called Hydromatic and even though this car had a powerful 8-cylinder engine, this first automatic drive was very sluggish. Forget about 0 to 60 miles an hour in 7 seconds. This was in minutes. It was the car that Abe used to teach both Enid and I to drive. We both had to have additional lessons with a stick shift car, because the driving test was only given on stick shift cars. I learned to drive in 1944, when I was 16. Enid took lessons from Abe and learned to drive in 1945 when she was fifteen. This was against the law, but the law in the name of Tom, the policeman that covered our neighborhood, liked Enid and looked the other way.
For those who care to read more (it may only be amusing to me and those few people that are into American car history), I have included all the cars and here are the main cast of characters. Ruth = My Grandmother
Abe = Grandfather
David = Dad
Enid = My Aunt, David’s sister (more…)

Erich Schubert: System init - part #3

Today's post (previous parts) tries to show what benefits other init systems can offer.I'm picking 'minit' as an example; not because it's the ultimate solution or anything, but because I happen to know it quite well. I used to be the package maintainer for some time, and I've also used it on an embedded system (where it was a perfect match). However, it's not very distribution-friendly; it's great when you can invest some time into configuring it (such as when building an embedded system) but not when it should ideally work automatically out of the box. The Debian package is still there, but it's orphaned. Still it's well written, clean code; there shouldn't be any bigger bugs in there.The first thing to notice is that minit is tiny. It's statically linked, but only about 6.5 kb. Regular init is 86 kb plus some libraries (despite actually not doing much during init!). This makes it very well-suited for embedding.But now for the benefits of minit over regular init:1. Service monitoring. This is the biggest point: minit will keep an eye on the services and restart them when needed. (Another thing very useful in embedded situations, btw.)Minit doesn't use the start/stop paradigm of sysv/shell-style-init. Instead it has a "run" script for every service. If a service is flagged as 'respawn', it will automatically be restarted when the run script quits; therefore the applications should not background themselves. This offers some benefits, for example the init process will be notified by the kernel of a termination, and can immediately respawn the service; in contrast to other monitoring systems suchas monit it doesn't rely on 'busy polling'.2. Dependency handling. Minit handles startup dependencies. If a service lists another service as a dependency, it will bring that service up first.3. Parallel startup. Unless an ordering is given via dependencies, minit will start the services in parallel.4. Control apps. In minit, you don't start a service by running some random shell script. Instead you call "msvc -u servicename", which will signal minit to bring up the service (and it's dependencies). This would (there currently is no policy for minit) be especially useful in SELinux, but it also allows to e.g. give a user the permission of running "sudo msvc -u" without introducing a huge security hole, since this cannot be used to execute arbitrary scripts. "msvc" can also be used to check if a service is up. (Another benefit for embedded systems, since that removes the need for pid files, which then need a ram (writeable) filesystem)I'll also give an example for a minit service:A service is represented by a directory in /etc/minit which can contain various files. I'm going to look at getty/1 example; which will bring up a console login on the first terminal. There are three files: If the service would need it, there could also be a file called "depends" listing service dependencies.This allows minit to start the getty with no overhead. There is no shell script being executed or anything (note: sysvinit also does this for gettys, but it's not being used much for other services).Of course minit isn't perfect. I've already said that it isn't particularly distribution friendly. This is because it uses a lot of magic files (e.g. an empty file named 'respawn' to flag a service as needing to be respawned), and it's configuration files aren't easy to handle automatically. The often frowned-upon 'symlink farms' of sysv-shell-style init are much better here.Another thing that is missing from minit is an automatic rollback of dependencies. If we told minit to bring up service 'a', which lists dependencies 'b' and 'c', minit will bring these three up. If we tell it to shutdown 'a', it will however not shutdown 'b' or 'c'. And unfortunately, even if we shutdown 'b', it won't shutdown 'a'. If you want a more complex dependency handling (or things such as runlevels), you need to do this externally. (An example is my 'enitdir' app, it adds runlevel support to minit, and allows switching of runlevels by replacing a symlink; Services are added and removed from runlevels by adding a symlink to the service into the runlevels directory. By using dnotify, this also takes virtually no CPU time.)Minit also lacks a differentiation between a 'started' and a 'running' service. It has support for 'sync' services, such as e.g. mounting a filesystem. It will wait for this operation to complete before it starts services depending on it. However, there are services that will continue to run, while not being instantly available when the exec() was called. Sometimes it would be nice if a service could go into a 'started' state, then do some cleanup work, and then when actually running the real service signal minit that it's now 'running'.As a last malus, minit won't print progress messages to the console. A minit boot is pretty much silent, directing it's output to some logging processes. There are good reasons for this (since services are started in parallel!), but it makes debugging harder, and users might be wondering what their system is actually doing (though some users prefer to see a colored 'busy' bar)...I guess this concludes this series of blog posts. Maybe someone can follow up with some details on upstart (which seems to be the most promising init replacement)? I hope to have given an impression on where there is room for improvement in our current init to one or the other. Now we just need some people to actually work on a better support for other inits in Debian...

Erich Schubert: Apologies if I'm breaking a planet

I've done a needed upgrade to my blog software. In this process, I've also been changing my blogs GUIDs. Unfortunately, this probably means that some planets or feed readers will recognize all of my postings as 'new'. Sorry about that. I'm not sure if I can somehow prevent it from happening.Every now and then I receive a mail from someone complaining that the links to my blog entries are broken. Well, they aren't. The link tag has an appropriate value. However some applications (usually involving planet) prepend the feeds base URI to the GUID field or use it in other RDF places. And then some readers seem to not know about the link tag and use that instead. So I'm now using the permalink as GUID, so it should be a bit easier for some people, since they now can just click on my entries.

11 April 2007

Kai Hendry: Webconverger 2.4

Korean Webconverger split 2.4 I’ve just released Webconverger (Web kiosk) USB&ISO versions built with stable Debian etch. Webconverger has received some good feedback and press. I would like to thank Daniel Bauman for his rather excellent Debian Live work on which Webconverger is based. I was hoping that Webconverger could support every locale, now it looks like I need to produce a separate ISO/IMG (or at least apt-get hooks) for every locale. One reason is that Iceweasel/Firefox extensions don’t scale very well. Try install every locale and dictionary extension. I dare you. :) Sidenote: I wonder why no one has packaged the dictionaries for Iceweasel. In other news, I’ve been playing around with scim (keyboard switcher) and Korean locales. It seems to work though the title bar didn’t render hangul characters right in dwm. After some investigation I discovered there isn’t such a thing as a single “generic” Unicode font. This came as a shock to me. :) Typical ttf only have 65536 glyphs, so no one font will do. Jeff Zhang also informed me about free Unicode fonts. Though I think especially in CJK environments proprietary fonts are unfortunately more common. Or I don’t know why microsoft-gulim isn’t in msttcorefonts. Anyway the Korean version of Webconverger turned out OK, though I doubt any Koreans will be using it. It’s all sadly ActiveX out there. My package wordpress 2.0.10 didn’t quite make it to etch in time as I was waiting for CVEs! 2.0.10 will be coming soon though… It always amazes me how much work can get done in breaks like Easter. It’s great that etch is out. And whoa, the weather is great.

Erich Schubert: Debian 'etch' release party in Munich

DebianMuc release party, add yourself now. Saturday, at the Flaucher (Isar).Weather forecast for this week is great. Probably around 24 C on saturday, the warmest day this week I've heard. It will still be getting cold at night (after all, it's not summer yet, though we like pretending it is); so maybe we should meet rather early. Also make sure to bring some warmer clothes, too.Anyway, there is the Wiki and our mailinglist for organizing the party.

Erich Schubert: What "beta" means in a web site name

"Beta" is short for "BETrAying". It means the web site isn't honest to you about the benefits for you, what they are doing with the data or what they are telling you. Examples: So spelled out it would be like:
Sorry, we're not telling you the truth about our service and the benefits, and that's why we're calling the service beta; once we've found out how to do it right and still earn some money with it, we'll remove the beta sign.

Erich Schubert: What "beta" means in a web site name

"Beta" is short for "BETrAying". It means the web site isn't honest to you about the benefits for you, what they are doing with the data or what they are telling you.Examples: So spelled out it would be like:
Sorry, we're not telling you the truth about our service and the benefits, and that's why we're calling the service beta; once we've found out how to do it right and still earn some money with it, we'll remove the beta sign.

Erich Schubert: System init - part #2

Yesterday, I wrote about our init actually being /bin/sh, since all sysvinit does it start a single shell script. Today, I'm going a bit into how services are brought up with sysv-style init. I won't be writing much about runlevels, since most users will not make use of multiple runlevels anyway. So what does a typical init script in /etc/init.d do? If you want to find out yourself, consider looking at /etc/init.d/skeleton, which is a template for init scripts. A modern init script should (as required by the LSB) start with a formatted comment with metadata such as dependencies and description. This is already trying to address some shortcomings of sysv-style init, but no actual code. The first thing most init scripts do is to check if their application is actually still installed. Init scripts are sometimes created by users, or are not automatically uninstalled since being treated as 'configuration files'; so it occurs often that the init script is still around even when the service was uninstalled. So they test if they're installed and executable. Next they probably read a configuration file, usually named /etc/default/packagename, with user settings (people used to do such changes in the init script itself, but for upgrading it proved to be a lot better to put all settings the user might want to modify there). The third step is to do the requested user action, which usually is one of 'start', 'stop', 'reload' and 'restart'. Some init scripts also have extra actions such as 'status'; not all init scripts support 'reload'. Doing such an action usually means to print out a status message and launching the service in the background (usually using the 'start-stop-daemon' daemon helper, which offers functionality to e.g. record the process PID in a file or forcing applications into the background that don't do so on their own), or locating the service (usually via a PID file, again this is commonly done using start-stop-daemon) and reloading or stopping it. Upon success, they again print a status message. An init script could be as simple as:
#!/bin/sh
if [ "$1" = "start" ]; then
  /usr/local/sbin/mycheapdaemon &
fi
There are many good reasons not to do it that way, but it will work. Some characteristics of sysv-style init scripts: Keep your eyes open for the next part of this series, where I'll show how some init systems improve on these issues.

Erich Schubert: System init - part #2

Yesterday, I wrote about our init actually being /bin/sh, since all sysvinit does it start a single shell script.Today, I'm going a bit into how services are brought up with sysv-style init. I won't be writing much about runlevels, since most users will not make use of multiple runlevels anyway.So what does a typical init script in /etc/init.d do?If you want to find out yourself, consider looking at /etc/init.d/skeleton, which is a template for init scripts.A modern init script should (as required by the LSB) start with a formatted comment with metadata such as dependencies and description. This is already trying to address some shortcomings of sysv-style init, but no actual code.The first thing most init scripts do is to check if their application is actually still installed. Init scripts are sometimes created by users, or are not automatically uninstalled since being treated as 'configuration files'; so it occurs often that the init script is still around even when the service was uninstalled. So they test if they're installed and executable.Next they probably read a configuration file, usually named /etc/default/packagename, with user settings (people used to do such changes in the init script itself, but for upgrading it proved to be a lot better to put all settings the user might want to modify there).The third step is to do the requested user action, which usually is one of 'start', 'stop', 'reload' and 'restart'. Some init scripts also have extra actions such as 'status'; not all init scripts support 'reload'. Doing such an action usually means to print out a status message and launching the service in the background (usually using the 'start-stop-daemon' daemon helper, which offers functionality to e.g. record the process PID in a file or forcing applications into the background that don't do so on their own), or locating the service (usually via a PID file, again this is commonly done using start-stop-daemon) and reloading or stopping it. Upon success, they again print a status message.An init script could be as simple as:
#!/bin/sh
if [ "$1" = "start" ]; then
  /usr/local/sbin/mycheapdaemon &
fi
There are many good reasons not to do it that way, but it will work.Some characteristics of sysv-style init scripts: Keep your eyes open for the next part of this series, where I'll show how some init systems improve on these issues.[Update: next part]

10 April 2007

Mike Hommey: Browser detection

Erich, the Gecko version number is pretty meaningless. With mozilla releases, the date reflects when the build was done. Which means if you build Firefox 1.5 today, it will get a Gecko/20070410 string. With Debian releases (except icedove), the date reflects the date for the client.mk in the source tarball, which is one of the last file upstream touches before a release. This helps having the same date for all 11 architectures (even after a binNMU) and is somehow more significant, but still not that much. There are, at the moment, 3 main branches for Gecko-based code: MOZILLA_1_8_0_BRANCH, MOZILLA_1_8_BRANCH and HEAD. The latter currently contains Gecko 1.9 alpha, Firefox 3.0 alpha, etc., and will eventually be branched to a MOZILLA_1_9_BRANCH or something similar when going in beta. The other branches are respectively for Gecko 1.8.0.x (Firefox 1.5.0.x, Thunderbird 1.5.0.x, Seamonkey 1.0.y, Xulrunner 1.8.0.x) and Gecko 1.8.1.x (Firefox 2.0.0.x, Thunderbird 2.0.0.x (not yet released), Xulrunner 1.8.1.x). [ In Debian Etch, we have Iceweasel 2.0.0.3 (Gecko 1.8.1.3), Iceape 1.0.8 (originally Gecko 1.8.0.10 but patched at version 1.8.0.11), Icedove 1.5.0.10 (Gecko 1.8.0.10 ; changes from version 1.8.0.11 didn’t make it, but they don’t affect the mailer code), and Xulrunner 1.8.0.11 (Gecko 1.8.0.11). The latter is used by kazehakase, galeon and epiphany. ] Whenever a new security release for Firefox 1.5.0.x and other products from the Gecko 1.8.0.x branch are done, the Gecko date obviously changes, and doesn’t reflect the fact that it’s an older Gecko than that of Firefox 2.0.0.x… Now if you take a closer look to the user agent string, you’ll see something that is actually more significant than the Gecko date, i.e. the Gecko revision, such as “rv:1.8.0.11″ in “Mozilla/5.0 (X11; U; Linux i686; ja_JP; rv:1.8.0.11) Gecko/20070324″

Erich Schubert: On System Init part 1

I thought I could write a multi part blog series about init systems (with the obvious goal of convincing some more people we should properly support other init systems as well). In the first step, I'll have short look at our current init. First of all, our init isn't really /sbin/init from the sysvinit. The real work is done by /bin/sh, so usuall bash or dash. Using the latter can already cut down boot time for you by a few seconds, according to some people. The init process is indeed used to kickoff the system, but it's in fact not doing much. Pretty much all it does is described by /etc/inittab. If you havn't ever had a look at this file, maybe you should now. During a typical system boot, init is doing three things:
  1. Start /etc/init.d/rcS
  2. Start /etc/init.d/rc 2
  3. Start the gettys (console logins)
other tasks it handles is pretty much waiting for Ctrl+Alt+Del and if someone triggers a shutdown. The actual shutdown work is again done by a shell script - /etc/init.d/rc 6 So my claim that our init system actually is /bin/sh isn't really far off, is it? Some random notes: Maybe tomorrow I'll write a bit about features of other init systems, and what benefits they offer. Maybe also on why the SELinux strict policy doesn't really like this way of starting and stopping services because of isolation issues. Or on that there are two types of things happening at init. [Update: next post in this series.]

Erich Schubert: On System Init part 1

I thought I could write a multi part blog series about init systems (with the obvious goal of convincing some more people we should properly support other init systems as well).In the first step, I'll have short look at our current init.First of all, our init isn't really /sbin/init from the sysvinit. The real work is done by /bin/sh, so usuall bash or dash. Using the latter can already cut down boot time for you by a few seconds, according to some people.The init process is indeed used to kickoff the system, but it's in fact not doing much. Pretty much all it does is described by /etc/inittab. If you havn't ever had a look at this file, maybe you should now.During a typical system boot, init is doing three things:
  1. Start /etc/init.d/rcS
  2. Start /etc/init.d/rc 2
  3. Start the gettys (console logins)
other tasks it handles is pretty much waiting for Ctrl+Alt+Del and if someone triggers a shutdown. The actual shutdown work is again done by a shell script - /etc/init.d/rc 6So my claim that our init system actually is /bin/sh isn't really far off, is it?Some random notes: Maybe tomorrow I'll write a bit about features of other init systems, and what benefits they offer. Maybe also on why the SELinux strict policy doesn't really like this way of starting and stopping services because of isolation issues. Or on that there are two types of things happening at init.[Update: next post in this series.]

9 April 2007

Erich Schubert: Browser detection

Don't use the browser name for capability detection. I'd like to emphasize that. For example Google Groups won't let me upload an image to my profile, because I'm not running Firefox or Internet Exploder. Well, I tried both Epiphany (which has a very clean and fast UI, unlike Firefox which is totally cluttered) and Iceweasel (which is Firefox, but with the trademark replaced). Both are using Gecko, Gecko/20070324 for Epiphany and Gecko/20070310 for Iceweasel. So I'm very sure they have the same capabilites as Firefox 2 when it comes to web sites. If you want to test for Firefox's capabilities, use the Gecko version number.. Thank you. [Update: it was suggested I point people to GeckoIsGecko.org, which has links on how to properly detect the Gecko engine, instead of relying on the browser name.] [Update: Mike Hommey pointed out that the 'Gecko/date' string is mostly meaningless, and largely is the build date; it doesn't contain tree information. Instead you should be using the "rv: 1.8.0.11" part of the User-Agent. This is also what the getGeckoRv function on the howto linked from GeckoIsGecko.org does. Oh, and Firefox 2 is not gecko 2, but IIRC uses gecko 1.8.x, just like my Epiphany.]

Next.

Previous.