Compare commits

..

29 Commits

Author SHA1 Message Date
HATAYAMA Daisuke d1559793df core, job: fix breakage of ordering dependencies by systemctl reload command
Currently, systemctl reload command breaks ordering dependencies if it's
executed when its target service unit is in activating state.

For example, prepare A.service, B.service and C.target as follows:

    # systemctl cat A.service B.service C.target
    # /etc/systemd/system/A.service
    [Unit]
    Description=A

    [Service]
    Type=oneshot
    ExecStart=/usr/bin/echo A1
    ExecStart=/usr/bin/sleep 60
    ExecStart=/usr/bin/echo A2
    ExecReload=/usr/bin/echo A reloaded
    RemainAfterExit=yes

    # /etc/systemd/system/B.service
    [Unit]
    Description=B
    After=A.service

    [Service]
    Type=oneshot
    ExecStart=/usr/bin/echo B
    RemainAfterExit=yes

    # /etc/systemd/system/C.target
    [Unit]
    Description=C
    Wants=A.service B.service

Start them.

    # systemctl daemon-reload
    # systemctl start C.target

Then, we have:

    # LANG=C journalctl --no-pager -u A.service -u B.service -u C.target -b
    -- Logs begin at Mon 2019-09-09 00:25:06 EDT, end at Thu 2019-10-24 22:28:47 EDT. --
    Oct 24 22:27:47 localhost.localdomain systemd[1]: Starting A...
    Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Child 967 belongs to A.service.
    Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Main process exited, code=exited, status=0/SUCCESS
    Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Running next main command for state start.
    Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Passing 0 fds to service
    Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: About to execute: /usr/bin/sleep 60
    Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Forked /usr/bin/sleep as 968
    Oct 24 22:27:47 localhost.localdomain systemd[968]: A.service: Executing: /usr/bin/sleep 60
    Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Trying to enqueue job A.service/reload/replace
    Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Merged into running job, re-running: A.service/reload as 1288
    Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Enqueued job A.service/reload as 1288
    Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Unit cannot be reloaded because it is inactive.
    Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Job 1288 A.service/reload finished, result=invalid
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Passing 0 fds to service
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: About to execute: /usr/bin/echo B
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Forked /usr/bin/echo as 970
    Oct 24 22:27:52 localhost.localdomain systemd[970]: B.service: Executing: /usr/bin/echo B
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Failed to send unit change signal for B.service: Connection reset by peer
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Changed dead -> start
    Oct 24 22:27:52 localhost.localdomain systemd[1]: Starting B...
    Oct 24 22:27:52 localhost.localdomain echo[970]: B
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Child 970 belongs to B.service.
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Main process exited, code=exited, status=0/SUCCESS
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Changed start -> exited
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Job 1371 B.service/start finished, result=done
    Oct 24 22:27:52 localhost.localdomain systemd[1]: Started B.
    Oct 24 22:27:52 localhost.localdomain systemd[1]: C.target: Job 1287 C.target/start finished, result=done
    Oct 24 22:27:52 localhost.localdomain systemd[1]: Reached target C.
    Oct 24 22:27:52 localhost.localdomain systemd[1]: C.target: Failed to send unit change signal for C.target: Connection reset by peer
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Child 968 belongs to A.service.
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Main process exited, code=exited, status=0/SUCCESS
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Running next main command for state start.
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Passing 0 fds to service
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: About to execute: /usr/bin/echo A2
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Forked /usr/bin/echo as 972
    Oct 24 22:28:47 localhost.localdomain systemd[972]: A.service: Executing: /usr/bin/echo A2
    Oct 24 22:28:47 localhost.localdomain echo[972]: A2
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Child 972 belongs to A.service.
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Main process exited, code=exited, status=0/SUCCESS
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Changed start -> exited

The issue occurs not only in reload command, i.e.:

  - reload
  - try-restart
  - reload-or-restart
  - reload-or-try-restart commands

The cause of this issue is that job_type_collapse() doesn't take care of the
activating state.

