globalcitizen / lxc-gentoo

lxc-gentoo: Linux Containers Gentoo Guest Template Script
http://globalcitizen.github.com/lxc-gentoo
GNU General Public License v3.0
85 stars 32 forks source link

OSX missing flock #79

Open globalcitizen opened 8 years ago

globalcitizen commented 8 years ago

Because flock is unavailable, weird errors occur when executing on OSX. This could probably be resolved with a fallback, either to some alternative locking mechanism such as something dodgy and built-in, or no locking at all.

Attempting to obtain an exclusive lock (timeout: 30 min) named "amd64_amd64_rootfs"...
./lxc-gentoo: line 87: printf: `(': invalid format character
./lxc-gentoo: line 88: flock: command not found
./lxc-gentoo: line 91: printf: `(': invalid format character
./lxc-gentoo: line 91: - : syntax error: operand expected (error token is " ")
globalcitizen commented 8 years ago

I wonder if it would be possible to, if flock is not found, alias flock to something emulating its behavior (possibly somewhat dangerously) as well as outputting a big bold warning, in order to avoid the problem of complicating the code for the normal, flock-present case. Possibly even an alias to a special execution mode of the script itself.

specing commented 8 years ago

Linux containers on OS X? What.

globalcitizen commented 8 years ago

Yes, it sounds weird. Let me explain.

jirutka commented 8 years ago

Docker directly depends on features of Linux kernel, the same as LXC and others. How can it natively run on Darwin kernel that doesn’t support these features? The only way I know about is booting Linux VM on VirtualBox or other paravirtualization technology and running Docker inside it.

globalcitizen commented 8 years ago

@jirutka Docker is normally run on OSX exactly as you just described.