http://linux-vserver.org/index.php?title=Rename_vServer&feed=atom&action=history
Rename vServer - Revision history
2024-03-19T02:38:58Z
Revision history for this page on the wiki
MediaWiki 1.20.2
http://linux-vserver.org/index.php?title=Rename_vServer&diff=5036&oldid=prev
Glenn: + Category:Migration
2011-10-21T21:23:48Z
<p>+ <a href="/Category:Migration" title="Category:Migration">Category:Migration</a></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 21:23, 21 October 2011</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 143:</td>
<td colspan="2" class="diff-lineno">Line 143:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[Category:Documentation]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[Category:Documentation]]</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[Category:Migration]]</ins></div></td></tr>
</table>
Glenn
http://linux-vserver.org/index.php?title=Rename_vServer&diff=4827&oldid=prev
Glenn: spelling
2011-10-21T18:59:24Z
<p>spelling</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 18:59, 21 October 2011</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 142:</td>
<td colspan="2" class="diff-lineno">Line 142:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div></pre></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div></pre></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>[[Category:<del class="diffchange diffchange-inline">Documentaion</del>]]</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>[[Category:<ins class="diffchange diffchange-inline">Documentation</ins>]]</div></td></tr>
</table>
Glenn
http://linux-vserver.org/index.php?title=Rename_vServer&diff=4812&oldid=prev
Glenn: +cat
2011-10-21T18:52:04Z
<p>+cat</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 18:52, 21 October 2011</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 141:</td>
<td colspan="2" class="diff-lineno">Line 141:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>cd $orig_dir</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>cd $orig_dir</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div></pre></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div></pre></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[Category:Documentaion]]</ins></div></td></tr>
</table>
Glenn
http://linux-vserver.org/index.php?title=Rename_vServer&diff=3853&oldid=prev
90.152.0.27: /* Sample vServer renaming bash script (wrote for Debian) */
2009-07-20T12:23:19Z
<p><span dir="auto"><span class="autocomment">Sample vServer renaming bash script (wrote for Debian)</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 12:23, 20 July 2009</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 17:</td>
<td colspan="2" class="diff-lineno">Line 17:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Sample vServer renaming bash script (wrote for Debian) ===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Sample vServer renaming bash script (wrote for Debian) ===</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">The script below does not create the dir/symlink for the cache dir - I will update it within the week.</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><pre></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><pre></div></td></tr>
</table>
90.152.0.27
http://linux-vserver.org/index.php?title=Rename_vServer&diff=3850&oldid=prev
90.152.0.28: /* Sample vServer renaming bash script (wrote for Debian) */
2009-07-16T16:11:53Z
<p><span dir="auto"><span class="autocomment">Sample vServer renaming bash script (wrote for Debian)</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 16:11, 16 July 2009</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 13:</td>
<td colspan="2" class="diff-lineno">Line 13:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   8. Start the vserver in question. It should start properly.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   8. Start the vserver in question. It should start properly.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">A script is provided below to help speed up the renaming process and reduce downtime by automating the sequence. Please make sure you verify the first 5 variables before running the script!</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Sample vServer renaming bash script (wrote for Debian) ===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Sample vServer renaming bash script (wrote for Debian) ===</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 24:</td>
<td colspan="2" class="diff-lineno">Line 26:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>run_rev_path="/var/run/vservers.rev"</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>run_rev_path="/var/run/vservers.rev"</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>vserver_exec="/usr/sbin/vserver"</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>vserver_exec="/usr/sbin/vserver"</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">### DO NOT CHANGE ANYTHING AFTER THIS LINE ###</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>orig_dir=`pwd`</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>orig_dir=`pwd`</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
</table>
90.152.0.28
http://linux-vserver.org/index.php?title=Rename_vServer&diff=3849&oldid=prev
90.152.0.28: New page: == General Administrative Tasks and System Tweaks == === Renaming a vServer === Suppose you want to rename your vserver (the directories not the hostname). This can be accomplished by ren...
2009-07-16T16:09:47Z
<p>New page: == General Administrative Tasks and System Tweaks == === Renaming a vServer === Suppose you want to rename your vserver (the directories not the hostname). This can be accomplished by ren...</p>
<p><b>New page</b></p><div>== General Administrative Tasks and System Tweaks ==<br />
=== Renaming a vServer ===<br />
<br />
Suppose you want to rename your vserver (the directories not the hostname). This can be accomplished by renaming the config directory and the root for the vserver in question, then modifying 3 symlinks to match.<br />
<br />
1. Stop the vserver in question<br />
2. rename the /vservers/<server name> directory<br />
3. rename the /etc/vservers/<server name> directory<br />
4. update link: /etc/vservers/<server name>/run -> /var/run/vservers/<server name><br />
5. update link: /etc/vservers/<server name>/vdir -> /etc/vservers/.defaults/vdirbase/<server name><br />
6. update link: /etc/vservers/<server name>/cache -> /etc/vservers/.defaults/cachebase/<server name><br />
7. update link: /var/run/vservers.rev/<server XID> -> /etc/vservers/<server name><br />
8. Start the vserver in question. It should start properly.<br />
<br />
<br />
=== Sample vServer renaming bash script (wrote for Debian) ===<br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
data_path="/data/vservers"<br />
config_path="/etc/vservers"<br />
run_path="/var/run/vservers"<br />
run_rev_path="/var/run/vservers.rev"<br />
vserver_exec="/usr/sbin/vserver"<br />
orig_dir=`pwd`<br />
<br />
function throwError {<br />
echo ""<br />
echo "-------------------------------"<br />
echo "Error: $error";<br />
echo "-------------------------------"<br />
cd $orig_dir<br />
exit 0<br />
}<br />
<br />
function checkExist {<br />
echo ""<br />
cd $data_path<br />
ls --color $data_path<br />
echo ""<br />
echo -n "What is the name of the vServer you wish to rename? : "<br />
read orig_name<br />
<br />
if [[ ! -d "$data_path/$orig_name" ]]; then<br />
checkExist<br />
fi<br />
}<br />
<br />
function newName {<br />
echo ""<br />
echo -n "What is the new name you would like? : "<br />
read new_name<br />
<br />
if [[ "$new_name" == "" ]]; then<br />
echo "Name supplied was empty"<br />
newName<br />
fi<br />
<br />
if [[ -d "$data_path/$new_name" ]]; then<br />
echo "Name already in use!"<br />
newName<br />
fi<br />
}<br />
<br />
function confirm {<br />
read u_confirm<br />
if [[ "$u_confirm" != "y" ]]; then<br />
error="Cancelled by user"<br />
throwError<br />
fi<br />
}<br />
<br />
echo ""<br />
echo "Data path: $data_path"<br />
echo "Config path: $config_path"<br />
echo "Run path: $run_path"<br />
echo "Run rev path: $run_rev_path"<br />
echo "vServer executable $vserver_exec"<br />
echo ""<br />
echo -n "Are these paths correct? y/N : "<br />
confirm<br />
<br />
checkExist<br />
newName<br />
<br />
# Check all the dirs and symlinks exist<br />
<br />
if [[ ! -d "$config_path/$orig_name" ]] || [[ "$orig_name" == "" ]]; then<br />
error="vServer config path doesn't exist"<br />
throwError<br />
fi<br />
<br />
# Grab the context for that vServer<br />
context=`cat $config_path/$orig_name/context`<br />
<br />
if [[ ! -d "$run_rev_path/$context" ]]; then<br />
error="vServer run rev path ($run_rev_path/$context) doesn't exist"<br />
throwError<br />
fi<br />
<br />
if [[ ! -f "$vserver_exec" ]]; then<br />
error="vServer exec file doesn't exist"<br />
throwError<br />
fi<br />
<br />
<br />
# Confirm before stopping vServer<br />
<br />
echo ""<br />
echo -n "Are you ready to start the renaming process? y/N : "<br />
confirm<br />
<br />
$vserver_exec $orig_name stop<br />
<br />
mv $data_path/$orig_name $data_path/$new_name<br />
<br />
mv $config_path/$orig_name $config_path/$new_name<br />
<br />
/bin/rm $config_path/$new_name/run<br />
ln -s $run_path/$new_name $config_path/$new_name/run<br />
<br />
/bin/rm $config_path/$new_name/vdir<br />
ln -s $config_path/.defaults/vdirbase/$new_name $config_path/$new_name/vdir<br />
<br />
/bin/rm $config_path/$new_name/cache<br />
ln -s $config_path/.defaults/cachebase/$new_name $config_path/$new_name/cache<br />
<br />
/bin/rm $run_rev_path/$context<br />
ln -s $config_path/$new_name $run_rev_path/$context<br />
<br />
$vserver_exec $new_name start<br />
<br />
cd $orig_dir<br />
</pre></div>
90.152.0.28