Reply
 
Thread Tools Display Modes
  #1  
Old 02-23-2013, 12:04 AM
bforest bforest is offline
Senior Member
 
Join Date: Feb 2009
Location: Va, USofA
Posts: 171
Thanks: 11
Thanked 10 Times in 8 Posts
Default Help installing/configuring Warden
Hello All...

I have a FreeBSD server [sys info at bottom of msg] and would like to use Warden to manage Jails.

I have tried qjail and ezjail with limited success. Warden seems the most robust so I wanted to try that.

I want to use a different pool to store the jails so I created: /jpool/jails
My whole server is on ZFS: rpool(mirror) and jpool(raidz)

After installing Warden via ports I used the commands (as root):

Code:
# /usr/local/warden/scripts/init-warden.sh
# mkdir /usr/local/warden/worlds/defaultworld
# make buildworld installworld DESTDIR=/usr/local/warden/worlds/defaultworld
# pbreg set /PC-BSD/TheWarden/JailDir /jpool/jails
# warden menu
I am figuring there was more I needed to configure here, probably using pbreg, but ... hard to find docs on initial setup.

I created a jail named "apache" at 10.xxx.xxx.229 but found that I could not create any users or attempting to create users failed (including charlie root) I asked "warden delete" to remove the jail and tried a second time. I figure this is just some missing configuration. My system has no /PC-BSD directory for example.

I noticed the following after I deleted the jail the second time. The directory still exists and I cannot remove it. I get a busy error on proc.

Code:
root@dell0:/root # mount
 . . .
devfs on /jpool/jails/10.xxx.xxx.229/dev (devfs, local, multilabel)
procfs on /jpool/jails/10.xxx.xxx.229/proc (procfs, local)
devfs on /jpool/jails/10.xxx.xxx.229/dev (devfs, local, multilabel)
procfs on /jpool/jails/10.xxx.xxx.229/proc (procfs, local)
devfs on /jpool/jails/10.xxx.xxx.229/dev (devfs, local, multilabel)
procfs on /jpool/jails/10.xxx.xxx.229/proc (procfs, local)
devfs on /jpool/jails/10.xxx.xxx.229/dev (devfs, local, multilabel)
procfs on /jpool/jails/10.xxx.xxx.229/proc (procfs, local)
devfs on /jpool/jails/10.xxx.xxx.229/dev (devfs, local, multilabel)
procfs on /jpool/jails/10.xxx.xxx.229/proc (procfs, local)
devfs on /jpool/jails/10.xxx.xxx.229/dev (devfs, local, multilabel)
procfs on /jpool/jails/10.xxx.xxx.229/proc (procfs, local)
devfs on /jpool/jails/10.xxx.xxx.229/dev (devfs, local, multilabel)
procfs on /jpool/jails/10.xxx.xxx.229/proc (procfs, local)
devfs on /jpool/jails/10.xxx.xxx.229/dev (devfs, local, multilabel)
procfs on /jpool/jails/10.xxx.xxx.229/proc (procfs, local)
devfs on /jpool/jails/10.xxx.xxx.229/dev (devfs, local, multilabel)
procfs on /jpool/jails/10.xxx.xxx.229/proc (procfs, local)
devfs on /jpool/jails/10.xxx.xxx.229/dev (devfs, local, multilabel)
procfs on /jpool/jails/10.xxx.xxx.229/proc (procfs, local)
devfs on /jpool/jails/10.xxx.xxx.229/dev (devfs, local, multilabel)
procfs on /jpool/jails/10.xxx.xxx.229/proc (procfs, local)
devfs on /jpool/jails/10.xxx.xxx.229/dev (devfs, local, multilabel)
procfs on /jpool/jails/10.xxx.xxx.229/proc (procfs, local)


root@dell0:/root # rm -R /jpool/jails/10.xxx.xxx.229/proc
 . . . (a lot move above)
rm: /jpool/jails/10.xxx.xxx.229/proc/1/rlimit: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/1/etype: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/1/ctl: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/1/cmdline: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/1: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/10/status: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/10/rlimit: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/10/etype: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/10/ctl: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/10/cmdline: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/10: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/0/status: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/0/rlimit: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/0/etype: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/0/ctl: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/0/cmdline: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/0: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc/curproc: Operation not supported
rm: /jpool/jails/10.xxx.xxx.229/proc: Device busy
Code:
I believe I saw this error when trying to create a user:

