mirror of
https://github.com/systemd/systemd
synced 2024-10-01 13:55:20 +00:00
importd: allow activation in early boot, and make it socket activatable
Previously, importd was only accessible via D-Bus, which required it to be a late boot service. Now that we have Varlink we can rearrange things to become early-boot activated, just after the image directories are mounted. This will later allow us to have generator that auto-downloads images on boot.
This commit is contained in:
parent
17a6043a14
commit
f596658811
|
@ -1743,7 +1743,7 @@ static int manager_connect_bus(Manager *m) {
|
||||||
assert(m->event);
|
assert(m->event);
|
||||||
assert(!m->bus);
|
assert(!m->bus);
|
||||||
|
|
||||||
r = sd_bus_default_system(&m->bus);
|
r = bus_open_system_watch_bind(&m->bus);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "Failed to get system bus connection: %m");
|
return log_error_errno(r, "Failed to get system bus connection: %m");
|
||||||
|
|
||||||
|
|
|
@ -361,6 +361,11 @@ units = [
|
||||||
'conditions' : ['ENABLE_IMPORTD'],
|
'conditions' : ['ENABLE_IMPORTD'],
|
||||||
'symlinks' : ['dbus-org.freedesktop.import1.service'],
|
'symlinks' : ['dbus-org.freedesktop.import1.service'],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'file' : 'systemd-importd.socket',
|
||||||
|
'conditions' : ['ENABLE_IMPORTD'],
|
||||||
|
'symlinks' : ['sockets.target.wants/'],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'file' : 'systemd-initctl.service.in',
|
'file' : 'systemd-initctl.service.in',
|
||||||
'conditions' : ['HAVE_SYSV_COMPAT'],
|
'conditions' : ['HAVE_SYSV_COMPAT'],
|
||||||
|
|
|
@ -8,9 +8,15 @@
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Virtual Machine and Container Download Service
|
Description=Disk Image Download Service
|
||||||
Documentation=man:systemd-importd.service(8)
|
Documentation=man:systemd-importd.service(8)
|
||||||
Documentation=man:org.freedesktop.import1(5)
|
Documentation=man:org.freedesktop.import1(5)
|
||||||
|
DefaultDependencies=no
|
||||||
|
After=systemd-importd.socket
|
||||||
|
WantsMountsFor=/var/lib/machines /var/lib/portables /var/lib/extensions /var/lib/confexts
|
||||||
|
After=systemd-remount-fs.service
|
||||||
|
Before=shutdown.target
|
||||||
|
Conflicts=shutdown.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=notify
|
Type=notify
|
||||||
|
|
24
units/systemd-importd.socket
Normal file
24
units/systemd-importd.socket
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
#
|
||||||
|
# This file is part of systemd.
|
||||||
|
#
|
||||||
|
# systemd is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU Lesser General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2.1 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Disk Image Download Service Socket
|
||||||
|
Documentation=man:systemd-importd.service(8)
|
||||||
|
Documentation=man:org.freedesktop.import1(5)
|
||||||
|
DefaultDependencies=no
|
||||||
|
WantsMountsFor=/var/lib/machines /var/lib/portables /var/lib/extensions /var/lib/confexts
|
||||||
|
After=systemd-remount-fs.service
|
||||||
|
Before=sockets.target
|
||||||
|
Conflicts=shutdown.target
|
||||||
|
Before=shutdown.target
|
||||||
|
|
||||||
|
[Socket]
|
||||||
|
ListenStream=/run/systemd/io.systemd.Import
|
||||||
|
FileDescriptorName=varlink
|
||||||
|
SocketMode=0666
|
Loading…
Reference in a new issue