echo "Usage: $0 [NAME]" |
echo "Usage: $0 [NAME] <-f>" |
echo "Optionally use -f to remove an already present config directory" |
source /etc/vservers/${VSNAME}.conf |
source ${OLD_CONF_DIR}/${VSNAME}.conf |
if [ -f /etc/vservers/$VSNAME.sh ] |
if [ -f ${OLD_CONF_DIR}/$VSNAME.sh ] |
done < /etc/vservers/$VSNAME.sh |
done < ${OLD_CONF_DIR}/$VSNAME.sh |
echo "default" > ${VSBDIR}/apps/init/mark |
if [ "x${ONBOOT}" == "xyes" ]; then
echo "default" > ${VSBDIR}/apps/init/mark fi |
VSNETDEV="`echo ${VSNET} | cut -d : -f 1`" |
VSNETDEV="`echo ${VSNET} | cut -d : -f 1 | egrep \"^[[:alpha:]]\" `" |
VSNETMASK="`echo ${VSNET} | cut -d : -f 2 | cut -d / -f 2`" |
VSNETMASK="`echo ${VSNET} | cut -d : -f 2 | cut -d / -f 2 -s`" |
echo "Update of proc/dev tree [DONE]" |
OLD_CONF_DIR=/etc/vservers |
if [ -f /etc/vservers/${VSNAME}.conf -a -d /var/lib/vservers/${VSNAME} ]; then |
if [ -f ${OLD_CONF_DIR}/${VSNAME}.conf ]; then |
do_parsesh ;# Convert the [NAME].sh file
do_updatevserver;# Convert proc/dev tree |
do_parsesh ;# Convert the [NAME].sh file
# In case only config should be converted # Check for /etc (in vserver) to be sure that there's really a vserver present (i.e. LVM mounted) if [ -d ${VSROOT}/${VSNAME}/etc ]; then do_updatevserver;# Convert proc/dev tree else echo "Update of proc/dev tree [FAILED]" echo " VServer directory not found or LVM not mounted on ${VSROOT}/${VSNAME}." echo " So no update of proc/dev tree." fi |
See also [Step-by-Step Guide 2.6] under "Migration" for info on how to manually migrate to the new config style. |
Remark from Adrian Wallaschek (to be removed once the script is fixed or checked!): for me the resulting config needed to be fixed (sorry have no time to check the script now): in /etc/vservers/<server>/interface/0/dev I found the IP address making the vserver script believe it was a VLAN config. Putting "eth0" there did the job! Enjoy!
WARNING: The above script does not observe the ONBOOT settings. If you have ONBOOT=no set in your old .conf files then you will need to modify /etc/vservers/<vs>/apps/init/mark (see [here]) so that it reads something other than 'default'. |
Ulimits are currently not converted by the script. |