Fixes: #10464
2019-11-04 16:45:23 +01:00
Jan Kundrát c488660e6e journalctl: allow running vacuum on remote journals, too
Right now the `systemd-journal-remote` service does not constrain its
resource usage (I just run out of space on my 100GB partition, for
example). This patch does not change that, but it at least makes it
possible to run something like:

  journalctl --directory /var/log/journal/remote --rotate --vacuum-size=90G

fixes #2376

Co-authored-by: Mike Auty <ikelos@gentoo.org>
2019-11-04 14:52:27 +01:00
Zbigniew Jędrzejewski-Szmek a859abf062
Merge pull request #13906 from yuwata/drop-missing-take2
tree-wide: drop xxx.h when xxx-util.h is included
2019-11-04 13:41:37 +01:00
Jan Janssen f9f1d01cbd sd-boot: Skip adding boot entries when the loader does not exist 2019-11-04 13:39:20 +01:00
Jérémy Rosen b5395600a0 allow an empty DefaultInstance= in configuration files
It is currently possible to override the DefaultInstance via drop-ins but
not remove it completely. Allow to do that by specifying an empty
DefaultInstance=
2019-11-04 13:33:08 +01:00
Jan Synacek ce6304f78e man/systemd.net-naming-scheme: fix typo 2019-11-04 13:32:07 +01:00
Yu Watanabe 146ca45902 util: drop unnecessary headers from util.c 2019-11-04 00:40:37 +09:00
Yu Watanabe 8e1e87a5de tree-wide: drop double newline 2019-11-04 00:30:32 +09:00
Yu Watanabe 8cb28504a5 tree-wide: drop input.h when missing_input.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe 1405cb653a tree-wide: drop stdio.h when stdio-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe 021cdf8330 tree-wide: drop signal.h when signal-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe d8704e6914 tree-wide: drop mman.h when missing_mman.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe 0fb81b8abe tree-wide: drop magic.h when missing_magic.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe e30e8b5073 tree-wide: drop stat.h or statfs.h when stat-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe 92133d2878 tree-wide: drop socket.h when socket-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe af760d85c3 tree-wide: drop mntent.h when fstab-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe c415489932 tree-wide: drop libkmod.h when module-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe adb29d588e tree-wide: drop blkid.h when blkid-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe e259108494 tree-wide: drop acl.h when acl-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe 927d2351d7 tree-wide: drop pwd.h and grp.h when user-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe f21e58b47d tree-wide: drop time.h when time-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe dc54946cea tree-wide: drop capability.h when capability-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe df26692947 tree-wide: drop sched.h when missing_sched.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe a4dca9836b tree-wide: drop gcrypt.h when gcrypt-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe a969d60645 tree-wide: drop locale.h when locale-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe 99e0d09731 tree-wide: drop glob.h when glob-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe 996f7e1cd0 tree-wide: drop dirent.h when dirent-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe 1c1da38afc tree-wide: drop alloca.h when alloc-util.h is included 2019-11-04 00:30:32 +09:00
Yu Watanabe 455fa9610c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
246 changed files with 21 additions and 402 deletions

View File

@ -42,7 +42,7 @@
<citerefentry><refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
Available naming schemes are described below.</para>
<para>After the udev proprties have been generated, appropriate udev rules may be used to actually rename
<para>After the udev properties have been generated, appropriate udev rules may be used to actually rename
devices based on those properties. See the description of <varname>NamePolicy=</varname> and
<varname>MACAddressPolicy=</varname> in
<citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>

View File

@ -3,7 +3,6 @@
#include <getopt.h>
#include <sys/epoll.h>
#include <sys/prctl.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <unistd.h>

View File

@ -5,7 +5,6 @@
#include <getopt.h>
#include <inttypes.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

View File

@ -1,7 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <sys/stat.h>
#include <sys/statfs.h>
#include <unistd.h>
#include "alloc-util.h"

View File

@ -10,10 +10,7 @@
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/sysmacros.h>
#include <unistd.h>

View File

@ -3,7 +3,6 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "string-util.h"

View File

