summaryrefslogtreecommitdiffstats
path: root/core/modules/safe-mode
diff options
context:
space:
mode:
authorJonathan Bauer2018-02-14 13:15:54 +0100
committerJonathan Bauer2018-02-14 13:15:54 +0100
commit780e9ebdf01db68760d95d86d09f8bc37d676dba (patch)
tree6ada795174dd2b8fc4a76ead45026e670eb8e399 /core/modules/safe-mode
parent[lightdm-greeter-bwlp] fix path (diff)
parent[run-virt] relax /tmp mount detection regex (diff)
downloadmltk-780e9ebdf01db68760d95d86d09f8bc37d676dba.tar.gz
mltk-780e9ebdf01db68760d95d86d09f8bc37d676dba.tar.xz
mltk-780e9ebdf01db68760d95d86d09f8bc37d676dba.zip
Merge branch 'master' into install-mode
Diffstat (limited to 'core/modules/safe-mode')
-rw-r--r--core/modules/safe-mode/data/etc/systemd/system/exam-mode.target4
l---------core/modules/safe-mode/data/etc/systemd/system/exam-mode.target.wants/exam.service1
l---------core/modules/safe-mode/data/etc/systemd/system/exam-mode.target.wants/graphical.target1
-rw-r--r--core/modules/safe-mode/data/etc/systemd/system/exam.service1
-rwxr-xr-xcore/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode41
5 files changed, 48 insertions, 0 deletions
diff --git a/core/modules/safe-mode/data/etc/systemd/system/exam-mode.target b/core/modules/safe-mode/data/etc/systemd/system/exam-mode.target
new file mode 100644
index 00000000..66438593
--- /dev/null
+++ b/core/modules/safe-mode/data/etc/systemd/system/exam-mode.target
@@ -0,0 +1,4 @@
+[Unit]
+Description=bwLehrpool Klausurmodus
+Requires=multi-user.target
+After=multi-user.target
diff --git a/core/modules/safe-mode/data/etc/systemd/system/exam-mode.target.wants/exam.service b/core/modules/safe-mode/data/etc/systemd/system/exam-mode.target.wants/exam.service
new file mode 120000
index 00000000..4ee9b5fa
--- /dev/null
+++ b/core/modules/safe-mode/data/etc/systemd/system/exam-mode.target.wants/exam.service
@@ -0,0 +1 @@
+../exam.service \ No newline at end of file
diff --git a/core/modules/safe-mode/data/etc/systemd/system/exam-mode.target.wants/graphical.target b/core/modules/safe-mode/data/etc/systemd/system/exam-mode.target.wants/graphical.target
new file mode 120000
index 00000000..949b0756
--- /dev/null
+++ b/core/modules/safe-mode/data/etc/systemd/system/exam-mode.target.wants/graphical.target
@@ -0,0 +1 @@
+../graphical.target \ No newline at end of file
diff --git a/core/modules/safe-mode/data/etc/systemd/system/exam.service b/core/modules/safe-mode/data/etc/systemd/system/exam.service
index be0809b4..14473a6f 100644
--- a/core/modules/safe-mode/data/etc/systemd/system/exam.service
+++ b/core/modules/safe-mode/data/etc/systemd/system/exam.service
@@ -1,6 +1,7 @@
[Unit]
Description=Sets up safe mode (no magic keys, no tty switch, no openbox menu)
DefaultDependencies=no
+Before=graphical.target display-manager.target
[Service]
Type=oneshot
diff --git a/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode b/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode
index ebcee099..0da51848 100755
--- a/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode
+++ b/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode
@@ -19,6 +19,47 @@ disable_magic_keys() {
echo 0 > /proc/sys/kernel/sysrq
}
+change_loginscreen() {
+ local CF="/etc/lightdm/qt-lightdm-greeter.conf"
+ sed -r -i 's/#[a-fA-F0-9]{6}/#757575/g' "/opt/openslx/lightdm/bwlp-banner.svg"
+ sed -r -i '/^greeter-background/d' "$CF"
+ echo "greeter-background-gradient=f9a72b ffffff" >> "$CF"
+}
+
+systemd_config() {
+ # Disable ctrl-alt-delete
+ rm -- "/usr/lib/systemd/system/ctrl-alt-del.target"
+ # No idleaction
+ rm -- "/etc/cron.d/openslx-idleaction"
+ # Ignore everything but power button, no VTs
+ cat > "${FUTURE_ROOT}/etc/systemd/logind.conf" <<EOF
+[Login]
+NAutoVTs=0
+ReserveVT=0
+KillUserProcesses=no
+HandlePowerKey=poweroff
+HandleSuspendKey=ignore
+HandleHibernateKey=ignore
+HandleLidSwitch=ignore
+IdleAction=ignore
+EOF
+ # reload
+ systemd daemon-reload
+ systemctl restart systemd-logind
+}
+
+ssh_banner() {
+ # Visual: ssh banner
+ echo "+ - - - - KLAUSURMODUS AKTIV - - - - +" >> "/etc/issue.net"
+ echo "++++++++++++++++++++++++++++++++++++++" >> "/etc/issue.net"
+}
+
disable_tty_switch
disable_openbox_menu
disable_magic_keys
+change_loginscreen
+systemd_config
+ssh_banner
+
+exit 0
+