add login banner service

Modeled after the one from PVE, but using rust instead of perl for
resolving the nodename and writing to /etc/issue

Behavior differs a bit. We write all non-loopback addresses to this
file, as the gui accepts connections from them all, so limiting it to
the first one is not really sensible.
Further an error to resolve, or only getting loopback addresses won't
write out an empty /etc/issue file, but a note about the error at the
place where the address would be displayed.

Named it "pbsbanner", not "proxmox-backup-banner" as it's rather an
internal tool anyway and mirrors pvebanner, pmgbanner

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2020-02-06 22:08:07 +01:00
parent ba050e3788
commit 274b0c7bb7
5 changed files with 72 additions and 3 deletions

View File

@ -1,13 +1,16 @@
include ../defines.mk
UNITS := \
pbsbanner.service \
DYNAMIC_UNITS := \
proxmox-backup.service \
proxmox-backup-proxy.service
all: $(UNITS)
all: $(UNITS) $(DYNAMIC_UNITS)
clean:
rm -f $(UNITS)
rm -f $(DYNAMIC_UNITS)
.SUFFIXES: .service.in .service
.service.in.service:

15
etc/pbsbanner.service Normal file
View File

@ -0,0 +1,15 @@
[Unit]
Description=Proxmox Backup Server Login Banner
ConditionPathExists=/usr/sbin/pbsbanner
ConditionPathExists=!/usr/bin/pvebanner
DefaultDependencies=no
After=local-fs.target
Before=console-getty.service
[Service]
ExecStart=/usr/sbin/pbsbanner
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=getty.target