@ -1,10 +1,8 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <errno.h>
#include <grp.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/capability.h>
#include <sys/prctl.h>
#include <unistd.h>

View File

@ -1,15 +1,11 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <dirent.h>
#include <errno.h>
#include <ftw.h>
#include <limits.h>
#include <signal.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <sys/xattr.h>

View File

@ -1,11 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <dirent.h>
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "conf-files.h"
#include "def.h"

View File

@ -1,16 +1,12 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/sendfile.h>
#include <sys/stat.h>
#include <sys/xattr.h>
#include <time.h>
#include <unistd.h>
#include "alloc-util.h"

View File

@ -4,9 +4,7 @@
#include <fcntl.h>
#include <limits.h>
#include <linux/fs.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>

View File

@ -4,7 +4,6 @@
#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "alloc-util.h"

View File

@ -6,7 +6,6 @@
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include "alloc-util.h"

View File

@ -3,7 +3,6 @@
#include <errno.h>
#include <fcntl.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <unistd.h>

View File

@ -8,7 +8,6 @@
#include <stdint.h>
#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

View File

@ -1,7 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <stdio.h>
#include "format-util.h"
#include "memory-util.h"
#include "stdio-util.h"

View File

@ -2,13 +2,9 @@
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <linux/falloc.h>
#include <linux/magic.h>
#include <time.h>
#include <unistd.h>
#include "alloc-util.h"

View File

@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#if HAVE_GCRYPT
#include <gcrypt.h>
#include "gcrypt-util.h"
#include "hexdecoct.h"

View File

@ -1,8 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <dirent.h>
#include <errno.h>
#include <glob.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

View File

@ -3,7 +3,6 @@
#include <glob.h>
#include <stdbool.h>
#include <string.h>
#include "macro.h"
#include "string-util.h"

View File

@ -3,7 +3,6 @@
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "alloc-util.h"
#include "fileio.h"

View File

@ -3,7 +3,6 @@
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <sys/utsname.h>
#include <unistd.h>

View File

@ -4,7 +4,6 @@
#include <limits.h>
#include <poll.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include "io-util.h"

View File

@ -1,16 +1,13 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <ftw.h>
#include <langinfo.h>
#include <libintl.h>
#include <locale.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>

View File

@ -6,14 +6,10 @@
#include <limits.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <sys/signalfd.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/uio.h>
#include <sys/un.h>
#include <time.h>
#include <unistd.h>
#include "sd-messages.h"

View File

@ -1,7 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <string.h>
#include "login-util.h"
#include "string-util.h"

View File

@ -3,7 +3,6 @@
#include <errno.h>
#include <stdbool.h>
#include <string.h>
#include <sys/stat.h>
#include "alloc-util.h"
#include "format-util.h"

View File

@ -3,11 +3,9 @@
#include <errno.h>
#include <inttypes.h>
#include <linux/oom.h>
#include <locale.h>
#include <net/if.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include "alloc-util.h"

View File

