Commit 2b583ce6 authored by Kay Sievers's avatar Kay Sievers Committed by Lennart Poettering

use /run instead of /dev/.run

Instead of the /dev/.run trick we have currently implemented, we decided
to move the early-boot runtime dir to /run.

An existing /var/run directory is bind-mounted to /run. If /var/run is
already a symlink, no action is taken.

An existing /var/lock directory is bind-mounted to /run/lock.
If /var/lock is already a symlink, no action is taken.

To implement the directory vs. symlink logic, we have a:
  ConditionPathIsDirectory=
now, which is used in the mount units.

Skipped mount unit in case of symlink:
  $ systemctl status var-run.mount
  var-run.mount - Runtime Directory
    Loaded: loaded (/lib/systemd/system/var-run.mount)
    Active: inactive (dead)
            start condition failed at Fri, 25 Mar 2011 04:51:41 +0100; 6min ago
     Where: /var/run
      What: /run
    CGroup: name=systemd:/system/var-run.mount

The systemd rpm needs to make sure to add something like:
  %pre
  mkdir -p -m0755 /run >/dev/null 2>&1 || :
or it needs to be added to filesystem.rpm.

Udev -git already uses /run if that exists, and is writable at bootup.
Otherwise it falls back to the current /dev/.udev.

Dracut and plymouth need to be adopted to switch from /dev/.run to run
too.