cannot open /etc/rc: No such file or directory
jail: /bin/sh /etc/rc: failed
Code:
root@dell0:/root # uname -a
FreeBSD a2h-dell0 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: 
Tue Dec  4 09:23:10 UTC 2012     
root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
Code:
root@dell0:/root # pkg_info | grep warden
warden-1.1.2_1      PC-BSD's Jail Management Utility
Code:
root@dell0:/root # zpool list
NAME       SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
jpool     1.09T   909G   203G    81%  1.00x  ONLINE  -
rpool      136G  19.9G   116G    14%  1.00x  ONLINE  -
Code:
root@a2h-dell0:/root # pbreg get /PC-BSD/TheWarden/ProgDir
/usr/local/warden

root@dell0:/root # pbreg get /PC-BSD/TheWarden/WorldSrc
/usr/src

root@dell0:/root # pbreg get /PC-BSD/TheWarden/WorldDir
/usr/local/warden/worlds/defaultworld

root@dell0:/root # pbreg get /PC-BSD/TheWarden/NIC
bce1

root@dell0:/root # pbreg get /PC-BSD/TheWarden/TMPDIR
/usr/local/warden/tmp

root@dell0:/root # pbreg get /PC-BSD/TheWarden/JailDir
/jpool/jails

root@dell0:/root # pbreg
pbreg Version 1.0
 . . .
__________________
- Ben

Last edited by bforest; 06-03-2013 at 11:48 PM.
Reply With Quote
  #2  
Old 02-23-2013, 03:10 AM
kmoore134's Avatar
kmoore134 kmoore134 is offline
Administrator
 
Join Date: May 2005
Location: Knoxville, TN
Posts: 2,568
Thanks: 0
Thanked 163 Times in 127 Posts
Default Help installing/configuring Warden
That version of warden from ports is super-old, and you'll probably want
the newer stuff. Uninstall it and then grab the latest from here:

# svn co svn://svn.pcbsd.org/pcbsd/current/src-sh src-sh
# cd src-sh/libsh
# make install
# cd ../warden
# make install

After that is done, edit /usr/local/etc/warden.conf and then give it a
whirl.
__________________
----
Kris Moore
PC-BSD Founder
Reply With Quote
The Following User Says Thank You to kmoore134 For This Useful Post:
bforest (03-03-2013)
  #3  
Old 03-03-2013, 05:40 AM
bforest bforest is offline
Senior Member
 
Join Date: Feb 2009
Location: Va, USofA
Posts: 171
Thanks: 11
Thanked 10 Times in 8 Posts
Default
Kris

Thank you for the info and instructions ...

I will attempt this installation this week.

Now that you mention the "warden" port is "behind" the latest... I was wondering when you think the regular FreeBSD port will be updated.

Thanks!
__________________
- Ben
Reply With Quote
  #4  
Old 03-07-2013, 07:14 PM
bforest bforest is offline
Senior Member
 
Join Date: Feb 2009
Location: Va, USofA
Posts: 171
Thanks: 11
Thanked 10 Times in 8 Posts
Default
I attempted to perform this installation but could not get past the first command:

# svn co svn://svn.pcbsd.org/pcbsd/current/src-sh src-sh

I noticed that the CO stands for "check out". I don't think I want to check out because I have no intention to modify and check "back in". I also tried "svn cp ..." for copy but again... nothing. For either command the system just sits. When I run "top"; SVN is mostly idle.

Any suggestions?

I was able to: " ping svn.pcbsd.org " . Is there some way to verify I can make a valid connection to the svn server?

Code:
root@svr-dell0:/root # ping svn.pcbsd.org
PING isc.pcbsd.org (149.20.61.88): 56 data bytes
64 bytes from 149.20.61.88: icmp_seq=0 ttl=45 time=83.453 ms
64 bytes from 149.20.61.88: icmp_seq=1 ttl=45 time=84.022 ms
64 bytes from 149.20.61.88: icmp_seq=2 ttl=45 time=82.781 ms
64 bytes from 149.20.61.88: icmp_seq=3 ttl=45 time=82.836 ms
^C
--- isc.pcbsd.org ping statistics ---
5 packets transmitted, 4 packets received, 20.0% packet loss
round-trip min/avg/max/stddev = 82.781/83.273/84.022/0.507 ms
__________________
- Ben

