aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1999-04-28 11:38:52 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1999-04-28 11:38:52 +0000
commit75c13541908625d7ee0894cc03f96ab773f7dae2 (patch)
tree3973fb29b005a590ff106ee83445664b44d7b8b6 /bin
parent02daf150a4434305b9181b0ac9150762afb4c8ce (diff)
downloadsrc-75c13541908625d7ee0894cc03f96ab773f7dae2.tar.gz
src-75c13541908625d7ee0894cc03f96ab773f7dae2.zip
This Implements the mumbled about "Jail" feature.
This is a seriously beefed up chroot kind of thing. The process is jailed along the same lines as a chroot does it, but with additional tough restrictions imposed on what the superuser can do. For all I know, it is safe to hand over the root bit inside a prison to the customer living in that prison, this is what it was developed for in fact: "real virtual servers". Each prison has an ip number associated with it, which all IP communications will be coerced to use and each prison has its own hostname. Needless to say, you need more RAM this way, but the advantage is that each customer can run their own particular version of apache and not stomp on the toes of their neighbors. It generally does what one would expect, but setting up a jail still takes a little knowledge. A few notes: I have no scripts for setting up a jail, don't ask me for them. The IP number should be an alias on one of the interfaces. mount a /proc in each jail, it will make ps more useable. /proc/<pid>/status tells the hostname of the prison for jailed processes. Quotas are only sensible if you have a mountpoint per prison. There are no privisions for stopping resource-hogging. Some "#ifdef INET" and similar may be missing (send patches!) If somebody wants to take it from here and develop it into more of a "virtual machine" they should be most welcome! Tools, comments, patches & documentation most welcome. Have fun... Sponsored by: http://www.rndassociates.com/ Run for almost a year by: http://www.servetheweb.com/
Notes
Notes: svn path=/head/; revision=46155
Diffstat (limited to 'bin')
-rw-r--r--bin/ps/print.c4
-rw-r--r--bin/ps/ps.17
2 files changed, 9 insertions, 2 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 19560ce2c25b..f60cab6e5034 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#endif
static const char rcsid[] =
- "$Id: print.c,v 1.33 1998/11/25 09:34:00 dfr Exp $";
+ "$Id: print.c,v 1.34 1999/04/06 03:17:57 peter Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -222,6 +222,8 @@ state(k, ve)
*cp++ = 's';
if ((flag & P_CONTROLT) && KI_EPROC(k)->e_pgid == KI_EPROC(k)->e_tpgid)
*cp++ = '+';
+ if (flag & P_JAILED)
+ *cp++ = 'J';
*cp = '\0';
(void)printf("%-*s", v->width, buf);
}
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index cfdbe2078d3e..5283558524ee 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
-.\" $Id: ps.1,v 1.19 1998/06/04 07:02:59 jkoshy Exp $
+.\" $Id: ps.1,v 1.20 1999/04/06 03:18:57 peter Exp $
.\"
.Dd April 18, 1994
.Dt PS 1
@@ -243,6 +243,11 @@ The first letter indicates the run state of the process:
Marks a process in disk (or other short term, uninterruptible) wait.
.It I
Marks a process that is idle (sleeping for longer than about 20 seconds).
+.It J
+Marks a process which is in
+.Xr jail 2 .
+The hostname of the prison can be found in
+.Ql Li /proc/<pid>/status .
.It R
Marks a runnable process.
.It S