Disable getty processes on jessie through logind config

This commit is contained in:
Anders Ingemann 2015-01-02 14:50:05 +01:00
parent 4be7e8966c
commit 7310129f4e
2 changed files with 10 additions and 3 deletions

View file

@ -0,0 +1,5 @@
[Login]
# Disable all TTY getters
NAutoVTs=0
ReserveVT=0

View file

@ -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)