Editing
Running runit-supervised services inside a vserver
(section)
From Linix VServer
Jump to navigation
Jump to 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.
Anti-spam check. Do
not
fill this in!
== Motivation and goals == This is what I wanted to achieve: * Partition a physical server with many responsibilities into vservers that can easily be upgraded individually without breaking any unrelated stuff. * Each service or small set of services should run in its own vserver. * Services should be supervised (started, stopped and managed) by [http://smarden.org/runit runit]. * Service logs should accumulate on the host, not the guests. ** <tt>svlogd</tt> rotates them nicely and can invoke my <tt>multilogcheck</tt> script to alert me of unusual events as a postprocessor, but ** I don't want to install <tt>multilogcheck</tt> inside every vserver because it's messy. ** I don't like syslog. There are many problems with it, but I won't go into that here. *** Therefore, services mostly log to stdout and thus to svlogd. *** For services that absolutely must use syslog, I provide [http://smarden.org/socklog socklog]. *** Again, I don't want a separate <tt>socklog</tt> instance in every vserver. *** Alas, <tt>socklog</tt> is unable to listen on more than one Unix domain socket. **** Luckily, <tt>socat</tt> can be used to relay syslog messages from the vservers to the master <tt>socklog</tt> on the host. (<tt>syslog-ng</tt> would also have done the job nicely.) **** It's also possible to bind mount the <tt>/dev/log</tt> socket in every guest; however, I'm afraid this breaks if you restart socklog after a guest is up. Workaround: make <tt>/dev/log</tt> a symlink to, say, <tt>/var/run/syslog/socket</tt> everywhere and bind mount the host's <tt>/var/run/syslog</tt> directory in the guests; that way the socket will still be available even if socklog unlinks and recreates it. * It should be straightforward and next to transparent to manage the services running in vservers. ** With <tt>runit</tt>, it's easy to delegate management rights of a service to users (chown and chmod some files in the pertinent <tt>supervise</tt> directory). This should continue to work.
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information