bsd-jail-object/freebsd-port/p5-BSD-Jail-Object/pkg-descr
author mahlon
Fri, 05 Sep 2008 05:15:48 +0000
branchperl-modules
changeset 0 315eb12b224b
permissions -rw-r--r--
Reorganizing for Trac.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
     1
This is an object oriented perl interface to the FreeBSD jail subsystem.
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
     2
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
     3
Here's a replica of the 'jls' utility in just a few lines of perl:
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
     4
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
     5
  use BSD::Jail::Object 'jids';
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
     6
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
     7
  print "   JID  IP Address      Hostname                      Path\n";
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
     8
  printf "%6d  %-15.15s %-29.29s %.74s\n",
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
     9
      $_->jid, $_->ip, $_->hostname, $_->path foreach jids( instantiate => 1 );
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
    10
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
    11
And here's 'jexec':
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
    12
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
    13
  my $j = BSD::Jail::Object->new( $ARGV[0] ) or die $@;
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
    14
  $j->attach && chdir('/') && exec $ARGV[1] or exit;
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
    15
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
    16
For more info please use 'perldoc' on the module.
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
    17
315eb12b224b Reorganizing for Trac.
mahlon
parents:
diff changeset
    18
Author:	Mahlon E. Smith <mahlon@martini.nu>