@ -4,8 +4,6 @@
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
/* When we include libgen.h because we need dirname() we immediately

View File

@ -2,7 +2,6 @@
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#include "alloc-util.h"
#include "efivars.h"

View File

@ -4,11 +4,9 @@
#include <errno.h>
#include <limits.h>
#include <linux/oom.h>
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/personality.h>

View File

@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include <alloca.h>
#include <errno.h>
#include <sched.h>
#include <signal.h>

View File

@ -3,7 +3,6 @@
#include <errno.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "alloc-util.h"
#include "macro.h"

View File

@ -4,8 +4,6 @@
#include <fcntl.h>
#include <stdbool.h>
#include <stddef.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <unistd.h>
#include "alloc-util.h"

View File

@ -2,7 +2,6 @@
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include "macro.h"
#include "parse-util.h"

View File

@ -7,7 +7,6 @@
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/xattr.h>
#include <unistd.h>

View File

@ -5,7 +5,6 @@
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>

View File

@ -11,7 +11,6 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <unistd.h>

View File

@ -1,11 +1,8 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/magic.h>
#include <sched.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <sys/types.h>
#include <unistd.h>

View File

@ -5,7 +5,6 @@
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include "macro.h"

View File

@ -5,7 +5,6 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "alloc-util.h"
#include "escape.h"

View File

@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include <alloca.h>
#include <stdbool.h>
#include <stddef.h>
#include <string.h>

View File

@ -5,7 +5,6 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "alloc-util.h"
#include "escape.h"

View File

@ -1,6 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <string.h>
#include <syslog.h>
#include "hexdecoct.h"

View File

@ -11,10 +11,8 @@
#include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/inotify.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sysmacros.h>
#include <sys/time.h>
#include <sys/types.h>

View File

@ -4,9 +4,7 @@
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/timerfd.h>
#include <sys/timex.h>

View File

@ -1,6 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <stdio.h>
#include <sys/mman.h>
#include "alloc-util.h"

View File

@ -4,7 +4,6 @@
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "alloc-util.h"
#include "glob-util.h"

View File

@ -1,15 +1,11 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <alloca.h>
#include <errno.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <utmp.h>

View File

@ -26,7 +26,6 @@
#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "alloc-util.h"
#include "gunicode.h"

View File

@ -1,48 +1,22 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <alloca.h>
#include <errno.h>
#include <fcntl.h>
#include <sched.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/prctl.h>
#include <sys/statfs.h>
#include <sys/sysmacros.h>
#include <sys/types.h>
#include <unistd.h>
#include "alloc-util.h"
#include "btrfs-util.h"
#include "build.h"
#include "def.h"
#include "device-nodes.h"
#include "dirent-util.h"
#include "env-file.h"
#include "env-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "format-util.h"
#include "hashmap.h"
#include "hostname-util.h"
#include "log.h"
#include "macro.h"
#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "procfs-util.h"
#include "set.h"
#include "signal-util.h"
#include "stat-util.h"
#include "string-util.h"
#include "strv.h"
#include "time-util.h"
#include "umask-util.h"
#include "user-util.h"
#include "util.h"
#include "virt.h"

View File

@ -6,7 +6,6 @@
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "alloc-util.h"

View File

@ -4,7 +4,6 @@
#include <fcntl.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <sys/xattr.h>

View File

@ -6,7 +6,6 @@
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>

View File

@ -1,20 +1,14 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <blkid.h>
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <ftw.h>
#include <getopt.h>
#include <limits.h>
#include <linux/magic.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <unistd.h>
#include "sd-id128.h"

View File

@ -1300,6 +1300,7 @@ static VOID config_entry_bump_counters(
static VOID config_entry_add_from_file(
Config *config,
EFI_HANDLE *device,
EFI_FILE *root_dir,
CHAR16 *path,
CHAR16 *file,
CHAR8 *content,
@ -1310,6 +1311,8 @@ static VOID config_entry_add_from_file(
UINTN pos = 0;
CHAR8 *key, *value;
UINTN len;
EFI_STATUS err;
EFI_FILE_HANDLE handle;
_cleanup_freepool_ CHAR16 *initrd = NULL;
entry = AllocatePool(sizeof(ConfigEntry));
@ -1406,6 +1409,14 @@ static VOID config_entry_add_from_file(
return;
}
/* check existence */
err = uefi_call_wrapper(root_dir->Open, 5, root_dir, &handle, entry->loader, EFI_FILE_MODE_READ, 0ULL);
if (EFI_ERROR(err)) {
config_entry_free(entry);
return;
}
uefi_call_wrapper(handle->Close, 1, handle);
/* add initrd= to options */
if (entry->type == LOADER_LINUX && initrd) {
if (entry->options) {
@ -1503,7 +1514,7 @@ static VOID config_load_entries(
err = file_read(entries_dir, f->FileName, 0, 0, &content, NULL);
if (!EFI_ERROR(err))
config_entry_add_from_file(config, device, L"\\loader\\entries", f->FileName, content, loaded_image_path);
config_entry_add_from_file(config, device, root_dir, L"\\loader\\entries", f->FileName, content, loaded_image_path);
}
uefi_call_wrapper(entries_dir->Close, 1, entries_dir);
}

View File

@ -342,8 +342,6 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
if (r < 0)
return log_error_errno(r, "Failed to show table: %m");
return 0;
}

