]> git.ipfire.org Git - thirdparty/systemd.git/blame - units/meson.build
units: use SuccessAction=poweroff-force in systemd-poweroff.service
[thirdparty/systemd.git] / units / meson.build
CommitLineData
3a726fcd 1# SPDX-License-Identifier: LGPL-2.1+
3a726fcd 2
5c23128d 3units = [
37efbbd8
ZJS
4 ['basic.target', ''],
5 ['bluetooth.target', ''],
6 ['cryptsetup-pre.target', 'HAVE_LIBCRYPTSETUP'],
7 ['cryptsetup.target', 'HAVE_LIBCRYPTSETUP',
8 'sysinit.target.wants/'],
9 ['dev-hugepages.mount', '',
10 'sysinit.target.wants/'],
11 ['dev-mqueue.mount', '',
12 'sysinit.target.wants/'],
13 ['emergency.target', ''],
14 ['exit.target', ''],
15 ['final.target', ''],
16 ['getty.target', '',
17 'multi-user.target.wants/'],
17590254 18 ['getty-pre.target', ''],
37efbbd8
ZJS
19 ['graphical.target', '',
20 'runlevel5.target default.target'],
21 ['halt.target', ''],
22 ['hibernate.target', 'ENABLE_HIBERNATE'],
23 ['hybrid-sleep.target', 'ENABLE_HIBERNATE'],
e68c79db 24 ['suspend-then-hibernate.target', 'ENABLE_HIBERNATE'],
37efbbd8
ZJS
25 ['initrd-fs.target', ''],
26 ['initrd-root-device.target', ''],
27 ['initrd-root-fs.target', ''],
28 ['initrd-switch-root.target', ''],
29 ['initrd.target', ''],
30 ['kexec.target', ''],
31 ['ldconfig.service', 'ENABLE_LDCONFIG',
32 'sysinit.target.wants/'],
33 ['local-fs-pre.target', ''],
34 ['local-fs.target', ''],
35 ['machine.slice', 'ENABLE_MACHINED'],
36 ['machines.target', 'ENABLE_MACHINED',
37 join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')],
38 ['multi-user.target', '',
39 'runlevel2.target runlevel3.target runlevel4.target'],
40 ['network-online.target', ''],
41 ['network-pre.target', ''],
42 ['network.target', ''],
43 ['nss-lookup.target', ''],
44 ['nss-user-lookup.target', ''],
45 ['paths.target', ''],
46 ['poweroff.target', '',
47 'runlevel0.target'],
48 ['printer.target', ''],
49 ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT',
50 'sysinit.target.wants/'],
51 ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'],
52 ['reboot.target', '',
53 'runlevel6.target ctrl-alt-del.target'],
889128b8
ZJS
54 ['remote-cryptsetup.target', 'HAVE_LIBCRYPTSETUP',
55 join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')],
37efbbd8
ZJS
56 ['remote-fs-pre.target', ''],
57 ['remote-fs.target', '',
58 join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')],
59 ['rescue.target', '',
60 'runlevel1.target'],
61 ['rpcbind.target', ''],
62 ['shutdown.target', ''],
63 ['sigpwr.target', ''],
64 ['sleep.target', ''],
65 ['slices.target', ''],
66 ['smartcard.target', ''],
67 ['sockets.target', ''],
68 ['sound.target', ''],
69 ['suspend.target', ''],
70 ['swap.target', ''],
71 ['sys-fs-fuse-connections.mount', '',
72 'sysinit.target.wants/'],
73 ['sys-kernel-config.mount', '',
74 'sysinit.target.wants/'],
75 ['sys-kernel-debug.mount', '',
76 'sysinit.target.wants/'],
77 ['sysinit.target', ''],
78 ['syslog.socket', ''],
79 ['system-update.target', ''],
520741d0 80 ['system-update-pre.target', ''],
edac2c47 81 ['system-update-cleanup.service', ''],
37efbbd8
ZJS
82 ['systemd-ask-password-console.path', '',
83 'sysinit.target.wants/'],
84 ['systemd-ask-password-wall.path', '',
85 'multi-user.target.wants/'],
86 ['systemd-coredump.socket', 'ENABLE_COREDUMP',
87 'sockets.target.wants/'],
88 ['systemd-initctl.socket', '',
89 'sockets.target.wants/'],
1c9f1314 90 ['systemd-journal-gatewayd.socket', 'ENABLE_REMOTE HAVE_MICROHTTPD'],
91 ['systemd-journal-remote.socket', 'ENABLE_REMOTE HAVE_MICROHTTPD'],
37efbbd8
ZJS
92 ['systemd-journald-audit.socket', '',
93 'sockets.target.wants/'],
94 ['systemd-journald-dev-log.socket', '',
95 'sockets.target.wants/'],
96 ['systemd-journald.socket', '',
97 'sockets.target.wants/'],
a174f618 98 ['systemd-networkd.socket', 'ENABLE_NETWORKD',
37efbbd8 99 join_paths(pkgsysconfdir, 'system/sockets.target.wants/')],
afa62065 100 ['systemd-poweroff.service', ''],
d85515ed 101 ['systemd-reboot.service', ''],
37efbbd8
ZJS
102 ['systemd-rfkill.socket', 'ENABLE_RFKILL'],
103 ['systemd-tmpfiles-clean.timer', '',
104 'timers.target.wants/'],
105 ['systemd-udevd-control.socket', '',
106 'sockets.target.wants/'],
107 ['systemd-udevd-kernel.socket', '',
108 'sockets.target.wants/'],
109 ['time-sync.target', ''],
110 ['timers.target', ''],
4429c69f
YW
111 ['tmp.mount', '',
112 'local-fs.target.wants/'],
37efbbd8
ZJS
113 ['umount.target', ''],
114 ['user.slice', ''],
78d1039d
FS
115 ['var-lib-machines.mount', 'ENABLE_MACHINED',
116 'remote-fs.target.wants/ machines.target.wants/'],
082ef2ad 117]
5c23128d
ZJS
118
119in_units = [
37efbbd8
ZJS
120 ['debug-shell.service', ''],
121 ['emergency.service', ''],
122 ['halt-local.service', 'HAVE_SYSV_COMPAT'],
123 ['initrd-cleanup.service', ''],
124 ['initrd-parse-etc.service', ''],
125 ['initrd-switch-root.service', ''],
126 ['initrd-udevadm-cleanup-db.service', ''],
127 ['kmod-static-nodes.service', 'HAVE_KMOD ENABLE_TMPFILES',
128 'sysinit.target.wants/'],
129 ['quotaon.service', 'ENABLE_QUOTACHECK'],
130 ['rc-local.service', 'HAVE_SYSV_COMPAT'],
131 ['rescue.service', ''],
37efbbd8
ZJS
132 ['systemd-ask-password-console.service', ''],
133 ['systemd-ask-password-wall.service', ''],
134 ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'],
135 ['systemd-binfmt.service', 'ENABLE_BINFMT',
136 'sysinit.target.wants/'],
137 ['systemd-coredump@.service', 'ENABLE_COREDUMP'],
138 ['systemd-exit.service', ''],
139 ['systemd-firstboot.service', 'ENABLE_FIRSTBOOT',
140 'sysinit.target.wants/'],
141 ['systemd-fsck-root.service', ''],
142 ['systemd-fsck@.service', ''],
143 ['systemd-halt.service', ''],
144 ['systemd-hibernate-resume@.service', 'ENABLE_HIBERNATE'],
145 ['systemd-hibernate.service', 'ENABLE_HIBERNATE'],
146 ['systemd-hybrid-sleep.service', 'ENABLE_HIBERNATE'],
e68c79db 147 ['systemd-suspend-then-hibernate.service', 'ENABLE_HIBERNATE'],
37efbbd8
ZJS
148 ['systemd-hostnamed.service', 'ENABLE_HOSTNAMED',
149 'dbus-org.freedesktop.hostname1.service'],
150 ['systemd-hwdb-update.service', 'ENABLE_HWDB',
151 'sysinit.target.wants/'],
152 ['systemd-importd.service', 'ENABLE_IMPORTD',
153 'dbus-org.freedesktop.import1.service'],
154 ['systemd-initctl.service', ''],
155 ['systemd-journal-catalog-update.service', '',
156 'sysinit.target.wants/'],
157 ['systemd-journal-flush.service', '',
158 'sysinit.target.wants/'],
159 ['systemd-journal-gatewayd.service', 'ENABLE_REMOTE HAVE_MICROHTTPD'],
160 ['systemd-journal-remote.service', 'ENABLE_REMOTE HAVE_MICROHTTPD'],
161 ['systemd-journal-upload.service', 'ENABLE_REMOTE HAVE_LIBCURL'],
162 ['systemd-journald.service', '',
163 'sysinit.target.wants/'],
164 ['systemd-kexec.service', ''],
165 ['systemd-localed.service', 'ENABLE_LOCALED',
166 'dbus-org.freedesktop.locale1.service'],
167 ['systemd-logind.service', 'ENABLE_LOGIND',
168 'multi-user.target.wants/ dbus-org.freedesktop.login1.service'],
169 ['systemd-machine-id-commit.service', '',
170 'sysinit.target.wants/'],
171 ['systemd-machined.service', 'ENABLE_MACHINED',
172 'dbus-org.freedesktop.machine1.service'],
173 ['systemd-modules-load.service', 'HAVE_KMOD',
174 'sysinit.target.wants/'],
4429c69f
YW
175 ['systemd-networkd.service', 'ENABLE_NETWORKD',
176 join_paths(pkgsysconfdir, 'system/dbus-org.freedesktop.network1.service') + ' ' +
177 join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')],
37efbbd8
ZJS
178 ['systemd-networkd-wait-online.service', 'ENABLE_NETWORKD',
179 join_paths(pkgsysconfdir, 'system/network-online.target.wants/')],
180 ['systemd-nspawn@.service', ''],
61d0578b
LP
181 ['systemd-portabled.service', 'ENABLE_PORTABLED',
182 'dbus-org.freedesktop.portable1.service'],
37efbbd8
ZJS
183 ['systemd-quotacheck.service', 'ENABLE_QUOTACHECK'],
184 ['systemd-random-seed.service', 'ENABLE_RANDOMSEED',
185 'sysinit.target.wants/'],
37efbbd8
ZJS
186 ['systemd-remount-fs.service', '',
187 'local-fs.target.wants/'],
1ec57f33 188 ['systemd-resolved.service', 'ENABLE_RESOLVE',
4429c69f
YW
189 join_paths(pkgsysconfdir, 'system/dbus-org.freedesktop.resolve1.service') + ' ' +
190 join_paths(pkgsysconfdir, 'system/multi-user.target.wants/')],
37efbbd8
ZJS
191 ['systemd-rfkill.service', 'ENABLE_RFKILL'],
192 ['systemd-suspend.service', ''],
193 ['systemd-sysctl.service', '',
194 'sysinit.target.wants/'],
195 ['systemd-sysusers.service', 'ENABLE_SYSUSERS',
196 'sysinit.target.wants/'],
197 ['systemd-timedated.service', 'ENABLE_TIMEDATED',
198 'dbus-org.freedesktop.timedate1.service'],
199 ['systemd-timesyncd.service', 'ENABLE_TIMESYNCD',
200 join_paths(pkgsysconfdir, 'system/sysinit.target.wants/')],
006ffa64 201 ['systemd-time-wait-sync.service', 'ENABLE_TIMESYNCD'],
37efbbd8
ZJS
202 ['systemd-tmpfiles-clean.service', 'ENABLE_TMPFILES'],
203 ['systemd-tmpfiles-setup-dev.service', 'ENABLE_TMPFILES',
204 'sysinit.target.wants/'],
205 ['systemd-tmpfiles-setup.service', 'ENABLE_TMPFILES',
206 'sysinit.target.wants/'],
207 ['systemd-udev-settle.service', ''],
208 ['systemd-udev-trigger.service', '',
209 'sysinit.target.wants/'],
210 ['systemd-udevd.service', '',
211 'sysinit.target.wants/'],
212 ['systemd-update-done.service', '',
213 'sysinit.target.wants/'],
3211da4b 214 ['systemd-update-utmp-runlevel.service', 'ENABLE_UTMP HAVE_SYSV_COMPAT',
37efbbd8 215 'multi-user.target.wants/ graphical.target.wants/ rescue.target.wants/'],
3211da4b 216 ['systemd-update-utmp.service', 'ENABLE_UTMP',
37efbbd8 217 'sysinit.target.wants/'],
3bd46954 218 ['systemd-user-sessions.service', 'HAVE_PAM',
37efbbd8
ZJS
219 'multi-user.target.wants/'],
220 ['systemd-vconsole-setup.service', 'ENABLE_VCONSOLE'],
221 ['systemd-volatile-root.service', ''],
a9f0f5e5 222 ['user-runtime-dir@.service', ''],
4429c69f 223 ['user@.service', ''],
082ef2ad
ZJS
224]
225
226m4_units = [
edac2c47
YW
227 ['console-getty.service', ''],
228 ['container-getty@.service', ''],
37efbbd8
ZJS
229 ['getty@.service', '',
230 'autovt@.service ' +
231 join_paths(pkgsysconfdir, 'system/getty.target.wants/getty@tty1.service')],
232 ['serial-getty@.service', ''],
082ef2ad
ZJS
233]
234
2d9f0c68 235foreach tuple : in_units
37efbbd8 236 file = tuple[0]
082ef2ad 237
37efbbd8
ZJS
238 # we do this here because install_data does not accept custom_target output
239 conds = tuple[1].split(' ')
349cc4a5
ZJS
240 install = ((conds.get(0, '') == '' or conf.get(conds[0]) == 1) and
241 (conds.get(1, '') == '' or conf.get(conds[1]) == 1))
5c23128d 242
37efbbd8
ZJS
243 gen1 = configure_file(
244 input : file + '.in',
245 output : file + '.tmp',
246 configuration : substs)
247 gen2 = custom_target(
248 file,
249 input : gen1,
250 output : file,
251 command : [sed, '/^## /d', '@INPUT@'],
252 capture : true,
253 install : install,
254 install_dir : systemunitdir)
2d9f0c68 255
37efbbd8
ZJS
256 if install and tuple.length() > 2
257 foreach target : tuple[2].split()
258 meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file)
259 endforeach
260 endif
5c23128d
ZJS
261endforeach
262
2d9f0c68 263foreach tuple : m4_units
37efbbd8
ZJS
264 file = tuple[0]
265 input = tuple.get(3, file + '.m4')
082ef2ad 266
37efbbd8
ZJS
267 # we do this here because install_data does not accept custom_target output
268 conds = tuple[1].split(' ')
349cc4a5
ZJS
269 install = ((conds.get(0, '') == '' or conf.get(conds[0]) == 1) and
270 (conds.get(1, '') == '' or conf.get(conds[1]) == 1))
5c23128d 271
37efbbd8
ZJS
272 custom_target(
273 file,
274 input : input,
275 output: file,
348b4437 276 command : [meson_apply_m4, config_h, '@INPUT@'],
37efbbd8
ZJS
277 capture : true,
278 install : install,
279 install_dir : systemunitdir)
2d9f0c68 280
37efbbd8
ZJS
281 if tuple.length() > 2 and install
282 foreach target : tuple[2].split()
283 meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file)
284 endforeach
285 endif
5c23128d
ZJS
286endforeach
287
082ef2ad 288foreach tuple : units
37efbbd8
ZJS
289 file = tuple[0]
290 input = tuple.get(3, file)
5c23128d 291
37efbbd8 292 conds = tuple[1].split(' ')
349cc4a5
ZJS
293 install = ((conds.get(0, '') == '' or conf.get(conds[0]) == 1) and
294 (conds.get(1, '') == '' or conf.get(conds[1]) == 1))
5c23128d 295
37efbbd8
ZJS
296 if install
297 install_data(input,
298 install_dir : systemunitdir)
2d9f0c68 299
37efbbd8
ZJS
300 if tuple.length() > 2
301 foreach target : tuple[2].split()
302 meson.add_install_script(
303 'meson-add-wants.sh', systemunitdir, target, file)
304 endforeach
305 endif
306 endif
5c23128d
ZJS
307endforeach
308
28414939
ZJS
309install_data('user-.slice.d/10-defaults.conf',
310 install_dir : systemunitdir + '/user-.slice.d')
311
082ef2ad
ZJS
312############################################################
313
7b76fce1 314meson.add_install_script(meson_make_symlink,
e17e5ba9
MB
315 join_paths(pkgsysconfdir, 'user'),
316 join_paths(sysconfdir, 'xdg/systemd/user'))
7b76fce1 317meson.add_install_script(meson_make_symlink,
e17e5ba9
MB
318 join_paths(dbussystemservicedir, 'org.freedesktop.systemd1.service'),
319 join_paths(dbussessionservicedir, 'org.freedesktop.systemd1.service'))
349cc4a5 320if conf.get('HAVE_SYSV_COMPAT') == 1
37efbbd8
ZJS
321 foreach i : [1, 2, 3, 4, 5]
322 meson.add_install_script(
323 'sh', '-c',
324 mkdir_p
325 .format(join_paths(systemunitdir, 'runlevel@0@.target.wants'.format(i))))
326 endforeach
94e75a54
ZJS
327endif
328
5c23128d 329subdir('user')