1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
# -*- systemd -*-
#
# Copyright © 2019-2023 Teddy Hogeborn
# Copyright © 2019-2023 Björn Påhlsson
#
# This file is part of Mandos.
#
# Mandos is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mandos is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mandos. If not, see <http://www.gnu.org/licenses/>.
#
# Contact the authors at <mandos@recompile.se>.
#
# This systemd.service(5) unit file will start the Mandos
# password-agent(8mandos) program, which will in turn run
# mandos-client(8mandos) to get a password and send the password to
# any and all active password questions using the systemd “Password
# Agent” mechanism.
# This file should be installed in the root file system as
# "/usr/lib/dracut/modules.d/90mandos/ask-password-mandos.service" and
# will be installed in the initramfs image file as
# "/lib/systemd/system/ask-password-mandos.service" by dracut when
# dracut creates the initramfs image file.
[Unit]
Description=Forward Password Requests to remote Mandos server
Documentation=man:intro(8mandos) man:password-agent(8mandos) man:mandos-client(8mandos)
DefaultDependencies=no
Conflicts=shutdown.target
Before=shutdown.target
ConditionKernelCommandLine=!mandos=off
ConditionFileIsExecutable=/lib/mandos/password-agent
ConditionFileIsExecutable=/lib/mandos/mandos-client
ConditionFileNotEmpty=/etc/mandos/keys/pubkey.txt
ConditionFileNotEmpty=/etc/mandos/keys/seckey.txt
ConditionFileNotEmpty=/etc/mandos/keys/tls-pubkey.pem
ConditionFileNotEmpty=/etc/mandos/keys/tls-privkey.pem
ConditionPathIsMountPoint=!/sysroot
[Service]
ExecStart=/lib/mandos/password-agent $PASSWORD_AGENT_OPTIONS -- /lib/mandos/mandos-client --pubkey=/etc/mandos/keys/pubkey.txt --seckey=/etc/mandos/keys/seckey.txt --tls-pubkey=/etc/mandos/keys/tls-pubkey.pem --tls-privkey=/etc/mandos/keys/tls-privkey.pem $MANDOS_CLIENT_OPTIONS
#
# Please keep the above line intact, exactly as it is! To add extra
# options to mandos-client, instead create an override file (e.g. with
# the command "systemctl edit --force ask-password-mandos.service"),
# and, in that file, put something like the following:
#
# [Service]
# Environment=MANDOS_CLIENT_OPTIONS=--debug
#
# Rebuild the initramfs using this command:
#
# dpkg-reconfigure dracut
#
# Once the system has booted (possibly by typing in the password
# manually), you can see the log using this command:
#
# journalctl --unit=ask-password-mandos.service
#
# Lastly, to remove the override file with extra options, run:
#
# systemctl revert ask-password-mandos.service
#
# And rebuild the initramfs again, as above.
|