View File

@ -3,7 +3,6 @@
#include <errno.h>
#include <getopt.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "sd-bus.h"

View File

@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <stdlib.h>
#include <sys/socket.h>
#include "fd-util.h"
#include "log.h"

View File

@ -1,12 +1,10 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <alloca.h>
#include <errno.h>
#include <getopt.h>
#include <signal.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "sd-bus.h"

View File

@ -12,7 +12,6 @@
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "alloc-util.h"

View File

@ -1,7 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <grp.h>
#include <pwd.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/types.h>

View File

@ -2,20 +2,13 @@
#include <errno.h>
#include <fcntl.h>
#include <glob.h>
#include <grp.h>
#include <poll.h>
#include <signal.h>
#include <string.h>
#include <sys/capability.h>
#include <sys/eventfd.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/personality.h>
#include <sys/prctl.h>
#include <sys/shm.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>

View File

@ -418,21 +418,21 @@ JobType job_type_collapse(JobType t, Unit *u) {
case JOB_TRY_RESTART:
s = unit_active_state(u);
if (UNIT_IS_INACTIVE_OR_DEACTIVATING(s))
if (!UNIT_IS_ACTIVE_OR_RELOADING(s))
return JOB_NOP;
return JOB_RESTART;
case JOB_TRY_RELOAD:
s = unit_active_state(u);
if (UNIT_IS_INACTIVE_OR_DEACTIVATING(s))
if (!UNIT_IS_ACTIVE_OR_RELOADING(s))
return JOB_NOP;
return JOB_RELOAD;
case JOB_RELOAD_OR_START:
s = unit_active_state(u);
if (UNIT_IS_INACTIVE_OR_DEACTIVATING(s))
if (!UNIT_IS_ACTIVE_OR_RELOADING(s))
return JOB_START;
return JOB_RELOAD;

View File

@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <ftw.h>
#include <string.h>
#include <unistd.h>
#include "alloc-util.h"
@ -13,7 +12,6 @@
#include "string-util.h"
#if HAVE_KMOD
#include <libkmod.h>
#include "module-util.h"
static void systemd_kmod_log(

View File

@ -11,9 +11,7 @@
#include <seccomp.h>
#endif
#include <sched.h>
#include <string.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include "af-list.h"
#include "alloc-util.h"

View File

@ -2,7 +2,6 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "env-file.h"
#include "env-util.h"

View File

@ -3,13 +3,9 @@
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/reboot.h>
#include <sys/stat.h>
#include <unistd.h>
#if HAVE_SECCOMP
#include <seccomp.h>

View File

@ -3,8 +3,6 @@
#include <errno.h>
#include <fcntl.h>
#include <linux/kd.h>
#include <signal.h>
#include <string.h>
#include <sys/epoll.h>
#include <sys/inotify.h>
#include <sys/ioctl.h>

View File

@ -3,9 +3,7 @@
#include <errno.h>
#include <sched.h>
#include <stdio.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <unistd.h>
#include <linux/fs.h>

View File

@ -7,7 +7,6 @@
#include <errno.h>
#include <selinux/avc.h>
#include <selinux/selinux.h>
#include <stdio.h>
#if HAVE_AUDIT
#include <libaudit.h>
#endif

View File

@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <errno.h>
#include <signal.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

View File

@ -5,12 +5,10 @@
Nathaniel Chen <nathaniel.chen@intel.com>
***/
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "alloc-util.h"

View File

@ -5,7 +5,6 @@
#include <fcntl.h>
#include <mqueue.h>
#include <netinet/tcp.h>
#include <signal.h>
#include <sys/epoll.h>
#include <sys/stat.h>
#include <unistd.h>

View File

@ -727,7 +727,6 @@ static void swap_enter_signal(Swap *s, SwapState state, SwapResult f) {
if (s->result == SWAP_SUCCESS)
s->result = f;
r = unit_kill_context(UNIT(s),
&s->kill_context,
state_to_kill_operation(s, state),
@ -929,7 +928,6 @@ static int swap_stop(Unit *u) {
swap_enter_signal(s, SWAP_DEACTIVATING_SIGKILL, SWAP_SUCCESS);
return 0;
default:
assert_not_reached("Unexpected state.");
}

View File

@ -2,9 +2,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <unistd.h>
#include "sd-id128.h"

View File

@ -4,7 +4,6 @@
#include <getopt.h>
#include <locale.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "sd-bus.h"

View File

@ -2,7 +2,6 @@
#include <errno.h>
#include <mntent.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>

View File

@ -2,7 +2,6 @@
#include <errno.h>
#include <getopt.h>
#include <string.h>
#include <sys/prctl.h>
#include <unistd.h>

View File

@ -6,7 +6,6 @@
#include <errno.h>
#include <fcntl.h>
#include <stdbool.h>
#include <stdio.h>
#include <sys/file.h>
#include <sys/prctl.h>
#include <sys/stat.h>

View File

@ -1,9 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <errno.h>
#include <mntent.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "alloc-util.h"

View File

@ -2,7 +2,6 @@
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include "alloc-util.h"

View File

@ -1,8 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <blkid.h>
#include <stdlib.h>
#include <sys/statfs.h>
#include <unistd.h>
#include "sd-device.h"

View File

@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <errno.h>
#include <string.h>
#include <sys/utsname.h>
#include <sys/stat.h>
#include <sys/types.h>

View File

@ -2,11 +2,8 @@
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/prctl.h>
#include <sys/socket.h>
#include <stdint.h>
#include "sd-daemon.h"

View File

@ -2,7 +2,6 @@
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#if HAVE_GNUTLS
#include <gnutls/gnutls.h>

View File

@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include <alloca.h>
#include <stdio.h>
#include "alloc-util.h"

View File

@ -4,7 +4,6 @@
#include <fcntl.h>
#include <locale.h>
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>

View File

@ -2,7 +2,6 @@
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -27,7 +27,6 @@
* http://eprint.iacr.org/2013/397
*/
#include <gcrypt.h>
#include <string.h>
#include "fsprg.h"

View File

@ -4,7 +4,6 @@
#include <fcntl.h>
#include <printf.h>
#include <stddef.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>

View File

@ -5,13 +5,11 @@
#include <fnmatch.h>
#include <getopt.h>
#include <linux/fs.h>
#include <locale.h>
#include <poll.h>
#include <signal.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/inotify.h>
#include <sys/stat.h>
#include <unistd.h>
@ -2242,9 +2240,6 @@ int main(int argc, char *argv[]) {
HASHMAP_FOREACH(d, j->directories_by_path, i) {
int q;
if (d->is_root)
continue;
q = journal_directory_vacuum(d->path, arg_vacuum_size, arg_vacuum_n_files, arg_vacuum_time, NULL, !arg_quiet);
if (q < 0) {
log_error_errno(q, "Failed to vacuum %s: %m", d->path);

View File

@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <errno.h>
#include <string.h>
#include "alloc-util.h"
#include "hashmap.h"

View File

@ -9,7 +9,6 @@
#include <net/if_arp.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <linux/filter.h>
#include <linux/if_infiniband.h>
#include <linux/if_packet.h>

View File

@ -6,7 +6,6 @@
#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "alloc-util.h"
#include "dhcp-internal.h"

View File

@ -8,7 +8,6 @@
#include <netinet/ip6.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <linux/if_packet.h>

View File

@ -5,7 +5,6 @@
#include <errno.h>
#include <netinet/in.h>
#include <string.h>
#include "sd-dhcp6-client.h"

View File

@ -9,7 +9,6 @@
#include <netinet/ip6.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <net/if.h>

View File

@ -8,7 +8,6 @@
#include <net/if_arp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <linux/if_infiniband.h>

View File

@ -5,9 +5,7 @@
#include <arpa/inet.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

Some files were not shown because too many files have changed in this diff Show More