From 24b7de34993da6466fd567790f69f632b8c616a5 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 19 Mar 2015 17:20:49 +0100 Subject: [PATCH 1/3] added some script for the live usb image --- contrib/liveusb/chroot.sh | 10 +++++++++ contrib/liveusb/setup.sh | 43 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100755 contrib/liveusb/chroot.sh create mode 100755 contrib/liveusb/setup.sh diff --git a/contrib/liveusb/chroot.sh b/contrib/liveusb/chroot.sh new file mode 100755 index 000000000..6e02c1bed --- /dev/null +++ b/contrib/liveusb/chroot.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +mount /dev/sdb1 /media/usb + +for part in dev sys proc; do + umount /media/usb/$part + mount -o bind /$part /media/usb/$part +done + +chroot /media/usb diff --git a/contrib/liveusb/setup.sh b/contrib/liveusb/setup.sh new file mode 100755 index 000000000..62c46b1c7 --- /dev/null +++ b/contrib/liveusb/setup.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +set -e + +RECEIPENTS="stvogel@eonerc.rwth-aachen.de,mstevic@eonerc.rwth-aachen.de" +FROM="Simulator2Simulator Server " + +SERVER=tux.0l.de +USER=acs + +PORT=$(shuf -i 60000-65535 -n 1) + +IP=$(curl -s http://ifconfig.me) + +# check if system has net connectivity. otherwise die... +ssh -q -o ConnectTimeout=2 $USER@$SERVER + +# setup SSH tunnel for mail notification +ssh -f -N -L 25:localhost:25 $USER@$SERVER +# setup SSH reverse tunnel for remote administration +ssh -f -N -R $PORT:localhost:22 $USER@$SERVER + +# send mail with notification about new node +mail -s "New S2SS node alive: $IP ($HOSTNAME)" -a "From: $FROM" "$RECEIPENTS" < Date: Thu, 19 Mar 2015 17:21:53 +0100 Subject: [PATCH 2/3] added systemd unit files for liveusb setup --- contrib/liveusb/dhclient.service | 11 +++++++++++ contrib/liveusb/setup.service | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 contrib/liveusb/dhclient.service create mode 100644 contrib/liveusb/setup.service diff --git a/contrib/liveusb/dhclient.service b/contrib/liveusb/dhclient.service new file mode 100644 index 000000000..002f7ad7d --- /dev/null +++ b/contrib/liveusb/dhclient.service @@ -0,0 +1,11 @@ +[Unit] +Description=dhclient on all interfaces +Wants=network.target +Before=network.target + +[Service] +Type=forking +ExecStart=/sbin/dhclient -4 + +[Install] +WantedBy=network.target diff --git a/contrib/liveusb/setup.service b/contrib/liveusb/setup.service new file mode 100644 index 000000000..50206d3cc --- /dev/null +++ b/contrib/liveusb/setup.service @@ -0,0 +1,17 @@ +[Unit] +Description=S2SS LiveUSB Image setup +Requires=dhclient.service network.service +After=dhclient.service + +[Service] +Type=simple +ExecStart=/s2ss/contrib/liveusb/setup.sh +RemainAfterExit=yes + +TimeoutSec=120 + +Restart=on-failure +RestartSec=10 + +[Install] +WantedBy=multi-user.target From a78b089801641312bb9b479599ffda85b84590f5 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 19 Mar 2015 17:23:56 +0100 Subject: [PATCH 3/3] added list of installed packages for the liveusb --- contrib/liveusb/yum-packages.txt | 56 ++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 contrib/liveusb/yum-packages.txt diff --git a/contrib/liveusb/yum-packages.txt b/contrib/liveusb/yum-packages.txt new file mode 100644 index 000000000..0a5117f19 --- /dev/null +++ b/contrib/liveusb/yum-packages.txt @@ -0,0 +1,56 @@ +authconfig-6.2.6-4.fc20.x86_64 +automake-1.13.4-6.fc20.noarch +bash-completion-2.1-3.fc20.noarch +bind-utils-9.9.4-18.P2.fc20.x86_64 +biosdevname-0.5.0-2.fc20.x86_64 +bzip2-1.0.6-9.fc20.x86_64 +dhclient-4.2.7-2.fc20.x86_64 +dosfstools-3.0.27-1.fc20.x86_64 +dracut-config-rescue-037-11.git20140402.fc20.x86_64 +e2fsprogs-1.42.12-3.fc20.x86_64 +efibootmgr-0.11.0-1.fc20.x86_64 +ftp-0.17-65.fc20.x86_64 +gcc-4.8.3-7.fc20.x86_64 +gdb-7.7.1-21.fc20.x86_64 +gdisk-0.8.10-2.fc20.x86_64 +git-svn-1.9.3-2.fc20.x86_64 +grub2-2.00-27.fc20.x86_64 +htop-1.0.3-3.fc20.x86_64 +iptables-services-1.4.19.1-1.fc20.x86_64 +kbd-1.15.5-12.fc20.x86_64 +kernel-modules-extra-3.18.9-100.fc20.x86_64 +kernel-rt-modules-extra-3.14.29-200.rt26.1.fc20.ccrma.x86_64 +libconfig-1.4.9-5.fc20.x86_64 +lshw-B.02.17-2.fc20.x86_64 +lzo-devel-2.08-1.fc20.x86_64 +mailx-12.5-11.fc20.x86_64 +man-db-2.6.5-6.fc20.x86_64 +minicom-2.6.2-4.fc20.x86_64 +nano-2.3.2-5.fc20.x86_64 +nmap-6.45-1.fc20.x86_64 +ntp-4.2.6p5-20.fc20.x86_64 +numactl-2.0.9-2.fc20.x86_64 +openssh-server-6.4p1-8.fc20.x86_64 +openssl-devel-1.0.1e-41.fc20.x86_64 +parted-3.1-13.fc20.x86_64 +passwd-0.79-2.fc20.x86_64 +patch-2.7.1-7.fc20.x86_64 +pciutils-devel-3.3.0-1.fc20.x86_64 +planetccrma-repo-1.1-3.fc20.ccrma.noarch +policycoreutils-2.2.5-4.fc20.x86_64 +psmisc-22.20-3.fc20.x86_64 +readline-devel-6.2-10.fc20.x86_64 +rootfiles-8.1-16.fc20.noarch +schedtool-1.3.0-9.fc20.x86_64 +screen-4.1.0-0.19.20120314git3c2946.fc20.x86_64 +setserial-2.17-34.fc20.x86_64 +socat-1.7.2.4-1.fc20.x86_64 +ssmtp-2.64-14.fc20.x86_64 +sudo-1.8.12-1.fc20.x86_64 +tar-1.26-31.fc20.x86_64 +tcpdump-4.5.1-3.fc20.x86_64 +texinfo-5.1-4.fc20.x86_64 +traceroute-2.0.20-1.fc20.x86_64 +tuned-2.4.1-3.fc20.noarch +wget-1.16.1-2.fc20.x86_64 +yum-utils-1.1.31-27.fc20.noarch