Last edited by bforest; 03-07-2013 at 08:01 PM.
Reply With Quote
  #5  
Old 03-15-2013, 05:19 AM
kmoore134's Avatar
kmoore134 kmoore134 is offline
Administrator
 
Join Date: May 2005
Location: Knoxville, TN
Posts: 2,568
Thanks: 0
Thanked 163 Times in 127 Posts
Default Help installing/configuring Warden
Is this still an issue? The command is correct, I'm using it here with
no problems.
__________________
----
Kris Moore
PC-BSD Founder
Reply With Quote
  #6  
Old 03-18-2013, 08:55 PM
bforest bforest is offline
Senior Member
 
Join Date: Feb 2009
Location: Va, USofA
Posts: 171
Thanks: 11
Thanked 10 Times in 8 Posts
Default accessing SVN
The only thing I can figure is that I am on a corporate network and trying to access this SVN server outside our network which is likely using port 3690.

Quote:
Unless you explicitly specify the port in the repository URL, it will be port 80 for HTTP, 443 for HTTPS, or 3690 for the SVN protocol

I will try changing the "svn://" to "http://" and see if it helps... I am not confident I can get my Corp. firewall guys to open that port for me.

Any other suggestions?
__________________
- Ben
Reply With Quote
  #7  
Old 03-20-2013, 03:52 PM
bforest bforest is offline
Senior Member
 
Join Date: Feb 2009
Location: Va, USofA
Posts: 171
Thanks: 11
Thanked 10 Times in 8 Posts
Default
Sorry,

your procedure works fine.. It was a firewall issue. I was able to perform the first command at another location and tar up the folder for transport.

Thanks!!
__________________
- Ben
Reply With Quote
  #8  
Old 03-20-2013, 10:40 PM
bforest bforest is offline
Senior Member
 
Join Date: Feb 2009
Location: Va, USofA
Posts: 171
Thanks: 11
Thanked 10 Times in 8 Posts
Default Warden installation on Generic FreeBSD
I received the following error when attempting to use the downloaded "Warden" on my FreeBSD server.

Code:
root@dell0:/ # warden create 10.xxx.202.xxx testjail --src --ports --startauto --vanilla

Fetching jail environment. This may take a while...
Downloading 9.1-RELEASE/amd64/dist/base.txz ...
ERROR: Missing mirror list: /usr/local/share/pcbsd/conf/pcbsd-mirrors
/usr/local/share/warden/scripts/backend/createjail.sh: aria2c: not found
ERROR: Error while downloading the freebsd world.

root@dell0:/ # warden help
I will go look for these on a standard PCBSD9.1 workstation.

(but hope these will be included in the installation... or warden.conf in the future.)
__________________
- Ben
Reply With Quote
  #9  
Old 06-03-2013, 11:42 PM
bforest bforest is offline
Senior Member
 
Join Date: Feb 2009
Location: Va, USofA
Posts: 171
Thanks: 11
Thanked 10 Times in 8 Posts
Default
After all this time...

I attempted to get the files from an PCBSD 9.1 installation I installed today but could not find the files. I did find the scripts but that is what was included in my download so, I guess I didn't install it in the expected location.

I followed line 1 (svn command) in thread post #2 again and downloaded the latest version. I tried to run it again. I got much better results this time. THANKS FOR FIXING!!

So here is current status:

Code:
root@dell0:/root # warden
Warden version 1.3
---------------------------------
Available commands

Type in help <command> for information and usage about that command

  help - This help file
 . . .
 . . .

root@dell0:/root # ping 10.xxx.xxx.139
PING 10.xxx.xxx.139 (10.xxx.xxx.139): 56 data bytes
ping: sendto: Host is down
^C
--- 10.xxx.xxx.139 ping statistics ---
14 packets transmitted, 0 packets received, 100.0% packet loss

root@dell0:/root # warden create 10.xxx.xxx.139 testjail --src --ports --startauto --vanilla

