summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2012-07-31 15:14:14 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2012-07-31 15:14:14 +0200
commite6622560fe88ffc064b2c80b2fab2c480136caa5 (patch)
tree10cfdf6fb6ea0dc3882f94fd6f3363ac3e769c26
parent3aa0a28498fd151880770fbef3c3146674b67bfb (diff)
downloaditzks-systems-e6622560fe88ffc064b2c80b2fab2c480136caa5.tar.gz
itzks-systems-e6622560fe88ffc064b2c80b2fab2c480136caa5.tar.bz2
itzks-systems-e6622560fe88ffc064b2c80b2fab2c480136caa5.zip
/bin/diskless-workstation-shell, /man/diskless-workation-shell.8: Add script for diskless chroot maintenance to itzks-packages-disklserver package.
-rwxr-xr-xbin/diskless-workstation-shell79
-rw-r--r--debian/changelog3
-rw-r--r--debian/itzks-packages-disklserver.install1
-rw-r--r--man/diskless-workstation-shell.827
4 files changed, 110 insertions, 0 deletions
diff --git a/bin/diskless-workstation-shell b/bin/diskless-workstation-shell
new file mode 100755
index 0000000..296ab27
--- /dev/null
+++ b/bin/diskless-workstation-shell
@@ -0,0 +1,79 @@
+#!/bin/bash
+
+# Copyright (C) 2011 by Mike Gabriel <mike.gabriel@it-zukunft-schule.de>
+
+# This script is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This script is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+set -e
+
+VERSION=0.1
+DLW_SHELL="bash"
+CHROOT="/srv/ltsp/i386/"
+
+test -e "$CHROOT" || {
+ echo "ERROR: Diskless workstation chroot does not exist at $CHROOT."
+ exit -1
+}
+
+[ "x$USER" == "xroot" ] || {
+ echo "ERROR: Diskless workstation management has to be performed as root."
+ exit -2
+}
+
+cat > "$CHROOT/dlw_shell.sh" <<EOF
+#!/bin/bash
+mount -tproc proc /proc &> /dev/null
+mount /dev/pts &> /dev/null
+export HOME=/root
+export LTSP_HANDLE_DAEMONS="false"
+
+# export the proxy server (if any) to the shell.
+export http_proxy=http://webcache.intern:3128
+export https_proxy=http://webcache.intern:3128
+export ftp_proxy=http://webcache.intern:3128
+
+echo 'This shell has been started in your Diskless Workstation chroot environment.'
+echo 'All changes performed here will take effect on your Diskless Workstations'
+echo 'after their next (re)boot. So be careful!!!'
+echo
+echo "To return from this chroot shell hit STRG+D or type ,,exit'' on the"
+echo 'command line...'
+echo
+echo 'Note: Service restarts have been disabled in Diskless Workstation chroot'
+echo 'during maintenance work.'
+echo
+
+# disable service restarts
+#test -e /sbin/start-stop-daemon.keep || mv /sbin/start-stop-daemon /sbin/start-stop-daemon.keep
+#echo '#!/bin/sh' > /sbin/start-stop-daemon
+#echo 'exit 0' >> /sbin/start-stop-daemon
+#chmod +x /sbin/start-stop-daemon
+
+/bin/$DLW_SHELL
+
+# restore start-stop-daemon
+#[ \$(stat --format '%s' /sbin/start-stop-daemon) -lt 200 ] && mv /sbin/start-stop-daemon.keep /sbin/start-stop-daemon
+
+umount -l /proc &> /dev/null
+umount -l /dev/pts &> /dev/null
+
+echo
+echo "Diskless Workstation Shell has exited."
+echo
+EOF
+chmod u+x "$CHROOT/dlw_shell.sh"
+chroot "$CHROOT" /dlw_shell.sh
+
diff --git a/debian/changelog b/debian/changelog
index a654524..dc735cf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,9 @@ itzks-packages (2012.07.30.2) UNRELEASED; urgency=low
+ Add vim to list of dependencies.
* Add meta-package:
+ itzks-packages-diskless.
+ * /bin/diskless-workstation-shell, /man/diskless-workation-shell.8:
+ + Add script for diskless chroot maintenance to itzks-packages-disklserver
+ package.
-- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Mon, 30 Jul 2012 16:15:38 +0200
diff --git a/debian/itzks-packages-disklserver.install b/debian/itzks-packages-disklserver.install
new file mode 100644
index 0000000..3415af5
--- /dev/null
+++ b/debian/itzks-packages-disklserver.install
@@ -0,0 +1 @@
+bin/diskless-workstation-shell usr/sbin/
diff --git a/man/diskless-workstation-shell.8 b/man/diskless-workstation-shell.8
new file mode 100644
index 0000000..faf260b
--- /dev/null
+++ b/man/diskless-workstation-shell.8
@@ -0,0 +1,27 @@
+'\" -*- coding: utf-8 -*-
+.if \n(.g .ds T< \\FC
+.if \n(.g .ds T> \\F[\n[.fam]]
+.de URL
+\\$2 \(la\\$1\(ra\\$3
+..
+.if \n(.g .mso www.tmac
+.TH diskless-workstation-shell 8 "July 2012" "Version 0.1" "IT-Zukunft Schule"
+.SH NAME
+diskless-workstation-shell \- Opens a shell within the ITZkS Diskless Workstation Chroot.
+.SH SYNOPSIS
+'nh
+.fi
+.ad l
+\fBdiskless-workstation-shell\fR
+
+.SH DESCRIPTION
+This helper script opens a shell within the ITZkS diskless workstation chroot environment.
+.PP
+\fBNOTE:\fR Use this script to perform maintenance work within your ITZkS diskless workstation chroot.
+.PP
+.SH OPTIONS
+\fBdiskless-workstation-shell\fR has no known options.
+.PP
+.SH AUTHOR
+This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the IT-Zukunft Schule project
+(http://wiki.it-zukunft-schule.de).