mirror of
https://git.proxmox.com/git/systemd
synced 2026-01-21 19:13:45 +00:00
Merge branch 'master' into debian
This commit is contained in:
commit
c8fb40cecf
@ -244,6 +244,7 @@ dist_systemunit_DATA = \
|
||||
units/halt.target \
|
||||
units/kexec.target \
|
||||
units/local-fs.target \
|
||||
units/remote-fs.target \
|
||||
units/cryptsetup.target \
|
||||
units/network.target \
|
||||
units/nss-lookup.target \
|
||||
@ -301,7 +302,6 @@ nodist_systemunit_DATA = \
|
||||
units/getty@.service \
|
||||
units/serial-getty@.service \
|
||||
units/console-shell.service \
|
||||
units/remote-fs.target \
|
||||
units/systemd-initctl.service \
|
||||
units/systemd-logger.service \
|
||||
units/systemd-shutdownd.service \
|
||||
@ -342,14 +342,12 @@ dist_userunit_DATA = \
|
||||
units/user/exit.target
|
||||
|
||||
nodist_userunit_DATA = \
|
||||
units/user/remote-fs.target \
|
||||
units/user/exit.service
|
||||
|
||||
EXTRA_DIST = \
|
||||
units/getty@.service.m4 \
|
||||
units/serial-getty@.service.m4 \
|
||||
units/console-shell.service.m4 \
|
||||
units/remote-fs.target.m4 \
|
||||
units/rescue.service.m4 \
|
||||
units/systemd-initctl.service.in \
|
||||
units/systemd-logger.service.in \
|
||||
@ -1388,11 +1386,9 @@ endif
|
||||
$(LN_S) ../var-run.mount var-run.mount && \
|
||||
$(LN_S) ../media.mount media.mount )
|
||||
( cd $(DESTDIR)$(userunitdir) && \
|
||||
rm -f shutdown.target sockets.target local-fs.target swap.target bluetooth.target printer.target sound.target && \
|
||||
rm -f shutdown.target sockets.target bluetooth.target printer.target sound.target && \
|
||||
$(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
|
||||
$(LN_S) $(systemunitdir)/sockets.target sockets.target && \
|
||||
$(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
|
||||
$(LN_S) $(systemunitdir)/swap.target swap.target && \
|
||||
$(LN_S) $(systemunitdir)/bluetooth.target bluetooth.target && \
|
||||
$(LN_S) $(systemunitdir)/printer.target printer.target && \
|
||||
$(LN_S) $(systemunitdir)/sound.target sound.target )
|
||||
|
||||
4
TODO
4
TODO
@ -50,6 +50,8 @@ Features:
|
||||
|
||||
* add prefix match to sysctl, tmpfiles, ...
|
||||
|
||||
* send out "finished" signal when we are finished booting
|
||||
|
||||
* drop /.readahead on bigger upgrades with yum
|
||||
|
||||
* add inode stat() check to readahead to suppress preloading changed files
|
||||
@ -72,6 +74,8 @@ Features:
|
||||
|
||||
* show enablement status in systemctl status
|
||||
|
||||
* when failing to start a service due to ratelimiting, try again later, if restart=always is set
|
||||
|
||||
* write blog stories about:
|
||||
- enabling dbus services
|
||||
- status update
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
AC_PREREQ(2.63)
|
||||
|
||||
AC_INIT([systemd],[28],[systemd-devel@lists.freedesktop.org])
|
||||
AC_INIT([systemd],[29],[systemd-devel@lists.freedesktop.org])
|
||||
AC_CONFIG_SRCDIR([src/main.c])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
@ -116,10 +116,12 @@
|
||||
<term><varname>ID=</varname></term>
|
||||
|
||||
<listitem><para>A lower-case string
|
||||
identifying the operating system,
|
||||
excluding any version information and
|
||||
suitable for processing by scripts. If
|
||||
not set defaults to
|
||||
(no spaces) identifying the operating
|
||||
system, excluding any version
|
||||
information and suitable for
|
||||
processing by scripts or usage in
|
||||
generated file names. If not set
|
||||
defaults to
|
||||
<literal>linux</literal>. Example:
|
||||
<literal>ID=fedora</literal>.</para></listitem>
|
||||
</varlistentry>
|
||||
@ -128,10 +130,10 @@
|
||||
<term><varname>VERSION_ID=</varname></term>
|
||||
|
||||
<listitem><para>A lower-case string
|
||||
(mostly numeric) identifying the
|
||||
(mostly numeric, no spaces) identifying the
|
||||
operating system version, excluding
|
||||
any name information and suitable for
|
||||
processing by scripts. Example:
|
||||
processing by scripts or usage in generated file names. Example:
|
||||
<literal>VERSION_ID=15</literal>.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
@ -273,6 +273,14 @@
|
||||
be reset for the processes of the
|
||||
logged in user.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>debug=</option></term>
|
||||
|
||||
<listitem><para>Takes a boolean
|
||||
argument. If true, logs debugging
|
||||
information.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>Note that setting <varname>kill-user=1</varname>
|
||||
|
||||
@ -57,13 +57,13 @@
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<para>Unit configuration files for services, sockets
|
||||
<para>Unit configuration files for services, sockets,
|
||||
mount points and swap devices share a subset of
|
||||
configuration options which define the execution
|
||||
environment of spawned processes.</para>
|
||||
|
||||
<para>This man page lists the configuration options
|
||||
shared by these three unit types. See
|
||||
shared by these four unit types. See
|
||||
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
||||
for the common options of all unit configuration
|
||||
files, and
|
||||
|
||||
@ -47,7 +47,7 @@ static bool has_option(const char *haystack, const char *needle) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (f[l] != 0 && f[l] == ',') {
|
||||
if (f[l] != 0 && f[l] != ',') {
|
||||
f++;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -235,7 +235,7 @@ int bus_execute_append_capability_bs(DBusMessageIter *i, const char *property, v
|
||||
assert(property);
|
||||
assert(c);
|
||||
|
||||
/* We store this negated internally, to match the kernel, bu
|
||||
/* We store this negated internally, to match the kernel, but
|
||||
* we expose it normalized. */
|
||||
|
||||
normal = *(uint64_t*) data;
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
" <property name=\"SyslogLevelPrefix\" type=\"b\" access=\"read\"/>\n" \
|
||||
" <property name=\"Capabilities\" type=\"s\" access=\"read\"/>\n" \
|
||||
" <property name=\"SecureBits\" type=\"i\" access=\"read\"/>\n" \
|
||||
" <property name=\"CapabilityBoundingSetDrop\" type=\"t\" access=\"read\"/>\n" \
|
||||
" <property name=\"CapabilityBoundingSet\" type=\"t\" access=\"read\"/>\n" \
|
||||
" <property name=\"User\" type=\"s\" access=\"read\"/>\n" \
|
||||
" <property name=\"Group\" type=\"s\" access=\"read\"/>\n" \
|
||||
" <property name=\"SupplementaryGroups\" type=\"as\" access=\"read\"/>\n" \
|
||||
|
||||
@ -211,10 +211,10 @@ void exec_status_exit(ExecStatus *s, ExecContext *context, pid_t pid, int code,
|
||||
void exec_status_dump(ExecStatus *s, FILE *f, const char *prefix);
|
||||
|
||||
const char* exec_output_to_string(ExecOutput i);
|
||||
int exec_output_from_string(const char *s);
|
||||
ExecOutput exec_output_from_string(const char *s);
|
||||
|
||||
const char* exec_input_to_string(ExecInput i);
|
||||
int exec_input_from_string(const char *s);
|
||||
ExecInput exec_input_from_string(const char *s);
|
||||
|
||||
const char *kill_mode_to_string(KillMode k);
|
||||
KillMode kill_mode_from_string(const char *s);
|
||||
|
||||
@ -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", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
|
||||
{ "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NODEV, true },
|
||||
{ "tmpfs", "/sys/fs/cgroup", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV, false },
|
||||
{ "cgroup", "/sys/fs/cgroup/systemd", "cgroup", "none,name=systemd", MS_NOSUID|MS_NOEXEC|MS_NODEV, false },
|
||||
};
|
||||
@ -63,6 +63,7 @@ static const MountPoint mount_table[] = {
|
||||
* we just list them here so that we know that we should ignore them */
|
||||
|
||||
static const char * const ignore_paths[] = {
|
||||
"/sys/fs/selinux",
|
||||
"/selinux",
|
||||
"/proc/bus/usb"
|
||||
};
|
||||
|
||||
@ -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", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
|
||||
{ "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NODEV, true },
|
||||
#ifdef HAVE_SELINUX
|
||||
{ "selinux", "/selinux", "selinuxfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, false },
|
||||
#endif
|
||||
|
||||
@ -46,7 +46,8 @@ static int parse_argv(pam_handle_t *handle,
|
||||
char ***controllers,
|
||||
char ***reset_controllers,
|
||||
char ***kill_only_users,
|
||||
char ***kill_exclude_users) {
|
||||
char ***kill_exclude_users,
|
||||
bool *debug) {
|
||||
|
||||
unsigned i;
|
||||
bool reset_controller_set = false;
|
||||
@ -145,6 +146,15 @@ static int parse_argv(pam_handle_t *handle,
|
||||
|
||||
kill_exclude_users_set = true;
|
||||
|
||||
} else if (startswith(argv[i], "debug=")) {
|
||||
if ((k = parse_boolean(argv[i] + 6)) < 0) {
|
||||
pam_syslog(handle, LOG_ERR, "Failed to parse debug= argument.");
|
||||
return k;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
*debug = k;
|
||||
|
||||
} else {
|
||||
pam_syslog(handle, LOG_ERR, "Unknown parameter '%s'.", argv[i]);
|
||||
return -EINVAL;
|
||||
@ -406,6 +416,7 @@ _public_ PAM_EXTERN int pam_sm_open_session(
|
||||
char *buf = NULL;
|
||||
int lock_fd = -1;
|
||||
bool create_session = true;
|
||||
bool debug = false;
|
||||
char **controllers = NULL, **reset_controllers = NULL, **c;
|
||||
char *cgroup_user_tree = NULL;
|
||||
|
||||
@ -421,7 +432,7 @@ _public_ PAM_EXTERN int pam_sm_open_session(
|
||||
argc, argv,
|
||||
&create_session, NULL, NULL,
|
||||
&controllers, &reset_controllers,
|
||||
NULL, NULL) < 0)
|
||||
NULL, NULL, &debug) < 0)
|
||||
return PAM_SESSION_ERR;
|
||||
|
||||
if ((r = get_user_data(handle, &username, &pw)) != PAM_SUCCESS)
|
||||
@ -505,7 +516,8 @@ _public_ PAM_EXTERN int pam_sm_open_session(
|
||||
goto finish;
|
||||
}
|
||||
|
||||
pam_syslog(handle, LOG_DEBUG, "Moving new user session for %s into control group %s.", username, buf);
|
||||
if (debug)
|
||||
pam_syslog(handle, LOG_DEBUG, "Moving new user session for %s into control group %s.", username, buf);
|
||||
|
||||
if ((r = create_user_group(handle, SYSTEMD_CGROUP_CONTROLLER, buf, pw, true, true)) != PAM_SUCCESS)
|
||||
goto finish;
|
||||
@ -616,6 +628,7 @@ _public_ PAM_EXTERN int pam_sm_close_session(
|
||||
const char *username = NULL;
|
||||
bool kill_session = false;
|
||||
bool kill_user = false;
|
||||
bool debug = false;
|
||||
int lock_fd = -1, r;
|
||||
char *session_path = NULL, *nosession_path = NULL, *user_path = NULL;
|
||||
const char *id;
|
||||
@ -634,7 +647,7 @@ _public_ PAM_EXTERN int pam_sm_close_session(
|
||||
argc, argv,
|
||||
NULL, &kill_session, &kill_user,
|
||||
&controllers, NULL,
|
||||
&kill_only_users, &kill_exclude_users) < 0)
|
||||
&kill_only_users, &kill_exclude_users, &debug) < 0)
|
||||
return PAM_SESSION_ERR;
|
||||
|
||||
if ((r = get_user_data(handle, &username, &pw)) != PAM_SUCCESS)
|
||||
@ -676,13 +689,15 @@ _public_ PAM_EXTERN int pam_sm_close_session(
|
||||
}
|
||||
|
||||
if (kill_session && check_user_lists(handle, pw->pw_uid, kill_only_users, kill_exclude_users)) {
|
||||
pam_syslog(handle, LOG_DEBUG, "Killing remaining processes of user session %s of %s.", id, username);
|
||||
if (debug)
|
||||
pam_syslog(handle, LOG_DEBUG, "Killing remaining processes of user session %s of %s.", id, username);
|
||||
|
||||
/* Kill processes in session cgroup, and delete it */
|
||||
if ((r = cg_kill_recursive_and_wait(SYSTEMD_CGROUP_CONTROLLER, session_path, true)) < 0)
|
||||
pam_syslog(handle, LOG_ERR, "Failed to kill session cgroup: %s", strerror(-r));
|
||||
} else {
|
||||
pam_syslog(handle, LOG_DEBUG, "Moving remaining processes of user session %s of %s into control group %s.", id, username, nosession_path);
|
||||
if (debug)
|
||||
pam_syslog(handle, LOG_DEBUG, "Moving remaining processes of user session %s of %s into control group %s.", id, username, nosession_path);
|
||||
|
||||
/* Migrate processes from session to user
|
||||
* cgroup. First, try to create the user group
|
||||
|
||||
@ -154,9 +154,8 @@ bool enough_ram(void) {
|
||||
|
||||
assert_se(sysinfo(&si) >= 0);
|
||||
|
||||
return si.totalram > 127 * 1024*1024; /* Enable readahead only
|
||||
* with at least 128MB
|
||||
* memory */
|
||||
/* Enable readahead only with at least 128MB memory */
|
||||
return si.totalram > 127 * 1024*1024 / si.mem_unit;
|
||||
}
|
||||
|
||||
int open_inotify(void) {
|
||||
|
||||
@ -39,7 +39,8 @@ int selinux_setup(char *const argv[]) {
|
||||
int enforce = 0;
|
||||
|
||||
/* Already initialized? */
|
||||
if (path_is_mount_point("/selinux") > 0)
|
||||
if (path_is_mount_point("/sys/fs/selinux") > 0 ||
|
||||
path_is_mount_point("/selinux") > 0)
|
||||
return 0;
|
||||
|
||||
/* Before we load the policy we create a flag file to ensure
|
||||
|
||||
@ -1565,6 +1565,7 @@ static int check_unit(DBusConnection *bus, char **args, unsigned n) {
|
||||
|
||||
dbus_error_free(&error);
|
||||
dbus_message_unref(m);
|
||||
m = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -3962,6 +3963,7 @@ static int create_symlink(const char *verb, const char *old_path, const char *ne
|
||||
return 1;
|
||||
}
|
||||
|
||||
free(dest);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -4088,7 +4090,7 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo
|
||||
}
|
||||
|
||||
if (!f) {
|
||||
#if (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA)) || defined(TARGET_MEEGO) && defined (HAVE_SYSV_COMPAT)
|
||||
#if (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_SUSE) || defined(TARGET_MEEGO) || defined(TARGET_ALTLINUX)) && defined (HAVE_SYSV_COMPAT)
|
||||
|
||||
if (endswith(i->name, ".service")) {
|
||||
char *sysv;
|
||||
@ -4159,14 +4161,6 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/* Consider unit files stored in /lib and /usr always enabled
|
||||
* if they have no [Install] data. */
|
||||
if (streq(verb, "is-enabled") &&
|
||||
strv_isempty(i->aliases) &&
|
||||
strv_isempty(i->wanted_by) &&
|
||||
!path_startswith(filename, "/etc"))
|
||||
return 1;
|
||||
|
||||
i->path = filename;
|
||||
|
||||
if ((r = config_parse(filename, f, NULL, items, true, i)) < 0) {
|
||||
@ -4174,6 +4168,16 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Consider unit files stored in /lib and /usr always enabled
|
||||
* if they have no [Install] data. */
|
||||
if (streq(verb, "is-enabled") &&
|
||||
strv_isempty(i->aliases) &&
|
||||
strv_isempty(i->wanted_by) &&
|
||||
!path_startswith(filename, "/etc")) {
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
|
||||
n_symlinks += strv_length(i->aliases);
|
||||
n_symlinks += strv_length(i->wanted_by);
|
||||
|
||||
|
||||
1
units/.gitignore
vendored
1
units/.gitignore
vendored
@ -31,7 +31,6 @@ systemd-random-seed-save.service
|
||||
systemd-initctl.service
|
||||
systemd-logger.service
|
||||
getty@.service
|
||||
remote-fs.target
|
||||
systemd-update-utmp-runlevel.service
|
||||
systemd-update-utmp-shutdown.service
|
||||
test-env-replace
|
||||
|
||||
@ -9,11 +9,7 @@
|
||||
|
||||
[Unit]
|
||||
Description=Remote File Systems
|
||||
m4_dnl
|
||||
m4_ifdef(`FOR_SYSTEM',
|
||||
m4_dnl When running in system mode we need the network up
|
||||
After=network.target local-fs.target
|
||||
)m4_dnl
|
||||
After=local-fs.target
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Loading…
Reference in New Issue
Block a user