Project

General

Profile

Osmocom.org Web Servers

Various web servers are running at *.osmocom.org. Each typically runs in a ezjail on a FreeBSD host.
To administer those, you need SSH login privileges on osmocom.org, which shall not be documented here.
(You have access or you don't, for reasons.)

General ezjail maintenance

Get a list of ezjails that currently exist:

root@rita:/home/admin # ezjail-admin list
STA JID  IP              Hostname                       Root Directory
--- ---- --------------- ------------------------------ ------------------------
ZR  1    144.76.43.76    web.osmocom.org                /usr/jails/www-dispatcher
    1    2a01:4f8:191:444b::2:5/64
ZR  2    127.0.1.4       trac.osmocom.org               /usr/jails/trac
    2    2a01:4f8:191:444b::2:6
ZR  3    127.0.1.9       projects.osmocom.org           /usr/jails/projects.osmocom.org
    3    re0|2a01:4f8:191:444b::2:9/64
ZR  4    127.0.1.11      patchwork.osmocom.org          /usr/jails/patchwork.osmocom.org
ZR  5    127.0.1.5       openmoko-backup                /usr/jails/openmoko-backup
    5    2a01:4f8:191:444b::2:6
ZR  6    144.76.43.76    lists.osmocom.org              /usr/jails/lists.osmocom.org
    6    re0|2a01:4f8:191:444b::2:7
ZR  7    127.0.1.13      jenkins.osmocom.org            /usr/jails/jenkins.osmocom.org
    7    re0|2a01:4f8:191:444b::2:13/64
ZR  8    144.76.43.76    git.osmocom.org                /usr/jails/gitosis
    8    2a01:4f8:191:444b::2:5
ZR  9    144.76.43.76    gitdaemon                      /usr/jails/gitdaemon
    9    2a01:4f8:191:444b::2:5
ZR  10   127.0.1.12      gerrit.osmocom.org             /usr/jails/gerrit
    10   re0|2a01:4f8:191:444b::2:12
ZR  11   127.0.1.10      ftp.osmocom.org                /usr/jails/ftp.osmocom.org
ZR  12   144.76.43.76    dns.osmocom.org                /usr/jails/dns
    12   2a01:4f8:191:444b::2:3
ZR  13   144.76.43.92    dect.osmocom.org               /usr/jails/dect.osmocom.org
    13   2a01:4f8:191:444b::2:8
ZR  14   144.76.43.76    cgit.osmocom.org               /usr/jails/cgit
    14   2a01:4f8:191:444b::2:4
ZR  15   144.76.43.76    backup.osmocom.org             /usr/jails/backup-openvpn

Login on an ezjail:

root@rita:/home/admin # ezjail-admin console www-dispatcher

Disk space

ezjail file systems are managed by zfs. Get an overview:

root@rita:/home/admin # zfs list
NAME                               USED  AVAIL  REFER  MOUNTPOINT
tank                               514G  2.13T    31K  none
tank/jails                         492G  2.13T   300K  /usr/jails
tank/jails/backup-openvpn          184M   316M   144M  /usr/jails/backup-openvpn
tank/jails/basejail               1.60G  2.13T   878M  /usr/jails/basejail
tank/jails/basejail9              19.8G  2.13T   891M  /usr/jails/basejail9
tank/jails/cgit                   8.31G  6.69G  1.19G  /usr/jails/cgit
tank/jails/dect.osmocom.org       5.17G  24.8G  2.82G  /usr/jails/dect.osmocom.org
tank/jails/dns                    69.9M   954M  37.9M  /usr/jails/dns
tank/jails/ftp.osmocom.org        2.71G  97.3G  2.20G  /usr/jails/ftp.osmocom.org
tank/jails/gerrit                 8.33G  1.67G  7.19G  /usr/jails/gerrit
tank/jails/gitdaemon               532M  4.48G   468M  /usr/jails/gitdaemon
tank/jails/gitosis                6.29G  3.71G  5.90G  /usr/jails/gitosis
tank/jails/jenkins.osmocom.org    54.4G  17.3G  22.7G  /usr/jails/jenkins.osmocom.org
tank/jails/lists.osmocom.org      3.63G  36.4G  2.49G  /usr/jails/lists.osmocom.org
tank/jails/newjail                4.76M  2.13T  3.89M  /usr/jails/newjail
tank/jails/openmoko-backup         355G   245G   355G  /usr/jails/openmoko-backup
tank/jails/patchwork.osmocom.org  2.31G  37.7G  1.56G  /usr/jails/patchwork.osmocom.org
tank/jails/projects.osmocom.org   15.6G  14.4G  15.0G  /usr/jails/projects.osmocom.org
tank/jails/trac                   5.94G  9.06G  5.10G  /usr/jails/trac
tank/jails/www-dispatcher         1.85G  8.15G   532M  /usr/jails/www-dispatcher
tank/root                         22.1G  2.13T  19.0G  /
tank/root/tmp                      149M  2.13T   148M  /tmp
tank/root/var                     1.36G  2.13T  1.15G  /var

In ZFS, a tank contains the actual current file system as well as any number of snapshots thereof.
The 'quota' refers to the combined file system + snapshots, while 'refquota' means only the current file system without snapshots.

This means that jenkins.osmocom.org has 40G of space for its root file system, while the snapshots may grow indefinitely:

root@rita:/home/admin # zfs get quota,refquota tank/jails/jenkins.osmocom.org
NAME                            PROPERTY  VALUE     SOURCE
tank/jails/jenkins.osmocom.org  quota     none      local
tank/jails/jenkins.osmocom.org  refquota  40G       local

To change the refquota (or quota):

root@rita:/home/admin # zfs set refquota=5G tank/jails/cgit
root@rita:/home/admin # zfs set quota=none tank/jails/cgit

Individual server details

www-dispatcher

ezjail-admin console www-dispatcher
cd /usr/local/etc/nginx
service nginx reload

redmine

ezjail-admin console projects.osmocom.org
cd /usr/local/www/redmine-*
service nginx reload

gerrit

ezjail-admin console gerrit
ls /usr/local/share/gerrit/config/
cd /usr/local/share/gerrit/
./bin/gerrit.sh stop
/etc/rc.local   # restarts gerrit

To add a git repos to gerrit:

First edit gitosis config so that only gerrit has 'writable' access to the repos.

root@gerrit:~ # su gerrit
[gerrit@gerrit /root]$ cd /usr/local/share/gerrit/git/
[gerrit@gerrit ~/git]$ git clone --bare git://git.osmocom.org/<name>.git
[gerrit@gerrit ~/git]$ exit
root@gerrit:~ # cd /usr/local/share/gerrit/
root@gerrit:/usr/local/share/gerrit # ./bin/gerrit.sh stop
root@gerrit:/usr/local/share/gerrit # /etc/rc.local

jenkins

ezjail-admin console jenkins.osmocom.org
service jenkins restart
OR
pkill -9 java && service jenkins start
OR
ezjail-admin restart jenkins.osmocom.org  # on the ezjail host of course

gitosis

gitosis access rights config is done via git.osmocom.org:gitosis-admin.git

ezjail-admin console gitosis
cd /usr/local/git/repositories

If a repository is added on gitosis, it also needs to be added on cgit (and gerrit).

cgit

ezjail-admin console cgit
vi /etc/config.cgit.repos

To clear the cache:

rm /var/cache/cgit/*
Add picture from clipboard (Maximum size: 48.8 MB)