summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/dbus-execute.c2
-rw-r--r--src/core/dbus.c4
-rw-r--r--src/core/execute.c8
-rw-r--r--src/core/ima-setup.c8
-rw-r--r--src/core/target.c5
5 files changed, 21 insertions, 6 deletions
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index 7df4cab3f6..0454a28e12 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -710,7 +710,7 @@ static int property_get_bind_paths(
c->bind_mounts[i].source,
c->bind_mounts[i].destination,
c->bind_mounts[i].ignore_enoent,
- c->bind_mounts[i].recursive ? MS_REC : 0);
+ c->bind_mounts[i].recursive ? (uint64_t) MS_REC : (uint64_t) 0);
if (r < 0)
return r;
}
diff --git a/src/core/dbus.c b/src/core/dbus.c
index 065f2d81d6..cfc045d282 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -753,13 +753,13 @@ int manager_sync_bus_names(Manager *m, sd_bus *bus) {
/* If it is, determine its current owner */
r = sd_bus_get_name_creds(bus, name, SD_BUS_CREDS_UNIQUE_NAME, &creds);
if (r < 0) {
- log_error_errno(r, "Failed to get bus name owner %s: %m", name);
+ log_full_errno(r == -ENXIO ? LOG_DEBUG : LOG_ERR, r, "Failed to get bus name owner %s: %m", name);
continue;
}
r = sd_bus_creds_get_unique_name(creds, &unique);
if (r < 0) {
- log_error_errno(r, "Failed to get unique name for %s: %m", name);
+ log_full_errno(r == -ENXIO ? LOG_DEBUG : LOG_ERR, r, "Failed to get unique name for %s: %m", name);
continue;
}
diff --git a/src/core/execute.c b/src/core/execute.c
index 29988c22ae..2056e2273c 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -2989,6 +2989,14 @@ int exec_spawn(Unit *unit,
error_message),
"EXECUTABLE=%s", command->path,
NULL);
+ else if (r == -ENOENT && command->ignore)
+ log_struct_errno(LOG_INFO, r,
+ "MESSAGE_ID=" SD_MESSAGE_SPAWN_FAILED_STR,
+ LOG_UNIT_ID(unit),
+ LOG_UNIT_MESSAGE(unit, "Skipped spawning %s: %m",
+ command->path),
+ "EXECUTABLE=%s", command->path,
+ NULL);
else
log_struct_errno(LOG_ERR, r,
"MESSAGE_ID=" SD_MESSAGE_SPAWN_FAILED_STR,
diff --git a/src/core/ima-setup.c b/src/core/ima-setup.c
index 94ae429f46..7b5c98a57c 100644
--- a/src/core/ima-setup.c
+++ b/src/core/ima-setup.c
@@ -49,6 +49,11 @@ int ima_setup(void) {
return 0;
}
+ if (access(IMA_POLICY_PATH, F_OK) < 0) {
+ log_debug("No IMA custom policy file "IMA_POLICY_PATH", ignoring.");
+ return 0;
+ }
+
imafd = open(IMA_SECFS_POLICY, O_WRONLY|O_CLOEXEC);
if (imafd < 0) {
log_error_errno(errno, "Failed to open the IMA kernel interface "IMA_SECFS_POLICY", ignoring: %m");
@@ -62,8 +67,7 @@ int ima_setup(void) {
/* fall back to copying the policy line-by-line */
input = fopen(IMA_POLICY_PATH, "re");
if (!input) {
- log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_WARNING, errno,
- "Failed to open the IMA custom policy file "IMA_POLICY_PATH", ignoring: %m");
+ log_warning_errno(errno, "Failed to open the IMA custom policy file "IMA_POLICY_PATH", ignoring: %m");
return 0;
}
diff --git a/src/core/target.c b/src/core/target.c
index ff0d764fb5..2a58dd394d 100644
--- a/src/core/target.c
+++ b/src/core/target.c
@@ -63,6 +63,9 @@ static int target_add_default_dependencies(Target *t) {
assert(t);
+ if (!UNIT(t)->default_dependencies)
+ return 0;
+
/* Imply ordering for requirement dependencies on target
* units. Note that when the user created a contradicting
* ordering manually we won't add anything in here to make
@@ -93,7 +96,7 @@ static int target_load(Unit *u) {
return r;
/* This is a new unit? Then let's add in some extras */
- if (u->load_state == UNIT_LOADED && u->default_dependencies) {
+ if (u->load_state == UNIT_LOADED) {
r = target_add_default_dependencies(t);
if (r < 0)
return r;