Cheers,
Kay
parent 37f85e66
......@@ -123,7 +123,7 @@
reference implementation.</para>
<para>Internally, this function creates a file in
<filename>/dev/.run/systemd/readahead/</filename> which is
<filename>/run/systemd/readahead/</filename> which is
then used as flag file to notify the read-ahead
subsystem.</para>
......
......@@ -99,7 +99,7 @@
<para>Note that <command>systemd-nspawn</command> will
mount file systems private to the container to
<filename>/dev</filename>,
<filename>/dev/.run</filename> and similar. These will
<filename>/run</filename> and similar. These will
not be visible outside of the container, and their
contents will be lost when the container exits.</para>
......
......@@ -223,7 +223,7 @@ static int create_socket(char **name) {
zero(sa);
sa.un.sun_family = AF_UNIX;
snprintf(sa.un.sun_path, sizeof(sa.un.sun_path)-1, "/dev/.run/systemd/ask-password/sck.%llu", random_ull());
snprintf(sa.un.sun_path, sizeof(sa.un.sun_path)-1, "/run/systemd/ask-password/sck.%llu", random_ull());
if (bind(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)) < 0) {
r = -errno;
......@@ -265,7 +265,7 @@ int ask_password_agent(
_FD_MAX
};
char temp[] = "/dev/.run/systemd/ask-password/tmp.XXXXXX";
char temp[] = "/run/systemd/ask-password/tmp.XXXXXX";
char final[sizeof(temp)] = "";
int fd = -1, r;
FILE *f = NULL;
......@@ -280,7 +280,7 @@ int ask_password_agent(
sigset_add_many(&mask, SIGINT, SIGTERM, -1);
assert_se(sigprocmask(SIG_BLOCK, &mask, &oldmask) == 0);
mkdir_p("/dev/.run/systemd/ask-password", 0755);
mkdir_p("/run/systemd/ask-password", 0755);
if ((fd = mkostemp(temp, O_CLOEXEC|O_CREAT|O_WRONLY)) < 0) {
log_error("Failed to create password file: %m");
......
......@@ -49,7 +49,7 @@ int main(int argc, char *argv[]) {
* this to avoid an activation loop when we start dbus when we
* are called when the dbus service is shut down. */
if (!(bus = dbus_connection_open_private("unix:path=/dev/.run/systemd/private", &error))) {
if (!(bus = dbus_connection_open_private("unix:path=/run/systemd/private", &error))) {
#ifndef LEGACY
dbus_error_free(&error);
......
......@@ -134,6 +134,14 @@ bool condition_test(Condition *c) {
case CONDITION_PATH_EXISTS:
return (access(c->parameter, F_OK) >= 0) == !c->negate;
case CONDITION_PATH_IS_DIRECTORY: {
struct stat st;
if (lstat(c->parameter, &st) < 0)
return !c->negate;
return S_ISDIR(st.st_mode) == !c->negate;
}
case CONDITION_DIRECTORY_NOT_EMPTY: {
int k;
......
......@@ -28,6 +28,7 @@
typedef enum ConditionType {
CONDITION_PATH_EXISTS,
CONDITION_PATH_IS_DIRECTORY,
CONDITION_DIRECTORY_NOT_EMPTY,
CONDITION_KERNEL_COMMAND_LINE,
CONDITION_VIRTUALIZATION,
......
......@@ -61,7 +61,7 @@ static int next_assignment(
if (!t->parse)
return 0;
return t->parse(filename, line, section, lvalue, rvalue, t->data, userdata);
return t->parse(filename, line, section, lvalue, t->ltype, rvalue, t->data, userdata);
}
/* Warn about unknown non-extension fields. */
......@@ -226,6 +226,7 @@ int config_parse_int(
unsigned line,
const char *section,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
......@@ -251,6 +252,7 @@ int config_parse_uint64(
unsigned line,
const char *section,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
......@@ -276,6 +278,7 @@ int config_parse_unsigned(
unsigned line,
const char *section,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
......@@ -301,6 +304,7 @@ int config_parse_size(
unsigned line,
const char *section,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
......@@ -328,6 +332,7 @@ int config_parse_bool(
unsigned line,
const char *section,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
......@@ -354,6 +359,7 @@ int config_parse_string(
unsigned line,
const char *section,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
......@@ -383,6 +389,7 @@ int config_parse_path(
unsigned line,
const char *section,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
......@@ -416,6 +423,7 @@ int config_parse_strv(
unsigned line,
const char *section,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
......@@ -468,6 +476,7 @@ int config_parse_path_strv(
unsigned line,
const char *section,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
......
......@@ -28,12 +28,13 @@
/* An abstract parser for simple, line based, shallow configuration
* files consisting of variable assignments only. */
typedef int (*ConfigParserCallback)(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
typedef int (*ConfigParserCallback)(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
/* Wraps info for parsing a specific configuration variable */
typedef struct ConfigItem {
const char *lvalue; /* name of the variable */
ConfigParserCallback parse; /* Function that is called to parse the variable's value */
int ltype; /* Distinguish differnt variables passed to the same callback */
void *data; /* Where to store the variable's data */
const char *section;
} ConfigItem;
......@@ -44,15 +45,15 @@ typedef struct ConfigItem {
int config_parse(const char *filename, FILE *f, const char* const *sections, const ConfigItem *t, bool relaxed, void *userdata);
/* Generic parsers */
int config_parse_int(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
int config_parse_unsigned(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
int config_parse_uint64(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
int config_parse_size(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
int config_parse_bool(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
int config_parse_string(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
int config_parse_path(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
int config_parse_strv(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
int config_parse_path_strv(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
int config_parse_int(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_unsigned(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_uint64(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_size(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_bool(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_string(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_path(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_strv(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_path_strv(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
#define DEFINE_CONFIG_PARSE_ENUM(function,name,type,msg) \
int function( \
......@@ -60,6 +61,7 @@ int config_parse_path_strv(const char *filename, unsigned line, const char *sect
unsigned line, \
const char *section, \
const char *lvalue, \
int ltype, \
const char *rvalue, \
void *data, \
void *userdata) { \
......
......@@ -104,7 +104,7 @@ int bus_connect(DBusBusType t, DBusConnection **_bus, bool *private, DBusError *
/* If we are root, then let's not go via the bus */
if (geteuid() == 0 && t == DBUS_BUS_SYSTEM) {
if (!(bus = dbus_connection_open_private("unix:path=/dev/.run/systemd/private", error))) {
if (!(bus = dbus_connection_open_private("unix:path=/run/systemd/private", error))) {
#ifndef LEGACY
dbus_error_free(error);
......
......@@ -955,8 +955,8 @@ static int bus_init_private(Manager *m) {
if (getpid() != 1)
return 0;
unlink("/dev/.run/systemd/private");
if (!(m->private_bus = dbus_server_listen("unix:path=/dev/.run/systemd/private", &error))) {
unlink("/run/systemd/private");
if (!(m->private_bus = dbus_server_listen("unix:path=/run/systemd/private", &error))) {
log_error("Failed to create private D-Bus server: %s", error.message);
r = -EIO;
goto fail;
......
......@@ -40,7 +40,7 @@ struct CGroupBonding;
#include "util.h"
/* Abstract namespace! */
#define LOGGER_SOCKET "/dev/.run/systemd/logger"
#define LOGGER_SOCKET "/run/systemd/logger"
typedef enum KillMode {
KILL_CONTROL_GROUP = 0,
......
......@@ -265,7 +265,7 @@ int main(int argc, char *argv[]) {
r = EXIT_SUCCESS;
if (status.si_code == CLD_EXITED && (status.si_status & 1))
touch("/dev/.run/systemd/quotacheck");
touch("/run/systemd/quotacheck");
finish:
if (udev_device)
......
This diff is collapsed.
......@@ -142,20 +142,20 @@ int machine_id_setup(void) {
fd = -1;
/* Hmm, we couldn't write it? So let's write it to
* /dev/.run/systemd/machine-id as a replacement */
* /run/systemd/machine-id as a replacement */
mkdir_p("/dev/.run/systemd", 0755);
mkdir_p("/run/systemd", 0755);
if ((r = write_one_line_file("/dev/.run/systemd/machine-id", id)) < 0) {
log_error("Cannot write /dev/.run/systemd/machine-id: %s", strerror(-r));
if ((r = write_one_line_file("/run/systemd/machine-id", id)) < 0) {
log_error("Cannot write /run/systemd/machine-id: %s", strerror(-r));
unlink("/dev/.run/systemd/machine-id");
unlink("/run/systemd/machine-id");
goto finish;
}
/* And now, let's mount it over */
r = mount("/dev/.run/systemd/machine-id", "/etc/machine-id", "bind", MS_BIND|MS_RDONLY, NULL) < 0 ? -errno : 0;
unlink("/dev/.run/systemd/machine-id");
r = mount("/run/systemd/machine-id", "/etc/machine-id", "bind", MS_BIND|MS_RDONLY, NULL) < 0 ? -errno : 0;
unlink("/run/systemd/machine-id");
if (r < 0)
log_error("Failed to mount /etc/machine-id: %s", strerror(-r));
......
......@@ -494,24 +494,24 @@ static DEFINE_CONFIG_PARSE_ENUM(config_parse_output, exec_output, ExecOutput, "F
static int parse_config_file(void) {
const ConfigItem items[] = {
{ "LogLevel", config_parse_level, NULL, "Manager" },
{ "LogTarget", config_parse_target, NULL, "Manager" },
{ "LogColor", config_parse_color, NULL, "Manager" },
{ "LogLocation", config_parse_location, NULL, "Manager" },
{ "DumpCore", config_parse_bool, &arg_dump_core, "Manager" },
{ "CrashShell", config_parse_bool, &arg_crash_shell, "Manager" },
{ "ShowStatus", config_parse_bool, &arg_show_status, "Manager" },
{ "LogLevel", config_parse_level, 0, NULL, "Manager" },
{ "LogTarget", config_parse_target, 0, NULL, "Manager" },
{ "LogColor", config_parse_color, 0, NULL, "Manager" },
{ "LogLocation", config_parse_location, 0, NULL, "Manager" },
{ "DumpCore", config_parse_bool, 0, &arg_dump_core, "Manager" },
{ "CrashShell", config_parse_bool, 0, &arg_crash_shell, "Manager" },
{ "ShowStatus", config_parse_bool, 0, &arg_show_status, "Manager" },
#ifdef HAVE_SYSV_COMPAT
{ "SysVConsole", config_parse_bool, &arg_sysv_console, "Manager" },
{ "SysVConsole", config_parse_bool, 0, &arg_sysv_console, "Manager" },
#endif
{ "CrashChVT", config_parse_int, &arg_crash_chvt, "Manager" },
{ "CPUAffinity", config_parse_cpu_affinity, NULL, "Manager" },
{ "MountAuto", config_parse_bool, &arg_mount_auto, "Manager" },
{ "SwapAuto", config_parse_bool, &arg_swap_auto, "Manager" },
{ "DefaultControllers", config_parse_strv, &arg_default_controllers, "Manager" },
{ "DefaultStandardOutput", config_parse_output, &arg_default_std_output, "Manager" },
{ "DefaultStandardError", config_parse_output, &arg_default_std_error, "Manager" },
{ NULL, NULL, NULL, NULL }
{ "CrashChVT", config_parse_int, 0, &arg_crash_chvt, "Manager" },
{ "CPUAffinity", config_parse_cpu_affinity, 0, NULL, "Manager" },
{ "MountAuto", config_parse_bool, 0, &arg_mount_auto, "Manager" },
{ "SwapAuto", config_parse_bool, 0, &arg_swap_auto, "Manager" },
{ "DefaultControllers", config_parse_strv, 0, &arg_default_controllers, "Manager" },
{ "DefaultStandardOutput", config_parse_output, 0, &arg_default_std_output, "Manager" },
{ "DefaultStandardError", config_parse_output, 0, &arg_default_std_error, "Manager" },
{ NULL, NULL, 0, NULL, NULL }
};
static const char * const sections[] = {
......@@ -1074,7 +1074,7 @@ int main(int argc, char *argv[]) {
/* If Plymouth is being run make sure we show the status, so
* that there's something nice to see when people press Esc */
if (access("/dev/.run/initramfs/plymouth", F_OK) >= 0)
if (access("/run/initramfs/plymouth", F_OK) >= 0)
arg_show_status = true;
if (arg_action == ACTION_HELP) {
......
......@@ -66,7 +66,7 @@
#define GC_QUEUE_USEC_MAX (10*USEC_PER_SEC)
/* Where clients shall send notification messages to */
#define NOTIFY_SOCKET_SYSTEM "/dev/.run/systemd/notify"
#define NOTIFY_SOCKET_SYSTEM "/run/systemd/notify"
#define NOTIFY_SOCKET_USER "@/org/freedesktop/systemd1/notify"
static int manager_setup_notify(Manager *m) {
......@@ -2592,7 +2592,7 @@ int manager_open_serialization(Manager *m, FILE **_f) {
assert(_f);
if (m->running_as == MANAGER_SYSTEM)
asprintf(&path, "/dev/.run/systemd/dump-%lu-XXXXXX", (unsigned long) getpid());
asprintf(&path, "/run/systemd/dump-%lu-XXXXXX", (unsigned long) getpid());
else
asprintf(&path, "/tmp/systemd-dump-%lu-XXXXXX", (unsigned long) getpid());
......@@ -2895,7 +2895,7 @@ void manager_run_generators(Manager *m) {
if (!m->generator_unit_path) {
char *p;
char system_path[] = "/dev/.run/systemd/generator-XXXXXX",
char system_path[] = "/run/systemd/generator-XXXXXX",
user_path[] = "/tmp/systemd-generator-XXXXXX";
if (!(p = mkdtemp(m->running_as == MANAGER_SYSTEM ? system_path : user_path))) {
......
......@@ -54,7 +54,7 @@ static const MountPoint mount_table[] = {
{ "devtmpfs", "/dev", "devtmpfs", "mode=755", MS_NOSUID, true },
{ "tmpfs", "/dev/shm", "tmpfs", "mode=1777", MS_NOSUID|MS_NODEV, true },
{ "devpts", "/dev/pts", "devpts", "mode=620,gid=" STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC, false },
{ "tmpfs", "/dev/.run", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
{ "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
{ "tmpfs", "/sys/fs/cgroup", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
{ "cgroup", "/sys/fs/cgroup/systemd", "cgroup", "none,name=systemd", MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
};
......@@ -253,8 +253,8 @@ int mount_setup(void) {
symlink_and_label(j, k);
/* Create a few directories we always want around */
mkdir("/dev/.run/systemd", 0755);
mkdir("/dev/.run/systemd/ask-password", 0755);
mkdir("/run/systemd", 0755);
mkdir("/run/systemd/ask-password", 0755);
return mount_cgroup_controllers();
}
......@@ -844,6 +844,10 @@ static void mount_enter_mounting(Mount *m) {
mkdir_p(m->where, m->directory_mode);
/* create the source directory for bind-mounts if needed */
if (m->parameters_fragment.fstype && strcmp(m->parameters_fragment.fstype, "bind") == 0)
mkdir_p(m->parameters_fragment.what, m->directory_mode);
if (m->from_fragment)
r = exec_command_set(
m->control_command,
......
......@@ -117,7 +117,7 @@ static int mount_all(const char *dest) {
{ "sysfs", "/sys", "sysfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, true },
{ "tmpfs", "/dev", "tmpfs", "mode=755", MS_NOSUID, true },
{ "/dev/pts", "/dev/pts", "bind", NULL, MS_BIND, true },
{ "tmpfs", "/dev/.run", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
{ "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
#ifdef HAVE_SELINUX
{ "selinux", "/selinux", "selinuxfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, false },
#endif
......
......@@ -183,7 +183,7 @@ int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as) {
if (!(p->unit_path = strv_new(
/* If you modify this you also want to modify
* systemdsystemunitpath= in systemd.pc.in! */
"/dev/.run/systemd/system",
"/run/systemd/system",
SYSTEM_CONFIG_UNIT_PATH,
"/etc/systemd/system",
"/usr/local/share/systemd/system",
......
......@@ -97,7 +97,7 @@ int main(int argc, char *argv[]) {
if (arg_skip)
return 0;
if (access("/dev/.run/systemd/quotacheck", F_OK) < 0)
if (access("/run/systemd/quotacheck", F_OK) < 0)
return 0;
}
......
......@@ -290,13 +290,13 @@ static int collect(const char *root) {
log_debug("Collecting...");
if (access("/dev/.run/systemd/readahead/cancel", F_OK) >= 0) {
if (access("/run/systemd/readahead/cancel", F_OK) >= 0) {
log_debug("Collection canceled");
r = -ECANCELED;
goto finish;
}
if (access("/dev/.run/systemd/readahead/done", F_OK) >= 0) {
if (access("/run/systemd/readahead/done", F_OK) >= 0) {
log_debug("Got termination request");
goto done;
}
......
......@@ -167,11 +167,11 @@ int open_inotify(void) {
return -errno;
}
mkdir("/dev/.run/systemd", 0755);
mkdir("/dev/.run/systemd/readahead", 0755);
mkdir("/run/systemd", 0755);
mkdir("/run/systemd/readahead", 0755);
if (inotify_add_watch(fd, "/dev/.run/systemd/readahead", IN_CREATE) < 0) {
log_error("Failed to watch /dev/.run/systemd/readahead: %m");
if (inotify_add_watch(fd, "/run/systemd/readahead", IN_CREATE) < 0) {
log_error("Failed to watch /run/systemd/readahead: %m");
close_nointr_nofail(fd);
return -errno;
}
......@@ -183,10 +183,10 @@ ReadaheadShared *shared_get(void) {
int fd;
ReadaheadShared *m = NULL;
mkdir("/dev/.run/systemd", 0755);
mkdir("/dev/.run/systemd/readahead", 0755);
mkdir("/run/systemd", 0755);
mkdir("/run/systemd/readahead", 0755);
if ((fd = open("/dev/.run/systemd/readahead/shared", O_CREAT|O_RDWR|O_CLOEXEC, 0644)) < 0) {
if ((fd = open("/run/systemd/readahead/shared", O_CREAT|O_RDWR|O_CLOEXEC, 0644)) < 0) {
log_error("Failed to create shared memory segment: %m");
goto finish;
}
......
......@@ -192,7 +192,7 @@ static int replay(const char *root) {
log_debug("Replaying...");
if (access("/dev/.run/systemd/readahead/noreplay", F_OK) >= 0) {
if (access("/run/systemd/readahead/noreplay", F_OK) >= 0) {
log_debug("Got termination request");
goto done;
}
......
......@@ -42,8 +42,8 @@ static int touch(const char *path) {
#if !defined(DISABLE_SYSTEMD) && defined(__linux__)
int fd;
mkdir("/dev/.run/systemd", 0755);
mkdir("/dev/.run/systemd/readahead", 0755);
mkdir("/run/systemd", 0755);
mkdir("/run/systemd/readahead", 0755);
if ((fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, 0666)) < 0)
return -errno;
......@@ -66,11 +66,11 @@ int sd_readahead(const char *action) {
return -EINVAL;
if (strcmp(action, "cancel") == 0)
return touch("/dev/.run/systemd/readahead/cancel");
return touch("/run/systemd/readahead/cancel");
else if (strcmp(action, "done") == 0)
return touch("/dev/.run/systemd/readahead/done");
return touch("/run/systemd/readahead/done");
else if (strcmp(action, "noreplay") == 0)
return touch("/dev/.run/systemd/readahead/noreplay");
return touch("/run/systemd/readahead/noreplay");
return -EINVAL;
}
......@@ -4023,11 +4023,11 @@ finish:
static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo *i, const char *config_path) {
const ConfigItem items[] = {
{ "Alias", config_parse_strv, &i->aliases, "Install" },
{ "WantedBy", config_parse_strv, &i->wanted_by, "Install" },
{ "Also", config_parse_also, NULL, "Install" },
{ "Alias", config_parse_strv, 0, &i->aliases, "Install" },
{ "WantedBy", config_parse_strv, 0, &i->wanted_by, "Install" },
{ "Also", config_parse_also, 0, NULL, "Install" },
{ NULL, NULL, NULL, NULL }
{ NULL, NULL, 0, NULL, NULL }
};
char **p;
......@@ -5366,7 +5366,7 @@ static int send_shutdownd(usec_t t, char mode, bool warn, const char *message) {
zero(sockaddr);
sockaddr.sa.sa_family = AF_UNIX;
sockaddr.un.sun_path[0] = 0;
strncpy(sockaddr.un.sun_path, "/dev/.run/systemd/shutdownd", sizeof(sockaddr.un.sun_path));
strncpy(sockaddr.un.sun_path, "/run/systemd/shutdownd", sizeof(sockaddr.un.sun_path));
zero(iovec);
iovec.iov_base = (char*) &c;
......@@ -5374,7 +5374,7 @@ static int send_shutdownd(usec_t t, char mode, bool warn, const char *message) {
zero(msghdr);
msghdr.msg_name = &sockaddr;
msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + sizeof("/dev/.run/systemd/shutdownd") - 1;
msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + sizeof("/run/systemd/shutdownd") - 1;
msghdr.msg_iov = &iovec;
msghdr.msg_iovlen = 1;
......
......@@ -251,12 +251,12 @@ static int parse_password(const char *filename, char **wall) {
bool accept_cached = false;
const ConfigItem items[] = {
{ "Socket", config_parse_string, &socket_name, "Ask" },
{ "NotAfter", config_parse_uint64, &not_after, "Ask" },
{ "Message", config_parse_string, &message, "Ask" },
{ "PID", config_parse_unsigned, &pid, "Ask" },
{ "AcceptCached", config_parse_bool, &accept_cached, "Ask" },
{ NULL, NULL, NULL, NULL }
{ "Socket", config_parse_string, 0, &socket_name, "Ask" },
{ "NotAfter", config_parse_uint64, 0, &not_after, "Ask" },
{ "Message", config_parse_string, 0, &message, "Ask" },
{ "PID", config_parse_unsigned, 0, &pid, "Ask" },
{ "AcceptCached", config_parse_bool, 0, &accept_cached, "Ask" },
{ NULL, NULL, 0, NULL, NULL }
};
FILE *f;
......@@ -431,7 +431,7 @@ static int wall_tty_block(void) {
if ((r = get_ctty_devnr(&devnr)) < 0)
return -r;
if (asprintf(&p, "/dev/.run/systemd/ask-password-block/%u:%u", major(devnr), minor(devnr)) < 0)
if (asprintf(&p, "/run/systemd/ask-password-block/%u:%u", major(devnr), minor(devnr)) < 0)
return -ENOMEM;
mkdir_parents(p, 0700);
......@@ -475,7 +475,7 @@ static bool wall_tty_match(const char *path) {
* advantage that the block will automatically go away if the
* process dies. */
if (asprintf(&p, "/dev/.run/systemd/ask-password-block/%u:%u", major(st.st_rdev), minor(st.st_rdev)) < 0)
if (asprintf(&p, "/run/systemd/ask-password-block/%u:%u", major(st.st_rdev), minor(st.st_rdev)) < 0)
return true;
fd = open(p, O_WRONLY|O_CLOEXEC|O_NONBLOCK|O_NOCTTY);
......@@ -494,7 +494,7 @@ static int show_passwords(void) {
struct dirent *de;
int r = 0;
if (!(d = opendir("/dev/.run/systemd/ask-password"))) {
if (!(d = opendir("/run/systemd/ask-password"))) {
if (errno == ENOENT)
return 0;
......@@ -519,7 +519,7 @@ static int show_passwords(void) {
if (!startswith(de->d_name, "ask."))
continue;
if (!(p = strappend("/dev/.run/systemd/ask-password/", de->d_name))) {
if (!(p = strappend("/run/systemd/ask-password/", de->d_name))) {
log_error("Out of memory");
r = -ENOMEM;
goto finish;
......@@ -558,14 +558,14 @@ static int watch_passwords(void) {
tty_block_fd = wall_tty_block();
mkdir_p("/dev/.run/systemd/ask-password", 0755);
mkdir_p("/run/systemd/ask-password", 0755);
if ((notify = inotify_init1(IN_CLOEXEC)) < 0) {
r = -errno;
goto finish;
}
if (inotify_add_watch(notify, "/dev/.run/systemd/ask-password", IN_CLOSE_WRITE|IN_MOVED_TO) < 0) {
if (inotify_add_watch(notify, "/run/systemd/ask-password", IN_CLOSE_WRITE|IN_MOVED_TO) < 0) {
r = -errno;
goto finish;
}
......
......@@ -11,7 +11,7 @@ systemdsystemunitdir=@systemunitdir@
systemduserunitdir=@pkgdatadir@/user
systemdsystemconfdir=@pkgsysconfdir@/system
systemduserconfdir=@pkgsysconfdir@/user
systemdsystemunitpath=/dev/.run/systemd/system:${systemdsystemconfdir}:/etc/systemd/system:/usr/local/share/systemd/system:/usr/share/systemd/system:/lib/systemd/system:${systemdsystemunitdir}
systemdsystemunitpath=/run/systemd/system:${systemdsystemconfdir}:/etc/systemd/system:/usr/local/share/systemd/system:/usr/share/systemd/system:/lib/systemd/system:${systemdsystemunitdir}
Name: systemd
Description: systemd System and Service Manager
......
......@@ -7,9 +7,10 @@
# See tmpfiles.d(5) for details
d /var/lock/subsys 0755 root root -
d /var/run/user 0755 root root 10d
F /var/run/utmp 0664 root utmp -
d /run/lock 0755 root lock -
d /run/lock/subsys 0755 root root -
d /run/user 0755 root root 10d
F /run/utmp 0664 root utmp -
f /var/log/wtmp 0664 root utmp -
f /var/log/btmp 0600 root utmp -
......
......@@ -12,7 +12,7 @@ After=systemd-readahead-collect.service systemd-readahead-replay.service
Before=local-fs.target shutdown.target remount-rootfs.service quotacheck.service
# Dracut informs us with this flag file if the root fsck was already run
ConditionPathExists=!/dev/.run/initramfs/root-fsck
ConditionPathExists=!/run/initramfs/root-fsck
[Service]
Type=oneshot
......
......@@ -13,7 +13,7 @@ After=systemd-vconsole-setup.service udev-settle.service
Before=systemd-ask-password-plymouth.service
# Dracut informs us with this flag file if plymouth is already running
ConditionPathExists=!/dev/.run/initramfs/plymouth
ConditionPathExists=!/run/initramfs/plymouth
[Service]
ExecStart=/sbin/plymouthd --mode=boot
......
......@@ -12,4 +12,4 @@ Conflicts=shutdown.target
Before=basic.target shutdown.target
[Path]
DirectoryNotEmpty=/dev/.run/systemd/ask-password
DirectoryNotEmpty=/run/systemd/ask-password
......@@ -12,4 +12,4 @@ Conflicts=shutdown.target systemd-ask-password-console.path systemd-ask-password
Before=basic.target shutdown.target
[Path]
DirectoryNotEmpty=/dev/.run/systemd/ask-password
DirectoryNotEmpty=/run/systemd/ask-password
......@@ -12,4 +12,4 @@ Conflicts=shutdown.target
Before=basic.target shutdown.target