# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
-# See tmpfiles.d(5) for details
-
-L /etc/os-release - - - - ../usr/lib/os-release
-L /etc/localtime - - - - ../usr/share/zoneinfo/UTC
-L+ /etc/mtab - - - - ../proc/self/mounts
+g systemd-journal - -
+u systemd-bus-proxy - "systemd Bus Proxy"
+m4_ifdef(`ENABLE_NETWORKD',
+u systemd-network - "systemd Network Management"
+)m4_dnl
m4_ifdef(`ENABLE_RESOLVED',
-L! /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf
+u systemd-resolve - "systemd Resolver"
)m4_dnl
-C /etc/nsswitch.conf - - - -
-m4_ifdef(`HAVE_PAM',
-C /etc/pam.d - - - -
+m4_ifdef(`ENABLE_TIMESYNCD',
+u systemd-timesync - "systemd Time Synchronization"
)m4_dnl
* directly to the system instance, instead of going via the
* bus */
-#ifdef ENABLE_KDBUS
r = sd_bus_new(&bus);
if (r < 0)
return r;
}
bus = sd_bus_unref(bus);
-#endif
r = sd_bus_new(&bus);
if (r < 0)
assert(_bus);
-#ifdef ENABLE_KDBUS
r = sd_bus_new(&bus);
if (r < 0)
return r;
}
bus = sd_bus_unref(bus);
-#endif
e = secure_getenv("XDG_RUNTIME_DIR");
if (!e)
bool is_kdbus_wanted(void) {
_cleanup_free_ char *value = NULL;
+#ifdef ENABLE_KDBUS
+ const bool configured = true;
+#else
+ const bool configured = false;
+#endif
+
int r;
- if (get_proc_cmdline_key("kdbus", NULL) <= 0) {
- r = get_proc_cmdline_key("kdbus=", &value);
- if (r <= 0 || parse_boolean(value) != 1)
- return false;
- }
+ if (get_proc_cmdline_key("kdbus", NULL) > 0)
+ return true;
+
+ r = get_proc_cmdline_key("kdbus=", &value);
+ if (r <= 0)
+ return configured;
- return true;
+ return parse_boolean(value) == 1;
}
bool is_kdbus_available(void) {
if (!ee)
return -ENOMEM;
-#ifdef ENABLE_KDBUS
(void) asprintf(&b->address, KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT, getuid(), ee);
-#else
- (void) asprintf(&b->address, UNIX_USER_BUS_ADDRESS_FMT, ee);
-#endif
- } else {
-#ifdef ENABLE_KDBUS
+ } else
(void) asprintf(&b->address, KERNEL_USER_BUS_ADDRESS_FMT, getuid());
-#else
- return -ECONNREFUSED;
-#endif
- }
if (!b->address)
return -ENOMEM;
if (!e)
return -ENOMEM;
-#ifdef ENABLE_KDBUS
b->address = strjoin("x-machine-kernel:machine=", e, ";x-machine-unix:machine=", e, NULL);
-#else
- b->address = strjoin("x-machine-unix:machine=", e, NULL);
-#endif
if (!b->address)
return -ENOMEM;
uid_t uid,
const char *runtime) {
-#ifdef ENABLE_KDBUS
_cleanup_free_ char *s = NULL;
int r;
pam_syslog(handle, LOG_ERR, "Failed to set bus variable.");
return r;
}
-#endif
+
return PAM_SUCCESS;
}
#define UNIX_SYSTEM_BUS_ADDRESS "unix:path=/var/run/dbus/system_bus_socket"
#define KERNEL_SYSTEM_BUS_ADDRESS "kernel:path=/sys/fs/kdbus/0-system/bus"
-
-#ifdef ENABLE_KDBUS
-# define DEFAULT_SYSTEM_BUS_ADDRESS KERNEL_SYSTEM_BUS_ADDRESS ";" UNIX_SYSTEM_BUS_ADDRESS
-#else
-# define DEFAULT_SYSTEM_BUS_ADDRESS UNIX_SYSTEM_BUS_ADDRESS
-#endif
-
+#define DEFAULT_SYSTEM_BUS_ADDRESS KERNEL_SYSTEM_BUS_ADDRESS ";" UNIX_SYSTEM_BUS_ADDRESS
#define UNIX_USER_BUS_ADDRESS_FMT "unix:path=%s/bus"
#define KERNEL_USER_BUS_ADDRESS_FMT "kernel:path=/sys/fs/kdbus/"UID_FMT"-user/bus"
Conflicts=shutdown.target
Wants=network.target
-m4_ifdef(`ENABLE_KDBUS',
# On kdbus systems we pull in the busname explicitly, because it
# carries policy that allows the daemon to acquire its name.
Wants=org.freedesktop.network1.busname
After=org.freedesktop.network1.busname
-)m4_dnl
[Service]
Type=notify
Restart=on-failure