chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
execute: if the main process of a service already owns the TTY, don't wait for acquir...
[elogind.git]
/
src
/
mount.c
diff --git
a/src/mount.c
b/src/mount.c
index 86c5b0a8cf1b2e474f92d401b35db9ca28703a70..e7fdcc84f358993a8cc0aa154bd9102d9c82ef92 100644
(file)
--- a/
src/mount.c
+++ b/
src/mount.c
@@
-62,11
+62,13
@@
static void mount_init(Unit *u) {
m->timeout_usec = DEFAULT_TIMEOUT_USEC;
exec_context_init(&m->exec_context);
m->timeout_usec = DEFAULT_TIMEOUT_USEC;
exec_context_init(&m->exec_context);
+ m->directory_mode = 0755;
+
/* We need to make sure that /bin/mount is always called in
* the same process group as us, so that the autofs kernel
* side doesn't send us another mount request while we are
* already trying to comply its last one. */
/* We need to make sure that /bin/mount is always called in
* the same process group as us, so that the autofs kernel
* side doesn't send us another mount request while we are
* already trying to comply its last one. */
- m->exec_context.
no_setsid
= true;
+ m->exec_context.
same_pgrp
= true;
m->timer_watch.type = WATCH_INVALID;
m->timer_watch.type = WATCH_INVALID;
@@
-251,7
+253,7
@@
static int mount_add_target_links(Mount *m) {
else
target = SPECIAL_LOCAL_FS_TARGET;
else
target = SPECIAL_LOCAL_FS_TARGET;
- if ((r = manager_load_unit(m->meta.manager, target, NULL, &tu)) < 0)
+ if ((r = manager_load_unit(m->meta.manager, target, NULL,
NULL,
&tu)) < 0)
return r;
if (automount && m->meta.manager->running_as == MANAGER_SYSTEM) {
return r;
if (automount && m->meta.manager->running_as == MANAGER_SYSTEM) {
@@
-260,11
+262,7
@@
static int mount_add_target_links(Mount *m) {
if ((r = unit_load_related_unit(UNIT(m), ".automount", &am)) < 0)
return r;
if ((r = unit_load_related_unit(UNIT(m), ".automount", &am)) < 0)
return r;
- if ((r = unit_add_dependency(tu, UNIT_WANTS, UNIT(am), true)) < 0)
- return r;
-
- return unit_add_dependency(UNIT(am), UNIT_BEFORE, tu, true);
-
+ return unit_add_two_dependencies(tu, UNIT_AFTER, UNIT_WANTS, UNIT(am), true);
} else {
if (!noauto && handle)
} else {
if (!noauto && handle)
@@
-497,7
+495,8
@@
static void mount_dump(Unit *u, FILE *f, const char *prefix) {
"%sFrom /etc/fstab: %s\n"
"%sFrom /proc/self/mountinfo: %s\n"
"%sFrom fragment: %s\n"
"%sFrom /etc/fstab: %s\n"
"%sFrom /proc/self/mountinfo: %s\n"
"%sFrom fragment: %s\n"
- "%sKillMode: %s\n",
+ "%sKillMode: %s\n"
+ "%sDirectoryMode: %04o\n",
prefix, mount_state_to_string(m->state),
prefix, m->where,
prefix, strna(p->what),
prefix, mount_state_to_string(m->state),
prefix, m->where,
prefix, strna(p->what),
@@
-506,7
+505,8
@@
static void mount_dump(Unit *u, FILE *f, const char *prefix) {
prefix, yes_no(m->from_etc_fstab),
prefix, yes_no(m->from_proc_self_mountinfo),
prefix, yes_no(m->from_fragment),
prefix, yes_no(m->from_etc_fstab),
prefix, yes_no(m->from_proc_self_mountinfo),
prefix, yes_no(m->from_fragment),
- prefix, kill_mode_to_string(m->kill_mode));
+ prefix, kill_mode_to_string(m->kill_mode),
+ prefix, m->directory_mode);
if (m->control_pid > 0)
fprintf(f,
if (m->control_pid > 0)
fprintf(f,
@@
-535,6
+535,7
@@
static int mount_spawn(Mount *m, ExecCommand *c, pid_t *_pid) {
true,
true,
m->meta.manager->confirm_spawn,
true,
true,
m->meta.manager->confirm_spawn,
+ true,
m->meta.cgroup_bondings,
&pid)) < 0)
goto fail;
m->meta.cgroup_bondings,
&pid)) < 0)
goto fail;
@@
-662,6
+663,8
@@
static void mount_enter_mounting(Mount *m) {
m->control_command_id = MOUNT_EXEC_MOUNT;
m->control_command = m->exec_command + MOUNT_EXEC_MOUNT;
m->control_command_id = MOUNT_EXEC_MOUNT;
m->control_command = m->exec_command + MOUNT_EXEC_MOUNT;
+ mkdir_p(m->where, m->directory_mode);
+
if (m->from_fragment)
r = exec_command_set(
m->control_command,
if (m->from_fragment)
r = exec_command_set(
m->control_command,
@@
-934,7
+937,7
@@
static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) {
m->failure = m->failure || !success;
if (m->control_command) {
m->failure = m->failure || !success;
if (m->control_command) {
- exec_status_
fill
(&m->control_command->exec_status, pid, code, status);
+ exec_status_
exit
(&m->control_command->exec_status, pid, code, status);
m->control_command = NULL;
m->control_command_id = _MOUNT_EXEC_COMMAND_INVALID;
}
m->control_command = NULL;
m->control_command_id = _MOUNT_EXEC_COMMAND_INVALID;
}
@@
-1546,6
+1549,7
@@
const UnitVTable mount_vtable = {
.no_alias = true,
.no_instances = true,
.no_isolate = true,
.no_alias = true,
.no_instances = true,
.no_isolate = true,
+ .show_status = true,
.init = mount_init,
.load = mount_load,
.init = mount_init,
.load = mount_load,