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 bootstrapvz.base import Task
|
||||||
from .. import phases
|
from .. import phases
|
||||||
import os.path
|
import os.path
|
||||||
|
from . import assets
|
||||||
|
|
||||||
|
|
||||||
class UpdateInitramfs(Task):
|
class UpdateInitramfs(Task):
|
||||||
|
@ -45,6 +46,7 @@ class DisableGetTTYs(Task):
|
||||||
i = str(i)
|
i = str(i)
|
||||||
sed_i(inittab_path, '^' + i + ttyx + i, '#' + i + ttyx + i)
|
sed_i(inittab_path, '^' + i + ttyx + i, '#' + i + ttyx + i)
|
||||||
else:
|
else:
|
||||||
tty_path = 'etc/systemd/system/getty.target.wants/getty@tty{num}.service'
|
from shutil import copy
|
||||||
for i in range(2, 7):
|
logind_asset_path = os.path.join(assets, 'systemd/logind.conf')
|
||||||
os.remove(os.path.join(info.root, tty_path.format(num=i)))
|
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