]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #7127 from keszybz/sundry-tweaks
authorLennart Poettering <lennart@poettering.net>
Thu, 26 Oct 2017 08:57:00 +0000 (10:57 +0200)
committerGitHub <noreply@github.com>
Thu, 26 Oct 2017 08:57:00 +0000 (10:57 +0200)
Various unrelated small patches

man/systemd-nspawn.xml
meson.build
src/basic/util.c
src/login/logind-user.c
src/rfkill/rfkill.c

index 3951e32e8f5e7074cdd7327733a2556c0a7f9f56..b741a1fff921139e25c9a115e763e4e20d4a5ba7 100644 (file)
     <example>
       <title>Build and boot a minimal Fedora distribution in a container</title>
 
-      <programlisting># dnf -y --releasever=25 --installroot=/srv/mycontainer \
+      <programlisting># dnf -y --releasever=27 --installroot=/var/lib/machines/f27container \
       --disablerepo='*' --enablerepo=fedora --enablerepo=updates install \
       systemd passwd dnf fedora-release vim-minimal
-# systemd-nspawn -bD /srv/mycontainer</programlisting>
+# systemd-nspawn -bD /var/lib/machines/f27container</programlisting>
 
       <para>This installs a minimal Fedora distribution into the
-      directory <filename noindex='true'>/srv/mycontainer/</filename>
-      and then boots an OS in a namespace container in it.</para>
+      directory <filename noindex='true'>/var/lib/machines/f27container</filename>
+      and then boots an OS in a namespace container in it. Because the installation
+      is located underneath the standard <filename>/var/lib/machines/</filename>
+      directory, it is also possible to start the machine using
+      <command>systemd-nspawn -M f27container</command>.</para>
     </example>
 
     <example>
index e394ee5eee5466edd68b90a55a307a5b15841416..34eed35190350203b5c421d14651aea49c980c39 100644 (file)
@@ -462,7 +462,6 @@ endif
 #####################################################################
 
 sed = find_program('sed')
-grep = find_program('grep')
 awk = find_program('awk')
 m4 = find_program('m4')
 stat = find_program('stat')
index 687de40993052ddab3f64252fe66b98240a39cee..37fbfbf97fd9a39ce681f2795def32bc4a4c5bf9 100644 (file)
@@ -177,15 +177,12 @@ int block_get_whole_disk(dev_t d, dev_t *ret) {
 }
 
 bool kexec_loaded(void) {
-       bool loaded = false;
-       char *s;
-
-       if (read_one_line_file("/sys/kernel/kexec_loaded", &s) >= 0) {
-               if (s[0] == '1')
-                       loaded = true;
-               free(s);
-       }
-       return loaded;
+       _cleanup_free_ char *s = NULL;
+
+       if (read_one_line_file("/sys/kernel/kexec_loaded", &s) < 0)
+               return false;
+
+       return s[0] == '1';
 }
 
 int prot_from_flags(int flags) {
index dcf367e22d1e4d21219617f536115b8d8aec37e5..a90db3b33c9da571cf1690f1275fc441271339e6 100644 (file)
@@ -425,12 +425,11 @@ static int user_start_service(User *u) {
                         u->service,
                         &error,
                         &job);
-        if (r < 0) {
+        if (r < 0)
                 /* we don't fail due to this, let's try to continue */
                 log_error_errno(r, "Failed to start user service, ignoring: %s", bus_error_message(&error, r));
-        } else {
+        else
                 u->service_job = job;
-        }
 
         return 0;
 }
index 3aa468f40baea3d6c69b044a913f5f4cc8950758..c14b5ea3eea9d66085ed82a38310df2a46412266 100644 (file)
@@ -88,7 +88,8 @@ static int find_device(
 
         device = udev_device_new_from_subsystem_sysname(udev, "rfkill", sysname);
         if (!device)
-                return log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, errno, "Failed to open device: %m");
+                return log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, errno,
+                                      "Failed to open device %s: %m", sysname);
 
         name = udev_device_get_sysattr_value(device, "name");
         if (!name) {
@@ -146,7 +147,8 @@ static int wait_for_initialized(
         /* Check again, maybe things changed */
         d = udev_device_new_from_subsystem_sysname(udev, "rfkill", sysname);
         if (!d)
-                return log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, errno, "Failed to open device: %m");
+                return log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, errno,
+                                      "Failed to open device %s: %m", sysname);
 
         if (udev_device_get_is_initialized(d) != 0) {
                 *ret = d;