Commit b76f2043 authored by Jørn Åne de Jong's avatar Jørn Åne de Jong

Move files around and build package.

parent 86b88562
/*_amd64
/*.deb
FROM debian:wheezy
WORKDIR /root/
COPY mp-rude mp-rude
COPY build.sh build.sh
RUN ./build.sh
CMD tar c *.deb
**Running rude/crude on measurement beacons**
# Running rude/crude and traceroute on measurement beacons
Filer
etc/init.d/mp-rude - start/stop rude crude
etc/cron.d/mp-rude - cron to start/stop every day a noon
This package installs an init-script for managing rude/crude, and
scripts for starting and stopping traceroute-measurements.
tools/rude-config-maker - make rude configs from rude-list.conf
tools/mp-ut.sh - script to roll out files
tools/mp-cmd - script to run commands on mp's
tools/udp-buf-check - sjekk udp drops per prosess
Configuration files are managed in /etc/mp-rude, where rude-list.conf
must be managed by an administrator or a configuration utility.
rude-list.conf lists of rude/traceroute destinations
mp-list.txt list of nodes
## The following files are of interest:
* /etc/init.d/mp-rude - start/stop rude crude
* /etc/cron.d/mp-rude - cron to start/stop every day a noon
roll out rude/crude to /usr/local/bin with debian packages.
* /usr/bin/rude-config-maker - make rude configs from rude-list.conf
* /usr/bin/mp-cmd - script to run commands on mp's
* /usr/bin/udp-buf-check - sjekk udp drops per prosess
* /etc/mp-rude/rude-list.conf lists of rude/traceroute destinations
## Building
### Using Docker
```
docker build -t mp-rude-debian .
docker run mp-rude-debian | tar x
```
### Manually
See build.sh.
\ No newline at end of file
#!/bin/sh
package="$(sed -n 's/^Package: //p' mp-rude/DEBIAN/control)"
version="$(sed -n 's/^Version: //p' mp-rude/DEBIAN/control)"
echo "package: $package"
echo "version: $version"
cp -a mp-rude "${package}_${version}_amd64"
dpkg-deb -b "${package}_${version}_amd64"
\ No newline at end of file
MAILTO=oak@uninett.no
0 0 * * * root /usr/sbin/service mp-rude restart
59 23 * * * root /etc/mp-rude/stop.sh 50
0 0 * * * root /etc/mp-rude/start.sh
#!/bin/bash
cat $1 | /bin/gzip > $2
[Unit]
Description=Mp-rude init script wrapper
After=network.target
[Service]
ExecStart=/etc/init.d/mp-rude start
ExecStop=/etc/init.d/mp-rude stop
ExecReload=/etc/init.d/mp-rude reload
PIDFile=/var/run/mp-rude.pid
RemainAfterExit=no
Restart=always
Type=forking
[Install]
WantedBy=multiuser.target
alesund-mp.hials.no
alta-mp.hifm.no
bergen-mp.uib.no
drammen-mp.hibu.no
forde-mp.hisf.no
fredrikstad-mp.hiof.no
gjovik-mp.hig.no
grimstad-mp.uia.no
halden-mp.hiof.no
hamar-mp.hihm.no
harstad-mp.hih.no
haugesund-mp.hsh.no
kalvskinnet-mp.hist.no
kristiansand-mp.uia.no
kunnskapsv-mp.hioa.no
lillehammer-mp.hil.no
molde-mp.himolde.no
narvik-mp.hin.no
nesna-mp.hinesna.no
ntnu-mp.ntnu.no
nyalesund-mp.uninett.no
oslo-mp.uio.no
pil32-mp.hioa.no
porsgrunn-mp.hit.no
sogndal-mp.hisf.no
stavanger-mp.uis.no
steinkjer-mp.hint.no
stord-mp.hsh.no
svalbard-mp.unis.no
tromso-mp.uit.no
volda-mp.hivolda.no
Package: mp-rude
Priority: extra
Section: uninett
Architecture: all
Depends: rude, crude, traceroute, perl-base, cron
Maintainer: jorn.dejong@uninett.no
Version: 1.0
Provides: mp-rude
Replaces: mp-rude
Description: Software for measuring network using rude/crude and traceroute.
#!/bin/sh
systemctl enable mp-rude.service
[ -s /var/lib/mp-rude/crude.pipe ] || rm -f /var/lib/mp-rude/crude.pipe
mkfifo /var/lib/mp-rude/crude.pipe
MAILTO=root
# rude/crude
0 0 * * * root /usr/sbin/service mp-rude restart
# traceroute
23 59 * * * root /usr/share/mp-rude/stop.sh 50
0 0 * * * root /usr/share/mp-rude/make-start.sh
......@@ -14,13 +14,13 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
. /lib/lsb/init-functions
RUDE=/usr/local/bin/rude
CRUDE=/usr/local/bin/crude
PIPE=/tmp/mp-rude/crude.pipe
PIPE=/var/lib/mp-rude/crude.pipe
do_start() {
log_begin_msg "Starting rude/crude..."
HOST=$(hostname)
DATE=$(date +%Y-%m-%d)
LOG=/tmp/mp-rude/$HOST-$DATE.crude
LOG=/var/lib/mp-rude/$HOST-$DATE.crude
if test ! -p $PIPE ; then
mkfifo $PIPE
......@@ -39,6 +39,7 @@ do_stop() {
sleep 1
fuser -k $PIPE # kill all processes using pipe
log_end_msg $?
sleep 3
}
case "$1" in
......
date=`date +%Y-%m-%d`
bin=/etc/mp-rude
logpath=/tmp/mp-rude
bin=/usr/share/mp-rude
logpath=/var/lib/mp-rude
trace=$bin/trace.sh
traceconf=/etc/mp-rude/trace.conf
......@@ -4,5 +4,5 @@ mp-list=$1
today=`date +%Y-d-d`
for mp in `cat $mp-list`; do
echo $mp
echo rsync -rv --bwlimit=20MB --exclude "*$today*" root@$mp:/tmp/mp-rude/ /dragonlab/mp-rude/data/$mp
echo rsync -rv --bwlimit=20MB --exclude "*$today*" root@$mp:/var/lib/mp-rude/ /dragonlab/mp-rude/data/$mp
done
#!/bin/bash
source /etc/mp-rude/start.conf
cd /etc/mp-rude
rude-config-maker -target $(hostname -f) rude-list.conf > rude.conf
#!/bin/sh
source /etc/mp-rude/start.conf
. "$bin/make-rude.sh"
. "$bin/start.sh"
#!/bin/sh
/bin/gzip -c $1 > $2
......@@ -6,7 +6,7 @@ log=$logpath/$date/traceroute_$1
#Start traceroute
for i in `cat $traceconf` ; do
$trace $i 23:59 2> /dev/null > /dev/null &
$trace $i 23:59 > /dev/null 2>&1 &
echo "$!" >> $logpath/pids
done
......@@ -15,4 +15,3 @@ fi
for i in $(cat $logpath/pids); do kill $i; done
rm $logpath/pids
alesund-mp.hials.no bergen-mp.uib.no ntnu-mp.ntnu.no
alta-mp.hifm.no tromso-mp.uit.no ntnu-mp.ntnu.no
bergen-mp.uib.no ntnu-mp.ntnu.no oslo-mp.uio.no tromso-mp.uit.no
bo-mp.hit.no oslo-mp.uio.no bergen-mp.uib.no
drammen-mp.hibu.no oslo-mp.uio.no bergen-mp.uib.no
forde-mp.hisf.no bergen-mp.uib.no ntnu-mp.ntnu.no
fredrikstad-mp.hiof.no oslo-mp.uio.no bergen-mp.uib.no
gjovik-mp.hig.no oslo-mp.uio.no bergen-mp.uib.no
grimstad-mp.uia.no oslo-mp.uio.no bergen-mp.uib.no
halden-mp.hiof.no oslo-mp.uio.no bergen-mp.uib.no
hamar-mp.hihm.no oslo-mp.uio.no ntnu-mp.ntnu.no
harstad-mp.hih.no tromso-mp.uit.no ntnu-mp.ntnu.no
haugesund-mp.hsh.no bergen-mp.uib.no stavanger-mp.uis.no
kalvskinnet-mp.hist.no ntnu-mp.ntnu.no bergen-mp.uib.no
kristiansand-mp.uia.no oslo-mp.uio.no bergen-mp.uib.no
kunnskapsv-mp.hioa.no oslo-mp.uio.no bergen-mp.uib.no
lillehammer-mp.hil.no oslo-mp.uio.no ntnu-mp.ntnu.no
molde-mp.himolde.no bergen-mp.uib.no ntnu-mp.ntnu.no
narvik-mp.hin.no tromso-mp.uit.no ntnu-mp.ntnu.no
nesna-mp.hinesna.no tromso-mp.uit.no ntnu-mp.ntnu.no
ntnu-mp.ntnu.no oslo-mp.uio.no bergen-mp.uib.no tromso-mp.uit.no
nyalesund-mp.uninett.no tromso-mp.uit.no ntnu-mp.ntnu.no
oslo-mp.uio.no bergen-mp.uib.no tromso-mp.uit.no ntnu-mp.ntnu.no
pil32-mp.hioa.no oslo-mp.uio.no bergen-mp.uib.no
porsgrunn-mp.hit.no oslo-mp.uio.no bergen-mp.uib.no
sogndal-mp.hisf.no oslo-mp.uio.no bergen-mp.uib.no
stavanger-mp.uis.no bergen-mp.uib.no oslo-mp.uio.no
steinkjer-mp.hint.no ntnu-mp.ntnu.no bergen-mp.uib.no
stord-mp.hsh.no bergen-mp.uib.no stavanger-mp.uis.no
svalbard-mp.unis.no tromso-mp.uit.no ntnu-mp.ntnu.no
teknobyen-mp.uninett.no ntnu-mp.ntnu.no bergen-mp.uib.no
tromso-mp.uit.no oslo-mp.uio.no bergen-mp.uib.no ntnu-mp.ntnu.no
# volda-mp.hivolda.no ntnu-mp.ntnu.no bergen-mp.uib.no
#!/bin/bash
cmd="$1"
for mp in bo-mp.hit.no stord-mp.hsh.no forde-mp.hisf.no harstad-mp.hih.no volda-mp.hivolda.no haugesund-mp.hsh.no tromso-mp.uit.no molde-mp.himolde.no alesund-mp.hials.no fredrikstad-mp.hiof.no svalbard-mp.unis.no porsgrunn-mp.hit.no alta-mp.hifm.no hamar-mp.hihm.no narvik-mp.hin.no pil32-mp.hioa.no ntnu-mp.ntnu.no kristiansand-mp.uia.no sogndal-mp.hisf.no stavanger-mp.uis.no bergen-mp.uib.no grimstad-mp.uia.no lillehammer-mp.hil.no oslo-mp.uio.no halden-mp.hiof.no nesna-mp.hinesna.no nyalesund-mp.uninett.no kunnskapsv-mp.hioa.no drammen-mp.hibu.no steinkjer-mp.hint.no gjovik-mp.hig.no ; do
echo henter $mp
# ssh -q root@$mp sysctl net.core.rmem_default
ssh -q root@$mp "$cmd"
done
#!/bin/bash
hlist=$1
cmd="$2"
for mp in `cat mp-list.txt`; do
echo $mp
eval $cmd
# start-stop-daemon --start --background --pidfile /var/run/mp-crude.pid -m --exec /usr/local/bin/crude -- -P 50 -k -l - | gzip >/tmp/mp-rude/$HOST-$DATE.crude.gz
# rsync -prv etc/ root@$mp:/etc/
# rsync -prv tmp/$mp/ root@$mp:/etc/mp-rude/
# rsync -prv etc/init.d/mp-rude root@$mp:/etc/init.d/
# rsync -prv etc/cron.d/mp-rude root@$mp:/etc/cron.d/
# rsync -prv ~/sw/rude/crude/crude root@$mp:/usr/local/bin
# rsync -prv ~/sw/rude/rude/rude root@$mp:/usr/local/bin
# scp ~/sw/rude/bin/* root@$mp:/usr/local/bin/
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment