Servers:Hercules

From Research
Revision as of 21:03, 6 July 2010 by Rmackenz (talk | contribs) (→‎Adding a new vserver)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Adding a new vserver

  • As root on hercules:
  • First create the template the server will use for portage
# cd /etc/managed-portage/
# rsync -avP hosts/TEMPLATE_webdb/ hosts/sr-hercules$$
  • Commit the new vserver's template to git
# git add hosts/sr-hercules$$
# git commit -m 'New VM, Hercules$$'
# git push
  • Create the new vserver
# cd ~/vps-siat/scripts/
# ./make-vps sr-hercules$$ br0:10.0.1.XX/16 br0:209.87.56.XX/24
  • Note that $$ must be the number of the new vserver, which start at 00.
  • Further note that XX is the IP to be assigned to the new server. Be very careful not to assign an already taken IP.

Removing an existing vserver

  • As root on hercules:
  • First ensure that the Vserver is stopped
# vserver sr-hercules$$ stop
  • Kill the server
# cd ~/vps-siat/scripts/
# ./kill-vps sr-hercules$$
  • Note that $$ must be the number of the vserver.

Working with managed-portage profiles

  • It is very important that you DO NOT touch /etc/portage/ on any vserver. Everything must be done through /etc/managed-portage/ on the master server.
  • Below are a few common tasks for managed-portage

Setting up vserver-specific USE flags

  • As root on hercules:
# cd /etc/managed-portage/hosts/sr-hercules$$/make.profile/
  • Here you can create/edit any regular files you would under /etc/portage/, such as package.use for example:
# vim package.use
  • Specify what USE flags you'd like a package to use
  • Commit the changes to git
# git commit -m '$MESSAGE' package.use
# git push
# cd /vservers/sr-hercules$$/etc/managed-portage/
# git pull
  • Note that $$ must be the number of the new vserver, which start at 00.
  • Also note that you must replace package.use with whatever file you edited/created.

Changing or setting the profile of a vserver

  • As root on hercules:
# cd /etc/managed-portage/class/$PROFILE
  • Add the name of the vserver to the applies_to file (if your vserver is sr-hercules99, add 'sr-hercules99' to a new line in the file)
  • Commit the changes to git
# git commit -m "$MESSAGE' applies_to
# git push
  • Enter the vserver
# vserver sr-hercules$$ enter
  • Pull the changes from git and emerge
# cd /etc/managed-portage/
# git pull
# emerge -knN @system ; emerge -knN @world ; emerge -knN @installed