Getting regional mirror...
Using mirror: ftp://ftp.pcbsd.org/pub/mirror
Fetching jail environment. This may take a while...
Downloading ftp://ftp.pcbsd.org/pub/mirror/9.1/amd64/netinstall/fbsd-release.txz ...
Creating ZFS /jpool/jails/.warden-chroot-amd64 dataset...
Building new Jail... Please wait...
Fetching ports...
Done

cp: /usr/local/sbin/pbi*: No such file or directory
chmod: /jpool/jails/10.xxx.xxx.139/usr/local/sbin/pbi*: No such file or directory
cp: /usr/local/etc/rc.d/pbid: No such file or directory

jail -c path=/jpool/jails/10.xxx.xxx.139 host.hostname=10.xxx.xxx.139 allow.raw_sockets=true persist vnet

jail: unknown parameter: vnet

ERROR: Failed starting jail with above command...
Unmounting /jpool/jails/10.xxx.xxx.139/proc
Success!
Jail created at /jpool/jails/10.xxx.xxx.139
root@dell0:/root #

Some problems I have encountered:

Code:
root@dell0:/root # warden list
ID                      AUTOSTART   STATUS      TYPE
---------------------------------------------------------------------------
10.xxx.xxx.139           Enabled     Stopped     standard

root@dell0:/root # warden start 10.xxx.xxx.139
jail -c path=/jpool/jails/10.xxx.xxx.139 host.hostname=10.xxx.xxx.139 allow.raw_sockets=true persist vnet

jail: unknown parameter: vnet

ERROR: Failed starting jail with above command...
Unmounting /jpool/jails/10.xxx.xxx.139/proc

root@dell0:/root # warden details 10.xxx.xxx.139
Details for jail: 10.xxx.xxx.139
Disk Usage: 934MB
Active IPv4 Ports:
Current IPv4 Connections:
Active IPv6 Ports:
Current IPv6 Connections:

root@dell0:/root # warden get 10.xxx.xxx.139
ERROR: No jail specified!

root@dell0:/root # warden get
ERROR: No jail specified!

How do I remove that VNET from the jail start line options?... I think that is being found because this server is also running VirtualBox but I am not sure.

Code:
root@dell0:/root # cat /usr/local/etc/warden.conf
#!/bin/sh
# Configuration options for the Warden
######################################################################

# Network Interface for the jails to use
NIC: bce1

# Directory to use for compressing / decompressing files
WTMP: /jpool/jails

# Location of the jails
JDIR: /jpool/jails

# FreeBSD release to use
FREEBSD_RELEASE: 9.1-RELEASE
root@dell0:/root #
Also, what is the best way to "de-install" Warden that is installed via instructions in post #2. I attempted: "make deinstall" but it is not recognized. I installed this latest version without uninstalling the previous so maybe an issue there.

I also checked and there is no "vimage" installed on this system.

Code:
root@dell0:/root # pkg_info | grep vimage
root@dell0:/root #
__________________
- Ben

Last edited by bforest; 06-04-2013 at 12:22 AM. Reason: clean up post
Reply With Quote
  #10  
Old 06-05-2013, 03:07 PM
bforest bforest is offline
Senior Member
 
Join Date: Feb 2009
Location: Va, USofA
Posts: 171
Thanks: 11
Thanked 10 Times in 8 Posts
Unhappy Warden "get" is broken in CLI ??
Code:
root@dell0:/root # warden get
ERROR: No jail specified!

root@dell0:/root # warden list
ID                      AUTOSTART   STATUS      TYPE
---------------------------------------------------------------------------
10.xxx.xxx.139           Disabled    Stopped     standard

root@dell0:/root # warden get 10.xxx.xxx.139
ERROR: No jail specified!

root@dell0:/root # warden get "10.xxx.xxx.139"
ERROR: No jail specified!

root@dell0:/root #
__________________
- Ben

Last edited by bforest; 06-05-2013 at 03:10 PM.
Reply With Quote
Reply

Tags
jails, warden

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:52 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

Copyright 2005-2010, The PC-BSD Project. PC-BSD and the PC-BSD logo are registered trademarks of iXsystems.
All other content is freely available for sharing under the terms of the Creative Commons Attribution License.