Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
checktrust: Let getty display a warning if trust is lost
Create a service "checktrust" which is run before getty is started. If
this service detects that the system has lost trust, a warning message
is dropped into /node/issue.d/notrust.issue.

Create a symlink for agetty in /etc/issue.d to the (only possibly
existing) file in the /node path. agetty shows this message before
the login prompt.

checktrust-for-getty: Use checktrust command
  • Loading branch information
donald committed Jul 9, 2020
1 parent 56266fe commit a018d40
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
14 changes: 14 additions & 0 deletions checktrust/getty-checktrust
@@ -0,0 +1,14 @@
#! /usr/bin/bash

if [ "$(/usr/sbin/checktrust)" = "not trusted" ]; then
mkdir -p /node/issue.d
cat > /node/issue.d/notrust.issue <<EOF
** WARNING: Loss of trust detected **
** Looks like your machine lost the trust of our network. Maybe it was offline for too long. **
** You won't be able to log in. **
** Please contact IT Helpdesk: <helpdesk@molgen.mpg.de>, phone: -1708 **
EOF
else
rm -f /node/issue.d/notrust.issue
fi
11 changes: 11 additions & 0 deletions checktrust/getty-checktrust.service
@@ -0,0 +1,11 @@
[Unit]
Description=Check Mariux64 trust for getty
Before=getty@.service

[Install]
WantedBy=getty@.service

[Service]
Type=oneshot
ExecStart=/usr/libexec/getty-checktrust
RemainAfterExit=yes
4 changes: 4 additions & 0 deletions install.sh
Expand Up @@ -171,4 +171,8 @@ mkdir -p "$DESTDIR$sysconfdir/xdg/lightdm/lightdm.conf.d"
install_data checktrust/lightdm-use-wrapper.conf "$DESTDIR$sysconfdir/xdg/lightdm/lightdm.conf.d/50-use-wrapper.conf"
install_exec checktrust/lightdm-greeter-wrapper "$DESTDIR$usr_exec_prefix/libexec/lightdm-greeter-wrapper"
install_exec checktrust/lightdm-show-trust-warning "$DESTDIR$usr_exec_prefix/libexec/lightdm-show-trust-warning"
mkdir -p "$DESTDIR$sysconfdir/issue.d/"
install_symlink /node/issue.d/notrust.issue "$DESTDIR$sysconfdir/issue.d/notrust.issue"
install_data checktrust/getty-checktrust.service "$DESTDIR$systemdunitdir/getty-checktrust.service"
install_exec checktrust/getty-checktrust "$DESTDIR$usr_exec_prefix/libexec/getty-checktrust"
exit

0 comments on commit a018d40

Please sign in to comment.