<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
(I previously replied to Nikolay only -- re-sending with devel@
included)<br>
<br>
<div class="moz-cite-prefix">On 05/12/2015 02:36 AM, Nikolay Tenev
wrote:<br>
</div>
<blockquote
cite="mid:CAPu8zr3rBz3SZCvgguvvY0SzFCs1ikoHJXAH6hGyfLbo2sbCUw@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<div dir="ltr">Hello devs,
<div><br>
</div>
<div>
<div>In my project I wanted to make every OpenVZ container to
use for a private directory (VE_PRIVATE) separated block
device (HDD partition, lvm volume, NFS share, etc.). To use
wrapper script over vzctl was one option, but PRE_CREATE
hook, in which to create, mkfs and mount LVM volume would be
even better.</div>
<div><br>
</div>
<div>So, I'm not a developer, but using code from POST_CREATE
hook I was able to create the PRE_CREATE one, which can be
used as the other hooks e.g.</div>
<div><br>
</div>
<div>add in /etc/vz/dists/ default</div>
<div>PRE_CREATE = precreate.sh</div>
<div><br>
</div>
<div>and during</div>
<div>vzctl --create ...</div>
<div><br>
</div>
<div>it will call /etc/vz/dists/scripts/precreate.sh with VEID
as argument<br>
</div>
</div>
</div>
</blockquote>
<br>
Nope. These scripts are per-distribution scripts, i.e. they are
targeted for<br>
various distro-specific things, such as setting IP addresses etc.<br>
<br>
What you need is a global script, not dependent on CT distro. I
suggest<br>
a precreate.sh script similar to prestart.sh one (for details, see
commit<br>
<a class="moz-txt-link-freetext"
href="https://github.com/kolyshkin/vzctl/commit/0807ef4">https://github.com/kolyshkin/vzctl/commit/0807ef4</a>)<br>
<br>
<blockquote
cite="mid:CAPu8zr3rBz3SZCvgguvvY0SzFCs1ikoHJXAH6hGyfLbo2sbCUw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>
<div>Currently I have a patch to vzctl master branch which
implements this PRE_CREATE hook and I'm ready to share it.</div>
<div><br>
</div>
<div>So my questions are:</div>
<div>- Do you find this for interesting and/or useful?</div>
<div>- If 'yes', what is the right way to send this patch:
here, by email; or to create pull request in git repo?</div>
</div>
</div>
</blockquote>
<br>
The best way would be to redo as advised above and send a patch to
devel@ list.<br>
<br>
Thanks,<br>
Kir.<br>
<br>
<blockquote
cite="mid:CAPu8zr3rBz3SZCvgguvvY0SzFCs1ikoHJXAH6hGyfLbo2sbCUw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div><br>
</div>
<div>Best regards!</div>
</div>
<div><br>
</div>
<div>Nikolay Tenev</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Devel@openvz.org">Devel@openvz.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openvz.org/mailman/listinfo/devel">https://lists.openvz.org/mailman/listinfo/devel</a>
</pre>
</blockquote>
<br>
</body>
</html>