Skip to content

Commit db6b617

Browse files
author
Sebastien Roy
authored
Disable Ubuntu motd banner and provide a Delphix-specific one. (#170)
This fix disables the Ubuntu-provided motd banner and replaces it with a simple Delphix-specific banner. It also disables the motd-news systemd service that dynamically fetches news from a public Internet service.
1 parent d3d0fd8 commit db6b617

File tree

3 files changed

+42
-1
lines changed
  • debian
  • files/common
    • etc/update-motd.d
    • var/lib/delphix-platform/ansible/10-delphix-platform/roles/delphix-platform/tasks

3 files changed

+42
-1
lines changed

debian/postinst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,28 @@ configure)
2525

2626
systemctl disable unattended-upgrades.service
2727

28+
#
29+
# We need to make sure that the motd-news.service is disabled. This
30+
# service reaches out to a public Ubuntu news service over the public
31+
# Internet to cache dynamic content that is then optionally printed by
32+
# /etc/update-motd.d/50-motd-news. There are at least three problems
33+
# with this:
34+
#
35+
# 1. We don't want engines in customer environments reaching out to
36+
# public services.
37+
# 2. We don't care about the dynamic content provided by Ubuntu.
38+
# 3. The service explicitly runs the /etc/update-motd.d/50-motd-news
39+
# script and fails if that script isn't executable, and we
40+
# turn off all executable bits on files in this directory except
41+
# those supplied by Delphix to suppress non-Delphix motd messages.
42+
#
43+
# As such, the service needs to be disable, which involves both the
44+
# service unit along with the timer unit that is tasked with running it
45+
# every 12 hours.
46+
#
47+
systemctl disable motd-news.service
48+
systemctl disable motd-news.timer
49+
2850
systemctl enable auditd.service
2951
systemctl enable delphix.target
3052
systemctl enable delphix-migration.service
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
version=$(get-appliance-version | awk -F'+' '{print $1}')
4+
printf "Welcome to Delphix %s\n" "$version"

files/common/var/lib/delphix-platform/ansible/10-delphix-platform/roles/delphix-platform/tasks/main.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
# would end up causing important messages from less verbose services to
179179
# be flushed and lost prematurely.
180180
#
181-
- shell: systemctl mask systemd-journald-audit.socket
181+
- command: systemctl mask systemd-journald-audit.socket
182182

183183
#
184184
# By default, the ulimit for core files is set to 0, and the default
@@ -478,3 +478,18 @@
478478
path: /etc/default/kdump-tools
479479
regexp: '^#?MAKEDUMP_ARGS='
480480
line: 'MAKEDUMP_ARGS="-c -d 31 --message-level 22 --private-page-filter 0x2F5ABDF11ECAC4E"'
481+
482+
#
483+
# Disable all motd scripts except for those provided by Delphix by removing
484+
# executable permissions on every script in /etc/update-motd.d except those
485+
# that have "-delphix" in their filename.
486+
#
487+
- find:
488+
paths: /etc/update-motd.d
489+
excludes: '*-delphix*'
490+
register: motd_files
491+
492+
- file:
493+
path: "{{ item.path }}"
494+
mode: 0644
495+
with_items: '{{ motd_files.files }}'

0 commit comments

Comments
 (0)