Editing OpenSUSE template creation

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 9: Line 9:
 
=== Preparing the base system ===
 
=== Preparing the base system ===
  
Run <code>yast2</code> on your openSUSE 10.3 installation (this does not have to be your OpenVZ HN, you can prepare cache on one box and put it on your OpenVZ HN). Proceed with <code>Software->Installation into directory</code> option. It is assumed that this directory is current directory in following instructions (unless otherwise stated).
+
Run <code>yast2</code> on your openSUSE 10.3 installation (this does not have to be your OpenVZ HN). Proceed with Software->Installation into directory.  
  
 
=== Create device nodes ===
 
=== Create device nodes ===
  
I suggest creating all required nodes directly in the <code>lib/udev/devices/</code>, in that case you don't have to disable udev in startup scripts.
+
I suggest creating all required nodes directly in the <code>\<DIRINSTALL\>/lib/udev/devices/</code>, in that case you don't have to disable udev in startup scripts.
 
 
Execute the following commands to create device files:
 
  
 +
Change directory to <code>\<DIRINSTALL\>/lib/udev/devices/</code> and execute the following commonds:
 
<pre>
 
<pre>
mknod -m 666 lib/udev/devices/full c 1 7
+
mknod -m 666 full c 1 7
mknod -m 600 lib/udev/devices/initctl p
+
mknod -m 600 initctl p
mknod -m 666 lib/udev/devices/random c 1 8
+
mknod -m 666 random c 1 8
mknod -m 444 lib/udev/devices/urandom c 1 9
+
mknod -m 444 urandom c 1 9
</pre>
 
 
 
=== Fix console redirect ===
 
 
 
Open <code>etc/init.d/halt</code> script and replace the following lines:
 
<pre>
 
# Redirect our mesages to default console
 
test -n "$REDIRECT" && exec 0<> $REDIRECT 1>&0 2>&0
 
</pre>
 
with this one (note <code>|| true</code> at the end):
 
<pre>
 
# Redirect our mesages to default console
 
test -n "$REDIRECT" && exec 0<> $REDIRECT 1>&0 2>&0 || true
 
</pre>
 
 
 
The reason is that this redirect fails with permission denied in OpenVZ environment if <code>$REDIRECT</code> is console device (<code>/dev/console</code>). As a result, script terminates with error (because of <code>set +e</code> at the beginning) and the box is not stopped properly.
 
 
 
As an option, you can replace console device with regular file:
 
 
 
<pre>
 
rm lib/udev/devices/console ; touch lib/udev/devices/console
 
</pre>
 
 
 
=== Make df working ===
 
<pre>
 
rm -f etc/mtab
 
ln -s /proc/mounts etc/mtab
 
 
</pre>
 
</pre>
  
 
== Disable parallel startup of services ==
 
== Disable parallel startup of services ==
  
Set <code>RUN_PARALLEL</code> variable in <code><DIRINSTALL>/etc/sysconfig/boot</code> to "no".
+
Set <code>RUN_PARALLEL</code> variable in <code>\<DIRINSTALL\>/etc/sysconfig/boot</code> to "no".
  
 
== Disable boot.klog ==
 
== Disable boot.klog ==
  
For some reason, <code>klogd</code> hangs when tries to retrieve kernel log. You need to disable it. Simply delete <code>etc/rc.d/boot.d/S*boot.klog</code>
+
For some reason, <code>klogd</code> hangs when tries to retrieve kernel log. You need to disable it. Simply delete <code>\<DIRINSTALL\>/etc/rc.d/boot.d/S08boot.klog</code>
  
 
== Create OS template ==
 
== Create OS template ==
 
Create OS template cache by invoking the following command:
 
tar --numeric-owner -czf /vz/template/cache/opensuse-10.3-i386-default.tar.gz ./
 
 
{{Note|For Debian-based host you should put the archive inside <code>/var/lib/vz/template/cache</code>}}
 
  
  
== startproc troubleshooting ==
+
Create OS template cache by invoking the following command (from inside <code>\<DIRINSTALL\></code):
 +
<code>
 +
tar -czf /vz/template/cache/opensuse-10.3-i386-default.tar.gz ./
 +
</code>
  
It was noted that <code>startproc</code> under recent OpenVZ kernels sometimes fails with errors like <code>startproc: cannot stat /proc/1128/exe: Permission denied</code>. See http://openvz.org/pipermail/devel/2008-January/010278.html and follow-ups for workaround.
+
For Debian-based host you should put the archive inside <code>/var/lib/vz/template/cache</code>
  
 
[[Category: HOWTO]]
 
[[Category: HOWTO]]
 
[[Category: Templates]]
 
[[Category: Templates]]

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Template used on this page: