/private/var/run
is the place for system/root level pid files to live on OSX (Darwin)
Locking is more complicated (or simple depending on your POV) with the system/API arbitrating device locks rather than writing them to the filesystem.
Do consider the implications of fast user switching and the documentation on Multiple User Environments or simply calling NSTemporaryDirectory
if your locking happens in user space or the application can be fired up more than one at a time.
I have found this guide to installing ArchLinux with Triple Boot on a MacBook Aluminum that was the level of detail I needed, so I will be proceeding with that. It appears to cover everything from the special things needed during install to getting the light sensors and other internal do-dads working post-install with respective drivers.
The main points to overcoming the challenge:
- Install all the bits before the upgrade to the existing HD by booting from the internal CD
- When installing linux install Grub to the PARTITION, not the device, but since that's fruity you've got to set a few flags on the files to make sure the blocks don't move around on you afterward
- After things are installed, remove the superdrive and put in the new HD and install Lion to the second drive using a USB disk install procedure then boot into Lion off that. Refit has problems with booting other OS's off the second device, but off the first device it should work fine.
- Post Lion install, optionally re-claim / re-cycle SL disk space. I plan on leaving it alone while I can, but probably two or three months from now wiping it out once I'm confident my Lion workspace is completely functional
Only real potential trouble I can see with this is that if anything goes sideways I've no longer got the internal super drive to boot from which seems to be a necessity for the third-party OS installs. As I said, OSX dvds will boot just fine from the external firewire BD-R. Perhaps having a usb-enclosure for the superdrive would work? I'm just guessing since USB tends to be much more broadly supported than fw. Worst case scenario I open it up again and rip out the functional drive and re-insert the SuperDrive for the repairs, then remove it again, but I can see this potentially causing headaches with device ids and such, particularly in linux where things will reference /dev/sd* If anybody can confirm they have booted a third-party os install from an external USB stick or USB superdrive enclosure I would feel much better.
EDIT:
New partition scheme for those interested:
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *320.1 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Mac 200.0 GB disk0s2
3: Apple_HFS Linux 10.0 GB disk0s3
4: Microsoft Basic Data Windows 109.6 GB disk0s4
Note the Apple_HFS
next to linux, I specifically formatted this HFS before the windows install so that Windows would not pick it up as C during the installation procedure. During the Linux install procedure I'm going to format with ext3 or ext4.
Order of installs is OSX, Win, Linux. OSX boots from EFI, Windows boots from MBR, and Linux is chain loaded from EFI (refit) to boot from the partition.
EDIT2:
The latest ArchLinux bootable ISO could not boot properly with the default parameters. It would hang infinitely waiting for UDEV UEVENTS. The newer ISO's apparently ship with an open source nVidia driver that blows up on at least a couple of MacBooks. I turned the module off at boot by pressing Tab
instead of hitting enter and appending nouveau.modeset=0
to the vmlinuz load parameters. This allowed me to get to a root shell.
EDIT3:
I ran into some trouble getting refit to see Linux after the installation. The installer would only install grub to the device, so I had to manually install my boot loader. It was a bit tricky, and not really well documented in any of the linked guides so I'll attempt to capture exactly what happened.
Installation went through fine, but when I selected Grub, it would only allow me to install it to the device. Knowing that I did not want that, I hit cancel and tried installing it manually. Grub install failed at first. The trouble with that was since I only formatted the partition ext3 and did not adjust the partition table, the Linux partition was not flagged as bootable. So, I had to tweak and re sync.
- From the install cd, drop to an alt console with FN+alt+f2 and run
parted
- From the GNU Parted console, flag the partition bootable by doing
toggle 3 boot
for me it was 3 since it was /dev/sda3
- This jacks your partition table, so,
exit
to get back to bash and shutdown -h now
then, with a fresh set of electrons, boot into refit console and run gptsync
- With GPT and MBR now in sync, reboot yet again into the install cd
mount /dev/sda3 /mnt
to get back into your hard drive
grub-install --root-directory=/mnt --recheck --no-floppy /dev/sda3
to install grub to the partition
- Go double check
/mnt/boot/grub/menu.lst
to see if everything is ok. For me I ended up having to add the /boot prefixes on the file paths
To try to summarize, neither formatting ext3 nor installing the boot loader to the partition was enough, I needed to touch the partition table to get refit to see it was out of sync and adjust things. I am now successfully triple booting SL, Arch, Win7. I have yet to install the second hard drive.
Best Answer
You can install the
pstree
command using either Homebrew (my personal favourite), MacPorts or Fink and you'll get a command-line, tree view of processes on your Mac.With Homebrew installed, just run:
then use it like
pstree
from the command line.