From 7310129f4e7aa842c88c95a408ef8c3e5ff416fa Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Fri, 2 Jan 2015 14:50:05 +0100 Subject: [PATCH] Disable getty processes on jessie through logind config --- bootstrapvz/common/assets/systemd/logind.conf | 5 +++++ bootstrapvz/common/tasks/boot.py | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 bootstrapvz/common/assets/systemd/logind.conf diff --git a/bootstrapvz/common/assets/systemd/logind.conf b/bootstrapvz/common/assets/systemd/logind.conf new file mode 100644 index 0000000..b6c4d12 --- /dev/null +++ b/bootstrapvz/common/assets/systemd/logind.conf @@ -0,0 +1,5 @@ + +[Login] +# Disable all TTY getters +NAutoVTs=0 +ReserveVT=0 diff --git a/bootstrapvz/common/tasks/boot.py b/bootstrapvz/common/tasks/boot.py index 9f028c1..4cc121c 100644 --- a/bootstrapvz/common/tasks/boot.py +++ b/bootstrapvz/common/tasks/boot.py @@ -1,6 +1,7 @@ from bootstrapvz.base import Task from .. import phases import os.path +from . import assets class UpdateInitramfs(Task): @@ -45,6 +46,7 @@ class DisableGetTTYs(Task): i = str(i) sed_i(inittab_path, '^' + i + ttyx + i, '#' + i + ttyx + i) else: - tty_path = 'etc/systemd/system/getty.target.wants/getty@tty{num}.service' - for i in range(2, 7): - os.remove(os.path.join(info.root, tty_path.format(num=i))) + from shutil import copy + logind_asset_path = os.path.join(assets, 'systemd/logind.conf') + logind_destination = os.path.join(info.root, 'etc/systemd/logind.conf') + copy(logind_asset_path, logind_destination)