diff options
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | man/systemd.special.xml | 47 | ||||
-rw-r--r-- | rules/60-persistent-storage.rules | 1 | ||||
-rw-r--r-- | src/basic/virt.c | 6 | ||||
-rw-r--r-- | src/nss-myhostname/nss-myhostname.c | 8 | ||||
-rw-r--r-- | src/nss-mymachines/nss-mymachines.c | 18 | ||||
-rw-r--r-- | src/nss-systemd/nss-systemd.c | 8 |
7 files changed, 55 insertions, 37 deletions
diff --git a/Makefile.am b/Makefile.am index 8792369161..dd10aabd36 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1737,6 +1737,8 @@ TEST_DATA_FILES += \ test/test-execute/exec-restrict-namespaces-mnt.service \ test/test-execute/exec-restrict-namespaces-mnt-blacklist.service \ test/test-execute/exec-read-only-path-succeed.service \ + test/test-execute/exec-privatedevices-yes-capability-sys-rawio.service \ + test/test-execute/exec-privatedevices-no-capability-sys-rawio.service \ test/bus-policy/hello.conf \ test/bus-policy/methods.conf \ test/bus-policy/ownerships.conf \ @@ -2470,7 +2472,7 @@ test_journal_importer_SOURCES = \ test_journal_importer_LDADD = \ libsystemd-shared.la -EXTRA_DIST += \ +TEST_DATA_FILES += \ test/journal-data/journal-1.txt \ test/journal-data/journal-2.txt diff --git a/man/systemd.special.xml b/man/systemd.special.xml index c2672511e3..a81cc3579d 100644 --- a/man/systemd.special.xml +++ b/man/systemd.special.xml @@ -47,16 +47,14 @@ <refpurpose>Special systemd units</refpurpose> </refnamediv> - <refsynopsisdiv> - <para><filename>basic.target</filename>, + <refsynopsisdiv><para> + <!-- sort alphabetically, targets first --> + <filename>basic.target</filename>, <filename>bluetooth.target</filename>, - <filename>ctrl-alt-del.target</filename>, - <filename>cryptsetup.target</filename>, <filename>cryptsetup-pre.target</filename>, - <filename>dbus.service</filename>, - <filename>dbus.socket</filename>, + <filename>cryptsetup.target</filename>, + <filename>ctrl-alt-del.target</filename>, <filename>default.target</filename>, - <filename>display-manager.service</filename>, <filename>emergency.target</filename>, <filename>exit.target</filename>, <filename>final.target</filename>, @@ -66,25 +64,26 @@ <filename>hibernate.target</filename>, <filename>hybrid-sleep.target</filename>, <filename>initrd-fs.target</filename>, + <filename>initrd-root-device.target</filename>, + <filename>initrd-root-fs.target</filename>, <filename>kbrequest.target</filename>, <filename>kexec.target</filename>, - <filename>local-fs.target</filename>, <filename>local-fs-pre.target</filename>, + <filename>local-fs.target</filename>, + <filename>machines.target</filename> <filename>multi-user.target</filename>, - <filename>network.target</filename>, <filename>network-online.target</filename>, <filename>network-pre.target</filename>, + <filename>network.target</filename>, <filename>nss-lookup.target</filename>, <filename>nss-user-lookup.target</filename>, <filename>paths.target</filename>, <filename>poweroff.target</filename>, <filename>printer.target</filename>, <filename>reboot.target</filename>, - <filename>remote-fs.target</filename>, <filename>remote-fs-pre.target</filename>, + <filename>remote-fs.target</filename>, <filename>rescue.target</filename>, - <filename>initrd-root-device.target</filename>, - <filename>initrd-root-fs.target</filename>, <filename>rpcbind.target</filename>, <filename>runlevel2.target</filename>, <filename>runlevel3.target</filename>, @@ -102,21 +101,27 @@ <filename>sysinit.target</filename>, <filename>syslog.socket</filename>, <filename>system-update.target</filename>, - <filename>system-update-cleanup.service</filename>, <filename>time-sync.target</filename>, <filename>timers.target</filename>, <filename>umount.target</filename>, + <!-- slices --> <filename>-.slice</filename>, <filename>system.slice</filename>, <filename>user.slice</filename>, - <filename>machine.slice</filename></para> - </refsynopsisdiv> + <filename>machine.slice</filename>, + <!-- the rest --> + <filename>dbus.service</filename>, + <filename>dbus.socket</filename>, + <filename>display-manager.service</filename>, + <filename>system-update-cleanup.service</filename> + </para></refsynopsisdiv> <refsect1> <title>Description</title> - <para>A few units are treated specially by systemd. They have - special internal semantics and cannot be renamed.</para> + <para>A few units are treated specially by systemd. Many of them have + special internal semantics and cannot be renamed, while others simply + have a standard meaning and should be present on all systems.</para> </refsect1> <refsect1> @@ -349,6 +354,14 @@ </listitem> </varlistentry> <varlistentry> + <term><filename>machines.target</filename></term> + <listitem> + <para>A standard target unit for starting all the containers + and other virtual machines. See <filename>systemd-nspawn@.service</filename> + for an example.</para> + </listitem> + </varlistentry> + <varlistentry> <term><filename>multi-user.target</filename></term> <listitem> <para>A special target unit for setting up a multi-user diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules index 28e41ea968..4a33ad813f 100644 --- a/rules/60-persistent-storage.rules +++ b/rules/60-persistent-storage.rules @@ -20,6 +20,7 @@ KERNEL=="nvme*[0-9]n*[0-9]", ATTR{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{w KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}-part%n" KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{serial}=="?*", ENV{ID_SERIAL_SHORT}="$attr{serial}" +KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{wwid}=="?*", ENV{ID_WWN}="$attr{wwid}" KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{model}=="?*", ENV{ID_SERIAL_SHORT}=="?*", ENV{ID_SERIAL}="$attr{model}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}" KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{serial}=="?*", ENV{ID_SERIAL_SHORT}="$attr{serial}" diff --git a/src/basic/virt.c b/src/basic/virt.c index 830dc655e3..9d615da681 100644 --- a/src/basic/virt.c +++ b/src/basic/virt.c @@ -329,8 +329,10 @@ int detect_vm(void) { * -> Third try to detect from dmi. */ dmi = detect_vm_dmi(); - if (dmi == VIRTUALIZATION_ORACLE) - return dmi; + if (dmi == VIRTUALIZATION_ORACLE) { + r = dmi; + goto finish; + } r = detect_vm_cpuid(); if (r < 0) diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c index 326672cab5..0570fde592 100644 --- a/src/nss-myhostname/nss-myhostname.c +++ b/src/nss-myhostname/nss-myhostname.c @@ -114,8 +114,8 @@ enum nss_status _nss_myhostname_gethostbyname4_r( l = strlen(canonical); ms = ALIGN(l+1) + ALIGN(sizeof(struct gaih_addrtuple)) * (n_addresses > 0 ? n_addresses : 2); if (buflen < ms) { - *errnop = ENOMEM; - *h_errnop = NO_RECOVERY; + *errnop = ERANGE; + *h_errnop = NETDB_INTERNAL; return NSS_STATUS_TRYAGAIN; } @@ -220,8 +220,8 @@ static enum nss_status fill_in_hostent( (c > 0 ? c+1 : 2) * sizeof(char*); if (buflen < ms) { - *errnop = ENOMEM; - *h_errnop = NO_RECOVERY; + *errnop = ERANGE; + *h_errnop = NETDB_INTERNAL; return NSS_STATUS_TRYAGAIN; } diff --git a/src/nss-mymachines/nss-mymachines.c b/src/nss-mymachines/nss-mymachines.c index fac37faea5..ea90953abb 100644 --- a/src/nss-mymachines/nss-mymachines.c +++ b/src/nss-mymachines/nss-mymachines.c @@ -151,8 +151,8 @@ enum nss_status _nss_mymachines_gethostbyname4_r( l = strlen(name); ms = ALIGN(l+1) + ALIGN(sizeof(struct gaih_addrtuple)) * c; if (buflen < ms) { - *errnop = ENOMEM; - *h_errnop = TRY_AGAIN; + *errnop = ERANGE; + *h_errnop = NETDB_INTERNAL; return NSS_STATUS_TRYAGAIN; } @@ -306,8 +306,8 @@ enum nss_status _nss_mymachines_gethostbyname3_r( ms = ALIGN(l+1) + c * ALIGN(alen) + (c+2) * sizeof(char*); if (buflen < ms) { - *errnop = ENOMEM; - *h_errnop = NO_RECOVERY; + *errnop = ERANGE; + *h_errnop = NETDB_INTERNAL; return NSS_STATUS_TRYAGAIN; } @@ -471,7 +471,7 @@ enum nss_status _nss_mymachines_getpwnam_r( l = strlen(name); if (buflen < l+1) { - *errnop = ENOMEM; + *errnop = ERANGE; return NSS_STATUS_TRYAGAIN; } @@ -550,7 +550,7 @@ enum nss_status _nss_mymachines_getpwuid_r( goto not_found; if (snprintf(buffer, buflen, "vu-%s-" UID_FMT, machine, (uid_t) mapped) >= (int) buflen) { - *errnop = ENOMEM; + *errnop = ERANGE; return NSS_STATUS_TRYAGAIN; } @@ -645,7 +645,7 @@ enum nss_status _nss_mymachines_getgrnam_r( l = sizeof(char*) + strlen(name) + 1; if (buflen < l) { - *errnop = ENOMEM; + *errnop = ERANGE; return NSS_STATUS_TRYAGAIN; } @@ -722,13 +722,13 @@ enum nss_status _nss_mymachines_getgrgid_r( goto not_found; if (buflen < sizeof(char*) + 1) { - *errnop = ENOMEM; + *errnop = ERANGE; return NSS_STATUS_TRYAGAIN; } memzero(buffer, sizeof(char*)); if (snprintf(buffer + sizeof(char*), buflen - sizeof(char*), "vg-%s-" GID_FMT, machine, (gid_t) mapped) >= (int) buflen) { - *errnop = ENOMEM; + *errnop = ERANGE; return NSS_STATUS_TRYAGAIN; } diff --git a/src/nss-systemd/nss-systemd.c b/src/nss-systemd/nss-systemd.c index fd5064c937..f404755dac 100644 --- a/src/nss-systemd/nss-systemd.c +++ b/src/nss-systemd/nss-systemd.c @@ -185,7 +185,7 @@ enum nss_status _nss_systemd_getpwnam_r( l = strlen(name); if (buflen < l+1) { - *errnop = ENOMEM; + *errnop = ERANGE; return NSS_STATUS_TRYAGAIN; } @@ -286,7 +286,7 @@ enum nss_status _nss_systemd_getpwuid_r( l = strlen(translated) + 1; if (buflen < l) { - *errnop = ENOMEM; + *errnop = ERANGE; return NSS_STATUS_TRYAGAIN; } @@ -386,7 +386,7 @@ enum nss_status _nss_systemd_getgrnam_r( l = sizeof(char*) + strlen(name) + 1; if (buflen < l) { - *errnop = ENOMEM; + *errnop = ERANGE; return NSS_STATUS_TRYAGAIN; } @@ -484,7 +484,7 @@ enum nss_status _nss_systemd_getgrgid_r( l = sizeof(char*) + strlen(translated) + 1; if (buflen < l) { - *errnop = ENOMEM; + *errnop = ERANGE; return NSS_STATUS_TRYAGAIN; } |