mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Disable getty processes on jessie through logind config
This commit is contained in:
parent
4be7e8966c
commit
7310129f4e
2 changed files with 10 additions and 3 deletions
5
bootstrapvz/common/assets/systemd/logind.conf
Normal file
5
bootstrapvz/common/assets/systemd/logind.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
|
||||
[Login]
|
||||
# Disable all TTY getters
|
||||
NAutoVTs=0
|
||||
ReserveVT=0
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue