[Users] More on making an OpenVZ template

Sam Trenholme strenholme.usenet at gmail.com
Sun Aug 21 17:30:02 EDT 2011


Thank you very much for fixing this bug.  I can't think of an active
Linux distribution that doesn't have a POSIX-compatible /bin/sh out
there [1] [2], so it's reasonable to expect a container to have
/bin/sh (which can be dash, busybox, pdksh, whatever).

- Sam

[1] There are projects which use Plan 9's userspace instead of a
POSIX-compatible one, but none of them are a full non-POSIX-compatible
Linux distro.  Plan 9 from User Space is an addition to a
POSIX-compatible Linux distribution.  The Glendix project, which would
have been a non-POSIX-like distro, hasn't been updated since 2009.

[2] There is csh and tcsh, and maybe some BSD systems in the 1980s had
csh but no /bin/sh, but the only recent system to use a csh as a
default shell was Mac OS X up until 10.3 (tcsh).  There is also fish,
but there doesn't appear to be any full fledged distro that replaced
/bin/sh with fish.  Ksh is POSIX compatible; all the other UNIX
command shell projects (except possibly kes) appear moribund or dead.

2011/8/21 Kir Kolyshkin <kir at openvz.org>:
> On 08/20/2011 12:18 AM, Sam Trenholme wrote:
>>
>> I am continuing the work of making a tiny OpenVZ template.  One
>> discovery I have is that, for the OpenVZ tools to work, not only is it
>> mandatory for the system to have the Bash shell, but also that /bin/sh
>> has to be a symlink to Bash.  This is because the "vzctl" program
>> prepends the contents of the Bash-only
>> "/etc/vz/dists/scripts/functions" script to any script used by the
>> container to configure the system, and there does not appear to be any
>> way to configure a container to not use this Bash-only script.
>>
>> In other words, any OpenVZ template without /bin/sh being an alias for
>> Bash can not be configured via the "vzctl" tools (nor the
>> corresponding Proxmox/SolusVM/whataever tools that call "vzctl").
>>
>> This in mind, the next release of TinyVZ will include the Bash shell.
>> I actually prefer Bash over Busybox's "ash" shell; I *really* miss the
>> "!$" and "!*" shortcuts, as well as the "history" command, when using
>> this minimal shell.
>
> This is one way of doing things. The other way would be to rectify the
> '/etc/dists/scripts/functions' to not be dependent on bash.
>
> I am currently looking at it, so far I only found that it uses the
> 'function' keyword
> which is bashism. With that removed, it looks like it is working fine in
> either dash
> or busybox sh.
>
> I have committed the patch:
> http://git.openvz.org/?p=vzctl;a=commit;h=f83b28435f582f2f74fb3267b89b061a551b32e2
>
> And then a few more (to check it works in Debian without /bin/bash):
> http://git.openvz.org/?p=vzctl;a=commit;h=a86beacde8c1fba4002eaf5bf48a535e7d46ffc0
> http://git.openvz.org/?p=vzctl;a=commit;h=382f306cd0865bb4bcafc4f7a4b5cfe2f809296c
>
>> Since this is an open source project I am not getting paid for, I have
>> no timeline of when I will make another TinyVZ release, nor do I
>> guarantee I will even make such a release.  Working on TinyVZ has
>> taught me a lot about OpenVZ and hopefully is something that is
>> useful.
>>
>> - Sam
>> _______________________________________________
>> Users mailing list
>> Users at openvz.org
>> https://openvz.org/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> Users at openvz.org
> https://openvz.org/mailman/listinfo/users
>



More information about the Users mailing list