The various sorts of backgrounding in Unix

In Unix, there's several ways to put processes into the background,each with its own different set of effects, because Unix processes havevarious sorts of connections to your foreground shell session: their process group , whether or not they areignoring SIGHUP signals, open file descriptors to your tty, and evenwhether or not the process has a controlling tty.

So, in order of increasing isolation, Unix has:

  • simple backgrounding, where you start the program with & and theshell doesn't wait for it

An unpleasant thing about system administration

One of the unpleasant things about system administration is how it canturn me into a petty authoritarian, full of irritation with users thathave the temerity to 'break the rules' and not follow directions, evenif (or especially if) the rules are themselves impositions from outsidethat I myself dislike and object to. Instead of cheering on the users, Ibecome angry with them, apparently merely because they have the temerityto not do what I told them to. In some dark place in my mind, people not


There are really two GPL v2 licenses

While is only one GPL v2 license, there are effectively two versions ofthe GPL v2 that programs are licensed under: programs licensed under theGPL v2 (only), and programs licensed under 'GPL v2 or (at your option)any later version', depending on the license verbiage that the programitself uses. The FSF encourages the 'GPL v2 or any later version' one,but some people have not been so open ended.

When there was only one GPL license in common


The importance of killing processes in the right order

In the old days, we had a mail system with two problems: receiving SMTP mail took a couple of processesper connection, and the SMTP server had no timeout. The result thatour central mail server would slowly accumulate more and idle SMTPsession processes waiting on zombie PCs that had just yanked theconnection away, all of them chewing up memory, swap space, and so on;at the height of things, we might have more than a thousand idle SMTPconnections.

(Specifically, there was a process per


SNI doesn't work in practice

A while back I talked about why SSL and name-based virtual hosts don'tget along , and a commentator pointed me at the 'ServerName Indication' (SNI) SSL extension to deal with this. The approachSNI takes is for the client to send the server name(s) it wants to talkto as part of the initial handshake; a SNI-aware server can use this topick the right server certificate right away.

(The whole thing is described in RFC 4366 and


Please don't make me pick an account name

I just got through registering with yet another website. It was a pain,because they made me pick an account name.

There's two problems with account names. First, they matter becausethey're public identities; they say something about you to onlookers,so you care what your account name is. Second, at least for me, they'rehard to come up with.

My first and second choices are almost always taken; three letter namesusually go fast, if the system even allows them


Why I am not entirely fond of Solaris 10 x86's boot archive

I am not a fan of initial ramdisks (initrds in Linux jargon), but eversince I discovered Solaris 10's version of the concept I've thought itwas the most sensible approach to the whole issue. Just having all the drivers in the boot archive, rather than trying to pick out the onesthe system thinks it will need, eliminates one entire set of annoyingproblems.

(The other Linux initrd problem is where the kernel version doesn'tmatch the version of modules in the initrd;


Two problems with Python's file iterators

Modern versions of Python let you process each line in a file in asimple way, with just ' for line in fp: .. ', replacing either manual while loops with .readline() or the memory inefficiency of letting .readlines() pull the entire thing into memory. But there's twobugs, both of which can be illustrated by running a 'pycat' program:

import sysfor line in sys.stdin:    sys.stdout.write(line)

If you run this without standard


Process memory layout for 32-bit Linux programs

There are actually two memory layouts for 32-bit x86 Linux programs; theold and the new one. First, the simple version of the common bits:

  • first off, the 4Gb address space is split into the lower 3G, for theprocess, and the upper 1G, for the kernel.
  • the program's code, data, and bss start at 128 Mb (0x08048000)and go upwards.
  • the stack grows down

The difference between shells that do job control and shells that don't

Apart from having job control, the difference between a job controlshell and a non job control shell is that job control shells puteach command into a difference process group . They do this even forcommands running in the foreground, because you may later want to ^Z thecommand and push it into the background, and process groups are the coremechanism of doing job control.

(Process groups do two things in job control. First, they let the shellreliably send stop or start signals to all of the processes