b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
1e22b5cda04b6d5e0dd83ab8e6ecb452cf34851f |
|
28-Jan-2016 |
Lennart Poettering <lennart@poettering.net> |
core: don't reset /dev/console if stdin/stdout/stderr as passed as fd in a transient service
Otherwise we might end resetting /dev/console all the time when a transient service starts or stops.
Fixes #2377
Fixes #2198
Fixes #2061 |
7bb70b6e3d6600d4c448c016b71073706460a12e |
|
25-Jan-2016 |
Lennart Poettering <lennart@poettering.net> |
core: normalize error handling a bit, in setup_pam()
Assign errno-style errors to a variable called "r" when they happen, the same way we do this in most other calls. It's
bad enough that the error handling part of the function deals with two different error variables (pam_code and r) now,
but before this fix it was even three! |
2a836ca9703689ba05513c98fb293b91a186a9ac |
|
21-Jan-2016 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
systemd: remove dead code
We only go to fail label if pam_pid <= 0.
CID #1306746. |
b3267152783d5784c45010615045d4e8ee459da2 |
|
13-Jan-2016 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tree-wide: check if errno is greater than zero (2)
Compare errno with zero in a way that tells gcc that
(if the condition is true) errno is positive. |
f5e5c28f42a2f6d006785ec8b5e98c11a71bb039 |
|
13-Jan-2016 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tree-wide: check if errno is greater then zero
gcc is confused by the common idiom of
return errno ? -errno : -ESOMETHING
and thinks a positive value may be returned. Replace this condition
with errno > 0 to help gcc and avoid many spurious warnings. I filed
a gcc rfe a long time ago, but it hard to say if it will ever be
implemented [1].
Both conventions were used in the codebase, this change makes things
more consistent. This is a follow up to bcb161b0230f.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61846 |
755d4b67a471ed1a3472b8536cb51315d4e4e3c1 |
|
11-Jan-2016 |
Ismo Puustinen <ismo.puustinen@intel.com> |
capabilities: added support for ambient capabilities.
This patch adds support for ambient capabilities in service files. The
idea with ambient capabilities is that the execed processes can run with
non-root user and get some inherited capabilities, without having any
need to add the capabilities to the executable file.
You need at least Linux 4.3 to use ambient capabilities. SecureBit
keep-caps is automatically added when you use ambient capabilities and
wish to change the user.
An example system service file might look like this:
[Unit]
Description=Service for testing caps
[Service]
ExecStart=/usr/bin/sleep 10000
User=nobody
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_RAW
After starting the service it has these capabilities:
CapInh: 0000000000003000
CapPrm: 0000000000003000
CapEff: 0000000000003000
CapBnd: 0000003fffffffff
CapAmb: 0000000000003000 |
a103496ca585e22bb5e386e3238b468d133f5659 |
|
11-Jan-2016 |
Ismo Puustinen <ismo.puustinen@intel.com> |
capabilities: keep bounding set in non-inverted format.
Change the capability bounding set parser and logic so that the bounding
set is kept as a positive set internally. This means that the set
reflects those capabilities that we want to keep instead of drop. |
3c11da9d80e804801575a0a9f6db116e12fdd01d |
|
30-Nov-2015 |
Evgeny Vereshchagin <evvers@ya.ru> |
core: dump soft limits too |
74129a127676e4f0edac0db4296c103e76ec6694 |
|
27-Nov-2015 |
lc85446 <lc85446@alibaba-inc.com> |
core:execute: fix fork() fail handling in exec_spawn()
If pid < 0 after fork(), 0 is always returned because r =
exec_context_load_environment() has exited successfully.
This will make the caller of exec_spawn() not able to handle
the fork() error case and make systemd abort assert() possibly. |
fdbbadbd0d13d3296b9aa4273aaeecd9ba6b82d1 |
|
27-Nov-2015 |
Evgeny Vereshchagin <evvers@ya.ru> |
core: dump rlim_cur too |
b4c14404b3e8753c41bac0b1d49369230a15c544 |
|
11-Nov-2015 |
Filipe Brandenburger <filbranden@google.com> |
execute: Add new PassEnvironment= directive
This directive allows passing environment variables from the system
manager to spawned services. Variables in the system manager can be set
inside a container by passing `--set-env=...` options to systemd-spawn.
Tested with an on-disk test.service unit. Tested using multiple variable
names on a single line, with an empty setting to clear the current list
of variables, with non-existing variables.
Tested using `systemd-run -p PassEnvironment=VARNAME` to confirm it
works with transient units.
Confirmed that `systemctl show` will display the PassEnvironment
settings.
Checked that man pages are generated correctly.
No regressions in `make check`. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
7d50b32a129e781401cf897475f388f682de1368 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out globbing related calls into glob-util.[ch] |
7ccbd1ae843d77275f2c542582a9a80e5e058a70 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out syslog-related calls into syslog-util.[ch] |
430f0182b72373145c839dbfe99d2382855cb8f8 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
src/basic: rename audit.[ch] → audit-util.[ch] and capability.[ch] → capability-util.[ch]
The files are named too generically, so that they might conflict with
the upstream project headers. Hence, let's add a "-util" suffix, to
clarify that this are just our utility headers and not any official
upstream headers. |
8b43440b7ef4b81c69c31de7ff820dc07a780254 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move string table stuff into its own string-table.[ch] |
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move a number of fs operations into fs-util.[ch] |
78f22b973fa2c9b09bd974680836df17163d9ee0 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out resource limits related calls into rlimit-util.[ch] |
6bedfcbb2970e06a4d3280c8fb62083d252ede73 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch] |
b1d4f8e154bf61b5de1b27461ef8e9c8c5e838a1 |
|
26-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out user/group/uid/gid calls into user-util.[ch] |
c004493cdefc1f43a3956ca529e8070f8d70be56 |
|
26-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out IO related calls to io-util.[ch] |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.
This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.
Also touches a few unrelated include files. |
c2bbd90b5a60cfba87cee98fa4ad66de73036801 |
|
16-Oct-2015 |
Evgeny Vereshchagin <evvers@ya.ru> |
core: dump RuntimeDirectories and RuntimeDirectoryMode too |
3d18b167558bde95a076b16d40f9454f169e70ba |
|
08-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util: do not reset terminal in acquire_terminal()
Before, we'd always reset acquired terminals, which is not really
desired, as we expose a setting TTYReset= which is supposed to control
whether the TTY is reset or not. Previously that setting would only
enable a second resetting of the TTY, which is of course pointless...
Hence, move the implicit resetting out of acquire_terminal() and make
the callers do it if they need it. |
a34ceba66fc0e856d8f76f340389a4768b57a365 |
|
08-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
core: add support for setting stdin/stdout/stderr for transient services
When starting a transient service, allow setting stdin/stdout/stderr fds
for it, by passing them in via the bus.
This also simplifies some of the serialization code for units. |
e287086b8aa2558356af225a12d9bfea8e7d61ca |
|
07-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
ask-password: add support for caching passwords in the kernel keyring
This adds support for caching harddisk passwords in the kernel keyring
if it is available, thus supporting caching without Plymouth being
around.
This is also useful for hooking up "gdm-auto-login" with the collected
boot-time harddisk password, in order to support gnome keyring
passphrase unlocking via the HDD password, if it is the same.
Any passwords added to the kernel keyring this way have a timeout of
2.5min at which time they are purged from the kernel. |
8dd4c05b5495c7ffe0f12ace87e71abe17bd0a0e |
|
06-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
core: add support for naming file descriptors passed using socket activation
This adds support for naming file descriptors passed using socket
activation. The names are passed in a new $LISTEN_FDNAMES= environment
variable, that matches the existign $LISTEN_FDS= one and contains a
colon-separated list of names.
This also adds support for naming fds submitted to the per-service fd
store using FDNAME= in the sd_notify() message.
This also adds a new FileDescriptorName= setting for socket unit files
to set the name for fds created by socket units.
This also adds a new call sd_listen_fds_with_names(), that is similar to
sd_listen_fds(), but also returns the names of the fds.
systemd-activate gained the new --fdname= switch to specify a name for
testing socket activation.
This is based on #1247 by Maciej Wereski.
Fixes #1247. |
5f5d8eab1f2f5f5e088bc301533b3e4636de96c7 |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
core: allow setting WorkingDirectory= to the special value ~
If set to ~ the working directory is set to the home directory of the
user configured in User=.
This change also exposes the existing switch for the working directory
that allowed making missing working directories non-fatal.
This also changes "machinectl shell" to make use of this to ensure that
the invoked shell is by default in the user's home directory.
Fixes #1268. |
b213e1c11d5a383faf5c456a31389d5c0c0f039b |
|
23-Sep-2015 |
Sangjung Woo <sangjung.woo@samsung.com> |
exec: move mac_smack_apply_pid() and setup_pam() to same condition block
This cleans up exec_child() function by moving mac_smack_apply_pid()
and setup_pam() to the same condition block, since both of them have
the same condition (i.e params->apply_permissions). It improves
readability without changing its operation. |
6bf6e43e7e214a4bd03008a91a7fc77ce6934d65 |
|
23-Sep-2015 |
Sangjung Woo <sangjung.woo@samsung.com> |
exec: call setup_pam() after SMACK labeling
When 'SmackProcessLabel=' is used in user@.service file, all processes
launched in systemd user session should be labeled as the designated name
of 'SmackProcessLabel' directive. However, if systemd has its own smack
label using '--with-smack-run-label' configuration, '(sd-pam)' is
labeled as the specific name of '--with-smack-run-label'. If
'SmackProcessLabel=' is used in user@.service file without
'--with-smack-run-label' configuration, (sd-pam) is labeled as "_" since
systemd (i.e. pid=1) is labeled as "_".
This is mainly because setup_pam() function is called before applying
smack label to child process. This patch fixes it by calling setup_pam()
after setting the smack label. |
2d7c6aa20cef0128e7a90c4da3d3519ed5c6b0f3 |
|
23-Sep-2015 |
David Herrmann <dh.herrmann@gmail.com> |
core: make setup_pam() synchronous
If we spawn a unit with a non-empty 'PAMName=', we fork off a
child-process _inside_ the unit, known as '(sd-pam)', which watches the
session. It waits for the main-process to exit and then finishes it via
pam_close_session(3).
However, the '(sd-pam)' setup is highly asynchronous. There is no
guarantee that process gets spawned before we finish the unit setup.
Therefore, there might be a root-owned process inside of the cgroup of
the unit, thus causing cg_migrate() to error-out with EPERM.
This patch makes setup_pam() synchronous and waits for the '(sd-pam)'
setup to finish before continuing. This guarantees that setresuid(2) was
at least tried before we continue with the child setup of the real unit.
Note that if setresuid(2) fails, we already warn loudly about it. You
really must make sure that you own the passed user if using 'PAMName='.
It seems very plausible to rely on that assumption. |
5bc7452b3219456e07f931e40da30bb94a884293 |
|
21-Sep-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
core: fix group ownership when Group is set
When Group is set in the unit, the runtime directories are owned by
this group and not the default group of the user (same for cgroup paths
and standard outputs)
Fix #1231 |
c7cc737fce8e5ba8438c1613756b48a0c2ecbb0f |
|
11-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
execute: fix return type from write() |
54eb2300ae07d28922a18a9d14dc597850535e9c |
|
11-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
execute: invalidate idle pipe after use
Not strictly necessary, but makes clear the fds are invalidated. Make
sure we do the same here as in most other cases. |
525d3cc746a037e8cc6b2e0ebaaf76a51856fa6b |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: take benefit of the fact that hashmap_free() returns NULL
And set_free() too.
Another Coccinelle patch. |
6796073e330f49923c5134652ee085e29fc88002 |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: make use of the fact that strv_free() returns NULL
Another Coccinelle patch. |
1f6b411372076426c0faf0bb350437fb4d82931f |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: update empty-if coccinelle script to cover empty-while and more
Let's also clean up single-line while and for blocks. |
76ef789d264f9eb7d7624b994aa6eead1dacfac4 |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: make use of log_error_errno() return value
Turns this:
r = -errno;
log_error_errno(errno, "foo");
into this:
r = log_error_errno(errno, "foo");
and this:
r = log_error_errno(errno, "foo");
return r;
into this:
return log_error_errno(errno, "foo"); |
3cc2aff1abff9e34f9fec282d970204dc1eab6f1 |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: don't do assignments within if checks
Turn this:
if ((r = foo()) < 0) { ...
into this:
r = foo();
if (r < 0) { ... |
a1e58e8ee1c84b633d6d6d651d5328d4dd4eba5b |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: use coccinelle to patch a lot of code to use mfree()
This replaces this:
free(p);
p = NULL;
by this:
p = mfree(p);
Change generated using coccinelle. Semantic patch is added to the
sources. |
023a4f67011f24d4b085995a4a3a02661c4794a2 |
|
24-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
core: optionally create LOGIN_PROCESS or USER_PROCESS utmp entries
When generating utmp/wtmp entries, optionally add both LOGIN_PROCESS and
INIT_PROCESS entries or even all three of LOGIN_PROCESS, INIT_PROCESS
and USER_PROCESS entries, instead of just a single INIT_PROCESS entry.
With this change systemd may be used to not only invoke a getty directly
in a SysV-compliant way but alternatively also a login(1) implementation
or even forego getty and login entirely, and invoke arbitrary shells in
a way that they appear in who(1) or w(1).
This is preparation for a later commit that adds a "machinectl shell"
operation to invoke a shell in a container, in a way that is compatible
with who(1) and w(1). |
6bfe5c28cad4716ed3ff6667c1546b5e180391fb |
|
06-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
execute: don't fail if we create the runtime directory from two processes simultaneously
If a service has both ExecStart= and ExecStartPost= set with
Type=simple, then it might happen that we have two children create the
runtime directory of a service (as configured with RuntimeDirectory=) at
the same time. Previously we did this with mkdir_safe() which will
create the dir only if it is missing, but if it already exists will at
least verify the access mode and ownership to match the right values.
This is problematic in this case, since it creates and then adjusts the
settings, thus it might happen that one child creates the directory with
root owner, another one then verifies it, and only afterwards the
directory ownership is fixed by the original child, while the second
child already failed.
With this change we'll now always adjust the access mode, so that we
know that it is right. In the worst case this means we adjust the
mode/ownership even though its unnecessary, but this should have no
negative effect.
https://bugzilla.redhat.com/show_bug.cgi?id=1226509 |
7d6884b65e6ea7317346d29bc2f6c9ba051a0cac |
|
06-Aug-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tree-wide: fix indentation |
e419a0e31089994ecd1d9019c791e63d13b37584 |
|
04-Aug-2015 |
WaLyong Cho <walyong.cho@samsung.com> |
core: set default process label only exec label is none
When command path has access label and no SmackProcessLabel= is not
set, default process label will be set. But if the default process
label has no rule for the access label of the command path then smack
access error will be occurred.
So, if the command path has execute label then the child have to set
its label to the same of execute label of command path instead of
default process label. |
ad118bda159d3f9c27c5a15ace54cf808a6e8788 |
|
07-Jul-2015 |
Daniel Mack <daniel@zonque.org> |
tree-wide: fix write_string_file() user that should not create files
The latest consolidation cleanup of write_string_file() revealed some users
of that helper which should have used write_string_file_no_create() in the
past but didn't. Basically, all existing users that write to files in /sys
and /proc should not expect to write to a file which is not yet existant. |
4c1fc3e404d648c70bd2f50ac50aeac6ece8872e |
|
07-Jul-2015 |
Daniel Mack <daniel@zonque.org> |
fileio: consolidate write_string_file*()
Merge write_string_file(), write_string_file_no_create() and
write_string_file_atomic() into write_string_file() and provide a flags mask
that allows combinations of atomic writing, newline appending and automatic
file creation. Change all users accordingly. |
e174dce27173396ed8034c9cfda87eb210365126 |
|
22-Jun-2015 |
WaLyong Cho <walyong.cho@samsung.com> |
smack: add default smack process label config
Similar to SmackProcessLabel=, if this configuration is set, systemd
executes processes with given SMACK label. If unit has
SmackProcessLabel=, this config is overwritten.
But, do NOT be confused with SMACK64EXEC of execute file. This default
execute process label(and also label which is set by
SmackProcessLabel=) is set fork-ed process SMACK subject label and
used to access the execute file.
If the execution file has also SMACK64EXEC, finally executed process
has SMACK64EXEC subject.
While if the execution file has no SMACK64EXEC, the executed process
has label of this config(or label which is set by
SmackProcessLabel=). Because if execution file has no SMACK64EXEC then
excuted process inherits label from caller process(in this case, the
caller is systemd). |
1b09f548c7f303b486b5b1321c06336bff72ada4 |
|
17-Jun-2015 |
Kay Sievers <kay@vrfy.org> |
turn kdbus support into a runtime option
./configure --enable/disable-kdbus can be used to set the default
behavior regarding kdbus.
If no kdbus kernel support is available, dbus-dameon will be used.
With --enable-kdbus, the kernel command line option "kdbus=0" can
be used to disable kdbus.
With --disable-kdbus, the kernel command line option "kdbus=1" is
required to enable kdbus support. |
d6e5f3ad1fdb7964d843c86f86d4ee7d806a0f93 |
|
17-Jun-2015 |
Daniel Mack <daniel@zonque.org> |
core: execute: fix regression in pam_setup()
Commit 72c0a2c25 ("everywhere: port everything to sigprocmask_many()
and friends") reworked code tree-wide to use the new sigprocmask_many()
helper. In this, it caused a regression in pam_setup, because it
dropped a line to initialize the 'ss' signal mask which is later used
in sigwait().
While at it, move the variable declaration to an inner scope. |
72c0a2c255b172ebbb2a2b7dab7c9aec4c9582d9 |
|
15-Jun-2015 |
Lennart Poettering <lennart@poettering.net> |
everywhere: port everything to sigprocmask_many() and friends
This ports a lot of manual code over to sigprocmask_many() and friends.
Also, we now consistly check for sigprocmask() failures with
assert_se(), since the call cannot realistically fail unless there's a
programming error.
Also encloses a few sd_event_add_signal() calls with (void) when we
ignore the return values for it knowingly. |
ce30c8dcb41dfe9264f79f30c7f51c0e74576638 |
|
10-Jun-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: whenever we fork off a foreign child process reset signal mask/handlers
Also, when the child is potentially long-running make sure to set a
death signal.
Also, ignore the result of the reset operations explicitly by casting
them to (void). |
24882e06c135584f16f31ba8a00fecde8b7f6fad |
|
29-May-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split out signal-util.[ch] from util.[ch]
No functional changes. |
050f727728f0631ce2b9c5f9635054480ccea3f6 |
|
21-May-2015 |
Lennart Poettering <lennart@poettering.net> |
util: introduce PERSONALITY_INVALID as macro for 0xffffffffLU |
ee818b89f4890b3a00e93772249fce810f60811e |
|
18-May-2015 |
Alban Crequy <alban@endocode.com> |
core: Private*/Protect* options with RootDirectory
When a service is chrooted with the option RootDirectory=/opt/..., then
the options PrivateDevices, PrivateTmp, ProtectHome, ProtectSystem must
mount the directories under $RootDirectory/{dev,tmp,home,usr,boot}.
The test-ns tool can test setup_namespace() with and without chroot:
$ sudo TEST_NS_PROJECTS=/home/lennart/projects ./test-ns
$ sudo TEST_NS_CHROOT=/home/alban/debian-tree TEST_NS_PROJECTS=/home/alban/debian-tree/home/alban/Documents ./test-ns |
8b44a3d22c1fdfc5ce5fcb77e38a90ec02ba8019 |
|
13-May-2015 |
Lennart Poettering <lennart@poettering.net> |
core: make exec code a bit more readable
Let's add a function that checks whether we need fs namespacing, to make
things easier to read, instead of using a humungous if expression... |
f2341e0a87cab1558c84c933956e9181d5fb6c52 |
|
11-May-2015 |
Lennart Poettering <lennart@poettering.net> |
core,network: major per-object logging rework
This changes log_unit_info() (and friends) to take a real Unit* object
insted of just a unit name as parameter. The call will now prefix all
logged messages with the unit name, thus allowing the unit name to be
dropped from the various passed romat strings, simplifying invocations
drastically, and unifying log output across messages. Also, UNIT= vs.
USER_UNIT= is now derived from the Manager object attached to the Unit
object, instead of getpid(). This has the benefit of correcting the
field for --test runs.
Also contains a couple of other logging improvements:
- Drops a couple of strerror() invocations in favour of using %m.
- Not only .mount units now warn if a symlinks exist for the mount
point already, .automount units do that too, now.
- A few invocations of log_struct() that didn't actually pass any
additional structured data have been replaced by simpler invocations
of log_unit_info() and friends.
- For structured data a new LOG_UNIT_MESSAGE() macro has been added,
that works like LOG_MESSAGE() but prefixes the message with the unit
name. Similar, there's now LOG_LINK_MESSAGE() and
LOG_NETDEV_MESSAGE().
- For structured data new LOG_UNIT_ID(), LOG_LINK_INTERFACE(),
LOG_NETDEV_INTERFACE() macros have been added that generate the
necessary per object fields. The old log_unit_struct() call has been
removed in favour of these new macros used in raw log_struct()
invocations. In addition to removing one more function call this
allows generated structured log messages that contain two object
fields, as necessary for example for network interfaces that are
joined into another network interface, and whose messages shall be
indexed by both.
- The LOG_ERRNO() macro has been removed, in favour of
log_struct_errno(). The latter has the benefit of ensuring that %m in
format strings is properly resolved to the specified error number.
- A number of logging messages have been converted to use
log_unit_info() instead of log_info()
- The client code in sysv-generator no longer #includes core code from
src/core/.
- log_unit_full_errno() has been removed, log_unit_full() instead takes
an errno now, too.
- log_unit_info(), log_link_info(), log_netdev_info() and friends, now
avoid double evaluation of their parameters |
dd305ec9c6c2ef6e0b5e43de388a98825385b359 |
|
28-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
core: when we cannot add PID to a scope cgroup, log about it
Also, place the scope unit in failed state. |
288a74cce597f81d3ba01d8a5ca7d2ba5b654b7e |
|
11-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add terminal-util.[ch] |
0b452006de98294d1690f045f6ea2f7f6630ec3b |
|
10-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add process-util.[ch] |
6482f6269c87d2249e52e889a63adbdd50f2d691 |
|
10-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add formats-util.h |
c6878637502b1717a110a9a7e8bba32a8583fcdf |
|
06-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
util: rework rm_rf() logic
- Move to its own file rm-rf.c
- Change parameters into a single flags parameter
- Remove "honour sticky" logic, it's unused these days |
cd972d6911b0e1403e0a11408be732fc3a513f2b |
|
14-Mar-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core: don't wait for reply if writing to pipe fails
This shouldn't really happen, but it's seems cleaner to
continue on error.
CID #1237552. |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use. |
ca905b2fce3831c48dcf10e7ada58282504dc988 |
|
14-Feb-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core: make RuntimeDirectory honor SELinux labels
https://bugzilla.redhat.com/show_bug.cgi?id=1192726 |
0a6f50c0afdfc434b492493bd9efab20cbee8623 |
|
12-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
include <poll.h> instead of <sys/poll.h>
include-what-you-use automatically does this and it makes finding
unnecessary harder to spot. The only content of poll.h is a include
of sys/poll.h so should be harmless. |
cf1d0302aeaf4e44a6a643fb41e5525fdd04b1d5 |
|
12-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
exec: also evaluate working_directory_missing_ok when not applying chroots |
4c08c8242a687e00b289e948ccd07b96f0bc4866 |
|
12-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
core: don't fail to run services in --user instances if $HOME is missing
Otherwise we cannot even invoke systemd-exit.service anymore, thus not
even exit.
https://bugs.freedesktop.org/show_bug.cgi?id=83100
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759320 |
e89fe484df6b94fcd775b923327b54eaf0a116e2 |
|
11-Feb-2015 |
Cristian RodrÃguez <crrodriguez@opensuse.org> |
core: remove unneeded <libgen.h> include
execute.c only uses basename (the GNU version in <string.h>) |
63c372cb9df3bee01e3bf8cd7f96f336bddda846 |
|
03-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
util: rework strappenda(), and rename it strjoina()
After all it is now much more like strjoin() than strappend(). At the
same time, add support for NULL sentinels, even if they are normally not
necessary. |
6cb7fa17b3d89741a5fd3ac807775a3022c7d891 |
|
13-Jan-2015 |
Martin Pitt <martin.pitt@ubuntu.com> |
core: Fix EACCES check for OOM adjustments
Commit 3bd5c3 added a check for EACCES, but missed the minus sign. |
ff0af2a1660bb122f29713c9b2aff8179f165bb7 |
|
09-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
core: modernize execution code a bit
Among other things, avoid log_struct() unless we really need it.
Also, use "r" as variable to store function errors in, instead of "err".
"r" is pretty much what we use everywhere else, hence using the same
here make sense.
FInally, in the child, when we want to log, make sure to open the
logging framework first, since it is explicitly closed in preparation
for the exec(). |
3bd5c32d939af0165a3aceff607101ba25efc2a0 |
|
08-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
core: check both EPERM and EACCES for OOM adjustments |
d5243d628624038567c576e9b69c1d775eb05a05 |
|
08-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
core: make EPERM errors when applying OOM adjustment for forked processes non-fatal
This should be useful for user namespaces. |
553d2243e2a42783b8bb94addfb752b802c23311 |
|
06-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tree-wide: remove unnecessary LOG_PRI
LOG_DEBUG is already a log level, there is no need to use LOG_PRI which
is for filtering out the facility. |
524daa8c3e2bd63ad9dbc24711cdcfb45a65b2db |
|
05-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: call connect() with dropped privileges
When systemd starts a service, it first opened /run/systemd/journal/stdout
socket, and only later switched to the right user.group (if they are
specified). Later on, journald looked at the credentials, and saw
root.root, because credentials are stored at the time the socket is
opened. As a result, all messages passed over _TRANSPORT=stdout were
logged with _UID=0, _GID=0.
Drop real uid and gid temporarily to fix the issue. |
039f0e70a0fcd71dcf7cc2f3ba2cea2e3b186a60 |
|
23-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
env-util: don't include files from src/core/ |
3c70e3bb022f0de3317f3600c9366a2f4597339e |
|
23-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
core: rearrange code so that libsystemd/sd-bus/ does not include header files from core
Stuff in src/shared or src/libsystemd should *never* include code from
src/core or any of the tools, so don't do that here either. It's not OK! |
24167f3db842238e4e9115db36eff947be46da5f |
|
19-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
execute: the runtime directory can only be on tmpfs, hence don't use rm_rf_dangerous() needlessly |
f1acf85a36f4c32d69511fe1bfa12f66e28fa80d |
|
19-Dec-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core: make exec_command_free_list return NULL |
ee33e53a70c0d3f9d8aeafe4b8fd84a0d5e1d8d9 |
|
11-Dec-2014 |
Torstein Husebø <torstein@huseboe.net> |
core: correct spacing near eol in code comments |
7b3fd6313c4b07b6f822a9f979d0c22350a401d9 |
|
10-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
scope: make attachment of initial PIDs a bit more robust |
2822da4fb7f891e5320f02f1d00f64b72221ced4 |
|
10-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
util: introduce our own gperf based capability list
This way, we can ensure we have a more complete, up-to-date list of
capabilities around, always. |
9008e1ac925afcdef7b45042c03fa5444f1c52c2 |
|
04-Dec-2014 |
Michal Sekletar <msekleta@redhat.com> |
selinux: figure out selinux context applied on exec() before closing all fds
We need original socket_fd around otherwise mac_selinux_get_child_mls_label
fails with -EINVAL return code. Also don't call setexeccon twice but rather pass
context value of SELinuxContext option as an extra argument. |
fed1e721fd0c81e60c77120539f34e16c2585634 |
|
28-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
treewide: introduce UID_INVALID (and friends) as macro for (uid_t) -1 |
56f64d95763a799ba4475daf44d8e9f72a1bd474 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.
Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'
Plus some whitespace, linewrap, and indent adjustments. |
31938a8560a664c32a9d72f1fc2d4347b232e6e9 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
core: convert log_unit_*() to log_unit_*_errno()
Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_unit_(debug|info|notice|warning|error|emergency)\(([^"]+), "(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_unit_\1_errno(\2, \5, "\3%m"\4);/' |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'
Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno(). |
e2cc6eca73cd1df8be552d7c23f9ff3d69c06f1e |
|
28-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
log: fix order of log_unit_struct() to match other logging calls
Also, while we are at it, introduce some syntactic sugar for creating
ERRNO= and MESSAGE= structured logging fields. |
79008bddf679a5e0900369950eb346c9fa687107 |
|
27-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
log: rearrange log function naming
- Rename log_meta() → log_internal(), to follow naming scheme of most
other log functions that are usually invoked through macros, but never
directly.
- Rename log_info_object() to log_object_info(), simply because the
object should be before any other parameters, to follow OO-style
programming style. |
2ca620c4ed28c01f285d869d0b22f22a360957da |
|
24-Nov-2014 |
WaLyong Cho <walyong.cho@samsung.com> |
smack: introduce new SmackProcessLabel option
In service file, if the file has some of special SMACK label in
ExecStart= and systemd has no permission for the special SMACK label
then permission error will occurred. To resolve this, systemd should
be able to set its SMACK label to something accessible of ExecStart=.
So introduce new SmackProcessLabel. If label is specified with
SmackProcessLabel= then the child systemd will set its label to
that. To successfully execute the ExecStart=, accessible label should
be specified with SmackProcessLabel=.
Additionally, by SMACK policy, if the file in ExecStart= has no
SMACK64EXEC then the executed process will have given label by
SmackProcessLabel=. But if the file has SMACK64EXEC then the
SMACK64EXEC label will be overridden.
[zj: reword man page] |
a931ad47a8623163a29d898224d8a8c1177ffdaf |
|
05-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
core: introduce new Delegate=yes/no property controlling creation of cgroup subhierarchies
For priviliged units this resource control property ensures that the
processes have all controllers systemd manages enabled.
For unpriviliged services (those with User= set) this ensures that
access rights to the service cgroup is granted to the user in question,
to create further subgroups. Note that this only applies to the
name=systemd hierarchy though, as access to other controllers is not
safe for unpriviliged processes.
Delegate=yes should be set for container scopes where a systemd instance
inside the container shall manage the hierarchies below its own cgroup
and have access to all controllers.
Delegate=yes should also be set for user@.service, so that systemd
--user can run, controlling its own cgroup tree.
This commit changes machined, systemd-nspawn@.service and user@.service
to set this boolean, in order to ensure that container management will
just work, and the user systemd instance can run fine. |
6baa7db00812437bbc87e73faa1a11b6cf631958 |
|
23-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
mac: also rename use_{smack,selinux,apparmor}() calls so that they share the new mac_{smack,selinux,apparmor}_xyz() convention |
cc56fafeebf814ef035e549115cf1850e6473fa5 |
|
23-Oct-2014 |
WaLyong Cho <walyong.cho@samsung.com> |
mac: rename apis with mac_{selinux/smack}_ prefix |
7491ccf2cb237a2a88b831b2c7374ba2bb255cba |
|
17-Oct-2014 |
Lukas Nykryn <lnykryn@redhat.com> |
environment: append unit_id to error messages regarding EnvironmentFile |
8fa6cbe1a9f3f3353224116772619a4d3eb26f88 |
|
17-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
execute: downgrade namespace error to "warning"
Also, extend the printed warning a bit, explaining the situation more
verbosely. |
0015ebf3fa524d414a947bdf0814782a8ee00799 |
|
17-Oct-2014 |
Michal Sekletar <msekleta@redhat.com> |
execute: don't fail child when we don't have privileges to setup namespaces
If we don't have privileges to setup the namespaces then we are most likely
running inside some sort of unprivileged container, hence not being able to
create namespace is not a problem because spawned service can't access host
system anyway. |
5482192e5774f52f2af0665a3b58539295e9c0a4 |
|
11-Oct-2014 |
Michael Scherer <misc@zarb.org> |
Report aa_change_onexec error code
Since aa_change_onexec return the error code in errno, and return
-1, the current code do not give any useful information when
something fail. This make apparmor easier to debug, as seen on
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760526 |
e63ff941eaa012ffd003e3791438c73b8a26227d |
|
30-Sep-2014 |
Tom Gundersen <teg@jklm.no> |
core: execute - don't leak strv |
86b23b07c96b185126bfbf217227dad362a20c25 |
|
29-Sep-2014 |
Jan Synacek <jsynacek@redhat.com> |
swap: introduce Discard property
Process possible "discard" values from /etc/fstab. |
16115b0a7b7cdf08fb38084d857d572d8a9088dc |
|
19-Sep-2014 |
Michal Sekletar <msekleta@redhat.com> |
socket: introduce SELinuxContextFromNet option
This makes possible to spawn service instances triggered by socket with
MLS/MCS SELinux labels which are created based on information provided by
connected peer.
Implementation of label_get_child_mls_label derived from xinetd.
Reviewed-by: Paul Moore <pmoore@redhat.com> |
822a59607c4974915db0644b627070f001986825 |
|
08-Sep-2014 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
execute: silence warnings
Mark two function parameters as const |
e44da745d19b9e02e67e32ea82c3bad86175120c |
|
08-Sep-2014 |
Daniel Mack <zonque@gmail.com> |
service: hook up custom endpoint logic
If BusPolicy= was passed, the parser function will have created
an ExecContext->bus_endpoint object, along with policy information.
In that case, create a kdbus endpoint, and pass its path name to the
namespace logic, to it will be mounted over the actual 'bus' node.
At endpoint creation time, no policy is updloaded. That is done after
fork(), through a separate call. This is necessary because we don't
know the real uid of the process earlier than that. |
a610cc4f18c24a007e5a2cac21b2ecbd81e5f3c3 |
|
08-Sep-2014 |
Daniel Mack <zonque@gmail.com> |
namespace: add support for custom kdbus endpoint
If a path to a previously created custom kdbus endpoint is passed in,
bind-mount a new devtmpfs that contains a 'bus' node, which in turn in
bind-mounted with the custom endpoint. This tmpfs then mounted over the
kdbus subtree that refers to the current bus.
This way, we can fake the bus node in order to lock down services with
a kdbus custom endpoint policy. |
bb7dd0b04a6e89674100476eed0bbd05c6a4cbd8 |
|
08-Sep-2014 |
Daniel Mack <zonque@gmail.com> |
bus: add kdbus endpoint types
Add types to describe endpoints and associated policy entries,
and add a BusEndpoint instace to ExecContext. |
d35fbf6bdf4377f3a15b084ff812b3ee272e5347 |
|
05-Sep-2014 |
Daniel Mack <zonque@gmail.com> |
exec: move code executed after fork into exec_child()
This factors out one conditional branch that has grown way too big, and
makes the code more readable by using return statements rather than jump
labels. |
9fa95f8539a380e93f760956bc6982e57f5bf3af |
|
05-Sep-2014 |
Daniel Mack <zonque@gmail.com> |
exec: factor out most function arguments of exec_spawn() to ExecParameters
This way, the list of arguments to that function gets more comprehensive,
and we can get around passing lots of NULL and 0 arguments from socket.c,
swap.c and mount.c.
It also allows for splitting up the code in exec_spawn().
While at it, make ExecContext const in execute.c. |
1b6d7fa742e303611dff8d7ebfa86ee5fb8b7dc7 |
|
26-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
util: make use of newly added reset_signal_mask() call wherever appropriate |
f461c8073dee9cd10bfae5ae3586e785ec8a5d07 |
|
21-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
execute: explain in a comment, why close_all_fds() is invoked the second time differently |
4c94096027f21d4ed0efe991534a926d39d52369 |
|
21-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
core: unify how we generate the prefix string when dumping unit state |
3bb07b7680c543c982077ac075abe8badeb46ca1 |
|
19-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
Revert "socket: introduce SELinuxLabelViaNet option"
This reverts commit cf8bd44339b00330fdbc91041d6731ba8aba9fec.
Needs more discussion on the mailing list. |
cf8bd44339b00330fdbc91041d6731ba8aba9fec |
|
19-Aug-2014 |
Michal Sekletar <msekleta@redhat.com> |
socket: introduce SELinuxLabelViaNet option
This makes possible to spawn service instances triggered by socket with
MLS/MCS SELinux labels which are created based on information provided by
connected peer.
Implementation of label_get_child_label derived from xinetd.
Reviewed-by: Paul Moore <pmoore@redhat.com> |
3a43da2832dc5360a638d043f469a6dcbe025582 |
|
29-Jul-2014 |
Kay Sievers <kay@vrfy.org> |
time-util: add and use USEC/NSEC_INFINIY |
418b9be50018303cde79b423d4701b7fd86ddbdc |
|
07-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
firstboot: add new component to query basic system settings on first boot, or when creating OS images offline
A new tool "systemd-firstboot" can be used either interactively on boot,
where it will query basic locale, timezone, hostname, root password
information and set it. Or it can be used non-interactively from the
command line when prepareing disk images for booting. When used
non-inertactively the tool can either copy settings from the host, or
take settings on the command line.
$ systemd-firstboot --root=/path/to/my/new/root --copy-locale --copy-root-password --hostname=waldi
The tool will be automatically invoked (interactively) now on first boot
if /etc is found unpopulated.
This also creates the infrastructure for generators to be notified via
an environment variable whether they are running on the first boot, or
not. |
717603e391b52983ca1fd218e7333a1b9dfc5c05 |
|
03-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
machinectl: show /etc/os-release information of container in status output |
e1d758033dc7e101ab32323a0f1649d8daf56a22 |
|
24-Jun-2014 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
use more _cleanup_ macro |
1b8689f94983b47bf190e77ddb03a8fc6af15fb3 |
|
04-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
core: rename ReadOnlySystem= to ProtectSystem= and add a third value for also mounting /etc read-only
Also, rename ProtectedHome= to ProtectHome=, to simplify things a bit.
With this in place we now have two neat options ProtectSystem= and
ProtectHome= for protecting the OS itself (and optionally its
configuration), and for protecting the user's data. |
417116f23432073162ebfcb286a7800846482eed |
|
03-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
core: add new ReadOnlySystem= and ProtectedHome= settings for service units
ReadOnlySystem= uses fs namespaces to mount /usr and /boot read-only for
a service.
ProtectedHome= uses fs namespaces to mount /home and /run/user
inaccessible or read-only for a service.
This patch also enables these settings for all our long-running services.
Together they should be good building block for a minimal service
sandbox, removing the ability for services to modify the operating
system or access the user's private data. |
de0671ee7fe465e108f62dcbbbe9366f81dd9e9a |
|
15-May-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Remove unnecessary casts in printfs
No functional change expected :) |
7f8aa67131cfc03ddcbd31c0420754864fc122f0 |
|
24-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
core: remove tcpwrap support
tcpwrap is legacy code, that is barely maintained upstream. It's APIs
are awful, and the feature set it exposes (such as DNS and IDENT
access control) questionnable. We should not support this natively in
systemd.
Hence, let's remove the code. If people want to continue making use of
this, they can do so by plugging in "tcpd" for the processes they start.
With that scheme things are as well or badly supported as they were from
traditional inetd, hence no functionality is really lost. |
3d94f76c99da13e5603831d0b278f8c8c21bcb02 |
|
24-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
util: replace close_pipe() with new safe_close_pair()
safe_close_pair() is more like safe_close(), except that it handles
pairs of fds, and doesn't make and misleading allusion, as it works
similarly well for socketpairs() as for pipe()s... |
03e334a1c7dc8c20c38902aa039440763acc9b17 |
|
18-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
util: replace close_nointr_nofail() by a more useful safe_close()
safe_close() automatically becomes a NOP when a negative fd is passed,
and returns -1 unconditionally. This makes it easy to write lines like
this:
fd = safe_close(fd);
Which will close an fd if it is open, and reset the fd variable
correctly.
By making use of this new scheme we can drop a > 200 lines of code that
was required to test for non-negative fds or to reset the closed fd
variable afterwards. |
517d56b1d0f67dcf76710bc1e17b05518b8cabe6 |
|
05-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
missing: if RLIMIT_RTTIME is not defined by the libc, then we need a new define for the max number of rlimits, too |
e66cf1a3f94fff48a572f6dbd19b43c9bcf7b8c7 |
|
03-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
core: introduce new RuntimeDirectory= and RuntimeDirectoryMode= unit settings
As discussed on the ML these are useful to manage runtime directories
below /run for services. |
98b47d54ce946ad3524f84eb38d2413498a333dc |
|
03-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
execute: free directory path if we fail to remove it because we cannot allocate a thread |
f513e420c8b1a1d4c13092cd378f048b69793497 |
|
26-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
exec: imply NoNewPriviliges= only when seccomp filters are used in user mode |
4298d0b5128326621c8f537107c4c8b459490721 |
|
26-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
core: add new RestrictAddressFamilies= switch
This new unit settings allows restricting which address families are
available to processes. This is an effective way to minimize the attack
surface of services, by turning off entire network stacks for them.
This is based on seccomp, and does not work on x86-32, since seccomp
cannot filter socketcall() syscalls on that platform. |
7c66bae2ff5cb674612f84637cb98f9478ed26a8 |
|
26-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
seccomp: we should control NO_NEW_PRIVS on our own, not let seccomp do this for us |
eef65bf3ee6f73afa4a5de23ae3a794a279f30c0 |
|
21-Feb-2014 |
Michael Scherer <misc@zarb.org> |
core: Add AppArmor profile switching
This permit to switch to a specific apparmor profile when starting a daemon. This
will result in a non operation if apparmor is disabled.
It also add a new build requirement on libapparmor for using this feature. |
1756a0118ea1ab25fd46c853e89853c7e4b3038c |
|
19-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
execute: modernizations |
ac45f971a12280de55b834a65237f72dcacfc099 |
|
19-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
core: add Personality= option for units to set the personality for spawned processes |
e9642be2cce7f5e90406980092a6f71f504a16af |
|
18-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
seccomp: add helper call to add all secondary archs to a seccomp filter
And make use of it where appropriate for executing services and for
nspawn. |
5f8640fb628cb034981e02d741fd9ddf26fdf38d |
|
17-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
core: store and expose SELinuxContext field normalized as bool + string |
57183d117a1d6a96d71ce99d648beb0d2b36228d |
|
13-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
core: add SystemCallArchitectures= unit setting to allow disabling of non-native
architecture support for system calls
Also, turn system call filter bus properties into complex types instead
of concatenated strings. |
351a19b17d51ba0a5737f35d3c5deb8e7975fdee |
|
12-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
core: fix build without libseccomp |
17df7223be064b1542dbe868e3b35cca977ee639 |
|
12-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
core: rework syscall filter
- Allow configuration of an errno error to return from blacklisted
syscalls, instead of immediately terminating a process.
- Fix parsing logic when libseccomp support is turned off
- Only keep the actual syscall set in the ExecContext, and generate the
string version only on demand. |
c0467cf387548dc98c0254f63553d862b35a84e5 |
|
12-Feb-2014 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
syscallfilter: port to libseccomp |
82adf6af7c72b852449346835f33184a841b4796 |
|
10-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
nspawn,man: use a common vocabulary when referring to selinux security contexts
Let's always call the security labels the same way:
SMACK: "Smack Label"
SELINUX: "SELinux Security Context"
And the low-level encapsulation is called "seclabel". Now let's hope we
stick to this vocabulary in future, too, and don't mix "label"s and
"security contexts" and so on wildly. |
0d3f7bb3a5bc6d5c0712f88a080fed388981bca3 |
|
10-Feb-2014 |
Michael Scherer <misc@zarb.org> |
exec: Add support for ignoring errors on SELinuxContext by prefixing it with -, like for others settings.
Also remove call to security_check_context, as this doesn't serve anything, since
setexeccon will fail anyway. |
5c56a259e07661a66e806cc2fbc71de96a75f78e |
|
10-Feb-2014 |
Michael Scherer <misc@zarb.org> |
exec: Ignore the setting SELinuxContext if selinux is not enabled |
7b52a628f8b43ba521c302a7f32bccf9d0dc8bfd |
|
10-Feb-2014 |
Michael Scherer <misc@zarb.org> |
exec: Add SELinuxContext configuration item
This permit to let system administrators decide of the domain of a service.
This can be used with templated units to have each service in a différent
domain ( for example, a per customer database, using MLS or anything ),
or can be used to force a non selinux enabled system (jvm, erlang, etc)
to start in a different domain for each service. |
7f112f50fea585411ea2d493b3582bea77eb4d6e |
|
20-Jan-2014 |
Lennart Poettering <lennart@poettering.net> |
exec: introduce PrivateDevices= switch to provide services with a private /dev
Similar to PrivateNetwork=, PrivateTmp= introduce PrivateDevices= that
sets up a private /dev with only the API pseudo-devices like /dev/null,
/dev/zero, /dev/random, but not any physical devices in them. |
5ce70e5bcd62e89b52485961c3699312ee4a7e0e |
|
03-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Introduce cleanup functions for cap_free
Unfortunately a different cleanup function is necessary per type,
because cap_t** and char** are incompatible with void**. |
ccd06097c79218f7d5ea4c21721bbcbc7c467dca |
|
03-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Use format patterns for usec_t, pid_t, nsec_t, usec_t
It is nicer to predefine patterns using configure time check instead of
using casts everywhere.
Since we do not need to use any flags, include "%" in the format instead
of excluding it like PRI* macros. |
f146f5e159445c4fc7e89fe19ee2b8d72fc19ed7 |
|
30-Dec-2013 |
Stefan Beller <stefanbeller@googlemail.com> |
core: Forgot to dereference pointer when checking for NULL
Actually we already checked for !rt before, now we'd like to examine
the return value of the memory allocation. |
43a99a7afe3063eebc901452026b13360b69a7b5 |
|
25-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
build-sys: minor fixes found with cppcheck |
09812eb764b440651f3ff4cb5d37bd343f800560 |
|
22-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
sd-daemon: introduce sd_watchdog_enabled() for parsing $WATCHDOG_USEC
Also, introduce a new environment variable named $WATCHDOG_PID which
cotnains the PID of the process that is supposed to send the keep-alive
events. This is similar how $LISTEN_FDS and $LISTEN_PID work together,
and protects against confusing processes further down the process tree
due to inherited environment. |
7cae38c4fa51a56cd13ff028278efe7fae3c222c |
|
18-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
execute: set TERM even if we don't open the tty on our own
This way, when a tty path is configured TERM is set, which is nice to
set a useful term for gettys. |
531dca789ea6b4c269ca2646515b42962f83d64a |
|
16-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
execute: also set SO_SNDBUF when spawning a service with stdout/stderr connected to journald |
2b6bf07dd23bb467099d213c97b3875c5e453491 |
|
07-Dec-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Get rid of our reimplementation of basename
The only problem is that libgen.h #defines basename to point to it's
own broken implementation instead of the GNU one. This can be fixed
by #undefining basename. |
613b411c947635136637f8cdd66b94512f761eab |
|
27-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
service: add the ability for units to join other unit's PrivateNetwork= and PrivateTmp= namespaces |
9588bc32096fc8342bfd8b989689717186d7d86e |
|
08-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
Remove dead code and unexport some calls
"make check-api-unused" informs us about code that is not used anymore
or that is exported but only used internally. Fix these all over the
place. |
250a918dc4c8a15d927deecc3b3f6a0604657ae4 |
|
29-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
strv: introduce new strv_from_stdarg_alloca() macro to generate a string array from stdarg function parameters
This allows us to turn lists of strings passed in easily into string
arrays without having to allocate memory. |
d8c9d3a468e61ee2a2b2c3454e662398b0885411 |
|
23-Oct-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
systemd: use unit name in PrivateTmp directories
Unit name is used whole in the directory name, so that the unit name
can be easily extracted from it, e.g. "/tmp/systemd-abcd.service-DEDBIF1".
https://bugzilla.redhat.com/show_bug.cgi?id=957439 |
44b601bc79e46722bc0f0862ee0ce34a2284ef11 |
|
16-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
macro: clean up usage of gcc attributes
Always use our own macros, and name all our own macros the same style. |
71fda00f320379f5cbee8e118848de98caaa229d |
|
14-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
list: make our list macros a bit easier to use by not requring type spec on each invocation
We can determine the list entry type via the typeof() gcc construct, and
so we should to make the macros much shorter to use. |
970edce6efcd3a0cf284aa0f43e0b27ecbd415f5 |
|
04-Oct-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
execute: more debugging messages |
59fccd82117cf9a84454f41867a882f872916dc5 |
|
02-Oct-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
execute.c: always set $SHELL
In e6dca81 $SHELL was added to user@.service. Let's
instead provide it to all units which have a user. |
f546241b6dd82d20ff915f618d143a19db8a4574 |
|
26-Sep-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
execute.c: little modernization |
13b84ec7df103ce388910a2b868fe1668c1e27ef |
|
25-Sep-2013 |
Lennart Poettering <lennart@poettering.net> |
cgroup: if we do a cgroup operation then do something on all supported controllers
Previously we did operations like attach, trim or migrate only on the
controllers that were enabled for a specific unit. With this changes we
will now do them for all supproted controllers, and fall back to all
possible prefix paths if the specified paths do not exist.
This fixes issues if a controller is being disabled for a unit where it
was previously enabled, and makes sure that all processes stay as "far
down" the tree as groups exist. |
f485606bf8957d2954cf6fa5b0aabd5c39db15c1 |
|
17-Sep-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Make tmpdir removal asynchronous
https://bugs.freedesktop.org/show_bug.cgi?id=68232 |
31a7eb86f18b0466681d6fbe80c148f96c551c80 |
|
16-Jul-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
systemd: do not output status messages once gettys are running
Make Type=idle communication bidirectional: when bootup is finished,
the manager, as before, signals idling Type=idle jobs to continue.
However, if the boot takes too long, idling jobs signal the manager
that they have had enough, wait a tiny bit more, and continue, taking
ownership of the console. The manager, when signalled that Type=idle
jobs are done, makes a note and will not write to the console anymore.
This is a cosmetic issue, but quite noticable, so let's just fix it.
Based on Harald Hoyer's patch.
https://bugs.freedesktop.org/show_bug.cgi?id=54247
http://unix.stackexchange.com/questions/51805/systemd-messages-after-starting-login/ |
8aa75193662d0e18d7c21ee9d546b7f3c8b8bc14 |
|
11-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
core: grant user@.service instances write access to their own cgroup |
e9c1ea9de87d4d508ac38ce87a2fa56e7529a91a |
|
03-Jul-2013 |
Jason St. John <jstjohn@purdue.edu> |
replace tabs with spaces in various files
The affected files in this patch had inconsistent use of tabs vs. spaces
for indentation, and this patch eliminates the stray tabs.
Also, the opening brace of sigchld_hdl() in activate.c was moved so the
opening braces are consistent throughout the file. |
4ad490007b70e6ac18d3cb04fa2ed92eba1451fa |
|
27-Jun-2013 |
Lennart Poettering <lennart@poettering.net> |
core: general cgroup rework
Replace the very generic cgroup hookup with a much simpler one. With
this change only the high-level cgroup settings remain, the ability to
set arbitrary cgroup attributes is removed, so is support for adding
units to arbitrary cgroup controllers or setting arbitrary paths for
them (especially paths that are different for the various controllers).
This also introduces a new -.slice root slice, that is the parent of
system.slice and friends. This enables easy admin configuration of
root-level cgrouo properties.
This replaces DeviceDeny= by DevicePolicy=, and implicitly adds in
/dev/null, /dev/zero and friends if DeviceAllow= is used (unless this is
turned off by DevicePolicy=). |
507f22bd0172bff5e5d98145b1419bd472a2c57f |
|
10-Jun-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Use stdint.h macros instead of casts to print uint64_t values
Casts are visually heavy, and can obscure unwanted truncations. |
44a6b1b68029833893f6e9cee35aa27a974038f6 |
|
03-May-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add __attribute__((const, pure, format)) in various places
I'm assuming that it's fine if a _const_ or _pure_ function
calls assert. It is assumed that the assert won't trigger,
and even if it does, it can only trigger on the first call
with a given set of parameters, and we don't care if the
compiler moves the order of calls. |
7fd1b19bc9e9f5574f2877936b8ac267c7706947 |
|
18-Apr-2013 |
Harald Hoyer <harald@redhat.com> |
move _cleanup_ attribute in front of the type
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html |
5521d6985648669a65d0529bb01c7a32edc99294 |
|
18-Apr-2013 |
Harald Hoyer <harald@redhat.com> |
core/execute: only clean the environment, if we have one |
099a804b11072b6be9fd32b3aa1f90b393adef98 |
|
18-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
execute: always add in EXECUTABLE= field when we log something about execution |
ebc05a09ad6d1672cf4f426ee4252cf495daa139 |
|
17-Apr-2013 |
Harald Hoyer <harald@redhat.com> |
core/execute: report invalid environment variables from files
Because "export key=val" is not supported by systemd, an error is logged
where the invalid assignment is coming from.
Introduce strv_env_clean_log() to log invalid environment assignments,
where logging is possible and allowed.
parse_env_file_internal() is modified to allow WHITESPACE in keys, to
report the issues later on. |
03bb799e0b3560dca8c9b70de3dbadb0c281b36f |
|
17-Apr-2013 |
Harald Hoyer <harald@redhat.com> |
core/execute.c: debug log final execve() with argv[]
https://bugzilla.redhat.com/show_bug.cgi?id=772073 |
2d76d14ea3682c1c144001449654eb0c6bbda08d |
|
08-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
cgroup: clean-ups |
974efc46586854b1f23ccf153b36199c77919de6 |
|
08-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
cgroup: always keep access mode of 'tasks' and 'cgroup.procs' files in cgroup directories in sync |
c84a94883161073239c35d181e25823ff0454f68 |
|
06-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add _cleanup_globfree_
Fixes a memleak in error path in exec_context_load_environment. |
b92bea5d2a9481de69bb627a7b442a9f58fca43d |
|
06-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Use initalization instead of explicit zeroing
Before, we would initialize many fields twice: first
by filling the structure with zeros, and then a second
time with the real values. We can let the compiler do
the job for us, avoiding one copy.
A downside of this patch is that text gets slightly
bigger. This is because all zero() calls are effectively
inlined:
$ size build/.libs/systemd
text data bss dec hex filename
before 897737 107300 2560 1007597 f5fed build/.libs/systemd
after 897873 107300 2560 1007733 f6075 build/.libs/systemd
… actually less than 1‰.
A few asserts that the parameter is not null had to be removed. I
don't think this changes much, because first, it is quite unlikely
for the assert to fail, and second, an immediate SEGV is almost as
good as an assert. |
f73141d7657b3f60b8669bc8386413d8a8a372c6 |
|
03-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
shared: rework env file reader
Implement this with a proper state machine, so that newlines and
escaped chars can appear in string assignments. This should bring the
parser much closer to shell. |
574d5f2dfc25226afc718aa5ba1a145fe5cad221 |
|
03-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
util: rename write_one_line_file() to write_string_file()
You can write much more than just one line with this call (and we
frequently do), so let's correct the naming. |
e62d8c3944745ed276e6d4f33153009860e5cfc5 |
|
31-Mar-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Modernization
Use _cleanup_ and wrap lines to ~80 chars and such. |
cbb21cca098f9063b0ff5548b2c73ab517f55ea5 |
|
31-Mar-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
execute: convert secure bits into mask properly
C.f. http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=5975c725dfd6f7d36f493ab1453fbdbd35c1f0e3 |
ebf4fb3d368732d9f41cb40e3084182c04e731b2 |
|
27-Mar-2013 |
Václav PavlÃn < <vpavlin@redhat.com> |
core: check return value of rm_rf_dangerous and warn if it fails |
d34cd374905a40e65769351a2808b741b5418bf1 |
|
20-Mar-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Make PrivateTmp dirs also inaccessible from the outside
Currently, PrivateTmp=yes means that the service cannot see the /tmp
shared by rest of the system and is isolated from other services using
PrivateTmp, but users can access and modify /tmp as seen by the
service.
Move the private /tmp and /var/tmp directories into a 0077-mode
directory. This way unpriviledged users on the system cannot see (or
modify) /tmp as seen by the service. |
c17ec25e4d9bd6c8e8617416f813e25b2ebbafc5 |
|
16-Mar-2013 |
Michal Sekletar <msekleta@redhat.com> |
core: reuse the same /tmp, /var/tmp and inaccessible dir
All Execs within the service, will get mounted the same
/tmp and /var/tmp directories, if service is configured with
PrivateTmp=yes. Temporary directories are cleaned up by service
itself in addition to systemd-tmpfiles. Directory which is mounted
as inaccessible is created at runtime in /run/systemd. |
6ac8fdc9554a40024827ad9f64d02b4d8d2ab8ba |
|
28-Feb-2013 |
Michal Schmidt <mschmidt@redhat.com> |
core/execute: determine if ExecContext may fiddle with /dev/console
There is some guesswork, but it should work satisfactorily for the
purpose of knowing when to suppress printing of status messages. |
3a1286b66883ef2cf577b29364e4b5fd43a295c8 |
|
28-Feb-2013 |
Michal Schmidt <mschmidt@redhat.com> |
core/execute: add internal is_terminal_output()
Similar to already existing is_terminal_input().
Note that the only current user (connect_logger_as) is never called
for EXEC_OUTPUT_TTY, so it won't mind whether we accept it. |
80cbda3558c534b575bf5315fa53b0f82dc088ab |
|
16-Feb-2013 |
Michal Schmidt <mschmidt@redhat.com> |
execute: increase severity of journal connect failure message
journald is supposed to work. Failure to connect to its socket implies
losing messages. It should be a very unusual event. Log the failure with
LOG_CRIT.
Just because this unit's stdout/stderr failed to connect to the journal
does not necessarily mean that we shouldn't try to log the failure using
a structured entry, so let's use log_struct_unit. |
eb17e935988993f4e0ebe08be81150ce35b140bf |
|
16-Feb-2013 |
Michal Schmidt <mschmidt@redhat.com> |
execute: unify setup_{output,error}
The functions are quite similar. Unify them into one.
The source gets shorter, the binary gets slightly smaller. |
47c1d80d844689c81faf2eede95803c1ed6eb4af |
|
16-Feb-2013 |
Michal Schmidt <mschmidt@redhat.com> |
execute: robustness against journald failures
Almost every unit logs to the journal. If journald gets a permanent
failure, units would not be able to start (exit code 209/STDOUT).
Add a fallback to /dev/null to avoid making the system entirely
unusable in such a case. |
a5c32cff1f56afe6f0c6c70d91a88a7a8238b2d7 |
|
14-Feb-2013 |
Harald Hoyer <harald@redhat.com> |
honor SELinux labels, when creating and writing config files
Also split out some fileio functions to fileio.c and provide a SELinux
aware pendant in fileio-label.c
see https://bugzilla.redhat.com/show_bug.cgi?id=881577 |
4d1a69043862ed979642f5688097160355d4cc81 |
|
11-Feb-2013 |
Lennart Poettering <lennart@poettering.net> |
env: considerably beef up environment cleaning logic
Now, actually check if the environment variable names and values used
are valid, before accepting them. With this in place are at some places
more rigid than POSIX, and less rigid at others. For example, this code
allows lower-case environment variables (which POSIX suggests not to
use), but it will not allow non-UTF8 variable values.
All in all this should be a good middle ground of what to allow and what
not to allow as environment variables.
(This also splits out all environment related calls into env-util.[ch]) |
843fc7f7f26a6507fe896a79ed1b474c35c4300f |
|
19-Jan-2013 |
Jonathan Callen <abcd@gentoo.org> |
execute: Fix seccomp support on x32
In the x32 ABI, syscall numbers start at 0x40000000. Mask that bit on
x32 for lookups in the syscall_names array and syscall_filter and ensure
that syscall.h is parsed correctly.
[zj: added SYSCALL_TO_INDEX, INDEX_TO_SYSCALL macros.] |
bbc9006e6b5665073149331d75c104a33224dc19 |
|
18-Jan-2013 |
Mirco Tischler <mt-ml@gmx.de> |
core: log USER_UNIT instead of UNIT if in user session |
b929bf049d33823dedb1ab2e2ac688cd341792fb |
|
09-Jan-2013 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tabs to spaces
Skipped bootchart and various files that looked like they should be
kept in sync with external sources. |
2bef10ab3648db144c421f7765d20dbdf1afe074 |
|
04-Jan-2013 |
Pekka Lundstrom <pekka.lundstrom@jollamobile.com> |
Added globbing support to EnvironmentFile
This patch allows globbing to be used with EnvironmentFile option.
Example:
EnvironmentFile=/etc/foo.d/*.conf
t. Pekka |
20ad4cfd8e5592f634f20468798cbc1055ab9faf |
|
05-Dec-2012 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core: add catalog entry and MESSAGE_ID for overmounting |
f8b69d1dfc307562a353f6aa923b7c2b915aaddb |
|
30-Oct-2012 |
Michal Schmidt <mschmidt@redhat.com> |
shared, core: do not always accept numbers in string lookups
The behaviour of the common name##_from_string conversion is surprising.
It accepts not only the strings from name##_table but also any number
that falls within the range of the table. The order of items in most of
our tables is an internal affair. It should not be visible to the user.
I know of a case where the surprising numeric conversion leads to a crash.
We will allow the direct numeric conversion only for the tables where the
mapping of strings to numeric values has an external meaning. This holds
for the following lookup tables:
- netlink_family, ioprio_class, ip_tos, sched_policy - their numeric
values are stable as they are defined by the Linux kernel interface.
- log_level, log_facility_unshifted - the well-known syslog interface.
We allow the user to use numeric values whose string names systemd does
not know. For instance, the user may want to test a new kernel featuring
a scheduling policy that did not exist when his systemd version was
released. A slightly unpleasant effect of this is that the
name##_to_string conversion cannot return pointers to constant strings
anymore. The strings have to be allocated on demand and freed by the
caller. |
23635a8547eac0c05922609f5930badc86faf080 |
|
18-Oct-2012 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
systemd: use structured logging for unit changes
Information which unit a log entry pertains to enables systemctl
status to display more log messages. |
b66871dad9ae24a1249fe31b58b239640dd6271c |
|
18-Oct-2012 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core/execute: use cleanup_strv_free |
b7848021c3b058086243071b122077fc4fa1106e |
|
18-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
execute: apply PAM logic only to main process if PermissionsStartOnly is set
https://bugs.freedesktop.org/show_bug.cgi?id=54176 |
ac0930c892bc7979b4c9bc2a52e5e844650b025d |
|
13-Aug-2012 |
Lennart Poettering <lennart@poettering.net> |
namespace: rework namespace support
- don't use pivot_root() anymore, just reuse root hierarchy
- first create all mounts, then mark them read-only so that we get the
right behaviour when people want writable mounts inside of
read-only mounts
- don't pass invalid combinations of MS_ constants to the kernel |
4819ff0358b6317c195fd4b1768e03d09c871070 |
|
20-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
unit: split off KillContext from ExecContext containing only kill definitions |
b9a0e0106833ac595f860897038953c3e39cd355 |
|
17-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
execute: free syscall filter array after use |
8351ceaea9480d9c2979aa2ff0f4982cfdfef58d |
|
17-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
execute: support syscall filtering using seccomp filters |
d05c5031ad4c528fe6bbfed289519edb9f13180a |
|
16-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
unit: introduce %s specifier for the user shell |
af6da548aa14c57da7f17b3a1f2211efdb811d19 |
|
26-Jun-2012 |
Lennart Poettering <lennart@poettering.net> |
core: make systemd.confirm_spawn=1 actually work
This adds a timeout if the TTY cannot be acquired and makes sure we
always output the question to the console, never to the TTY of the
respective service. |
62bca2c657bf95fd1f69935eef09915afa5c69d9 |
|
22-Jun-2012 |
Eelco Dolstra <eelco.dolstra@logicblox.com> |
journal: set the _SYSTEMD_UNIT field for messages from terminated processes
As described in
https://bugs.freedesktop.org/show_bug.cgi?id=50184
the journal currently doesn't set fields such as _SYSTEMD_UNIT
properly for messages coming from processes that have already
terminated. This means among other things that "systemctl status" may
not show some of the output of services that wrote messages just
before they exited.
This patch fixes this by having processes that log to the journal
write their unit identifier to journald when the connection to
/run/systemd/journal/stdout is opened. Journald stores the unit ID
and uses it to fill in _SYSTEMD_UNIT when it cannot be obtained
normally (i.e. from the cgroup). To prevent impersonating another
unit, this information is only used when the caller is root.
This doesn't fix the general problem of getting metadata about
messages from terminated processes (which requires some kernel
support), but it allows "systemctl status" and similar queries to do
the Right Thing for units that log via stdout/stderr. |
f96096dbbf0cc7335babf0386b8888431cd70728 |
|
04-Jun-2012 |
Kay Sievers <kay@vrfy.org> |
silence gcc warning on 32 bit |
8600c525cb1420570e7670c963abd19c5696b683 |
|
04-Jun-2012 |
Kay Sievers <kay@vrfy.org> |
remove support for deprecated /proc/self/oom_adj |
d88a251b125f6e9178b9ca9ea47ab7da3234cb58 |
|
31-May-2012 |
Lennart Poettering <lennart@poettering.net> |
util: introduce a proper nsec_t and make use of it where appropriate |
ec8927ca5940e809f0b72f530582c76f1db4f065 |
|
24-May-2012 |
Lennart Poettering <lennart@poettering.net> |
main: add configuration option to alter capability bounding set for PID 1
This also ensures that caps dropped from the bounding set are also
dropped from the inheritable set, to be extra-secure. Usually that should
change very little though as the inheritable set is empty for all our uses
anyway. |
e056b01d8acea7fc06d52ef91d227d744faf5259 |
|
24-May-2012 |
Lennart Poettering <lennart@poettering.net> |
service: for Type=idle units consider START_PRE, START, START_POST all as ACTIVE
We want to avoid a deadlock when a service has ExecStartPre= programs
that wait for the job queue to run empty because of Type=idle, but which
themselves keep the queue non-empty because START_PRE was considered
ACTIVATING and hence the job not complete. With this patch we alter the
state translation table so that it is impossible ever to wait for
Type=idle unit, hence removing the deadlock. |
e6a2674500dd4fa0b5eaa93ab77502ba14688c08 |
|
22-May-2012 |
Lennart Poettering <lennart@poettering.net> |
execute: use a much lower idle timeout that default time
The idle timeout after all is for cosmetics only, hence avoid any
substantial delays just for it. |
940c5210344e90428287e4f8878a9064e8869e22 |
|
21-May-2012 |
Auke Kok <auke-jan.h.kok@intel.com> |
sd-pam: Drop uid so parent signal arrives at child.
The PAM helper thread needs to capture the death signal from the
parent, but is prohibited from doing so since when the child dies
as normal user, the kernel won't allow it to send a TERM to the
PAM helper thread which is running as root.
This causes the PAM threads to never exit, accumulating after
user sessions exit.
There is however really no need to keep the PAM threads running as
root, so, we can just setresuid() to the same user as defined in the
unit file for the parent thread (User=). This makes the TERM signal
arrive as normal. In case setresuid() fails, we ignore the error, so
we at least fall back to the current behaviour. |
9eb977db5b89b44f254ab40c1876a76b7d7ea2d0 |
|
08-May-2012 |
Kay Sievers <kay@vrfy.org> |
util: split-out path-util.[ch] |
f2b6878955b1f77ea1fa87b502b13d5dbefc57f6 |
|
24-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
service: introduce Type=idle and use it for gettys
Type=idle is much like Type=simple, however between the fork() and the
exec() in the child we wait until PID 1 informs us that no jobs are
left.
This is mostly a cosmetic fix to make gettys appear only after all boot
output is finished and complete.
Note that this does not impact the normal job logic as we do not delay
the completion of any jobs. We just delay the invocation of the actual
binary, and only for services that otherwise would be of Type=simple. |
ecedd90fcdf647f9a7b56b4934b65e30b2979b04 |
|
13-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
service: place control command in subcgroup control/
Previously, we were brutally and onconditionally killing all processes
in a service's cgroup before starting the service anew, in order to
ensure that StartPre lines cannot be misused to spawn long-running
processes.
On logind-less systems this has the effect that restarting sshd
necessarily calls all active ssh sessions, which is usually not
desirable.
With this patch control processes for a service are placed in a
sub-cgroup called "control/". When starting a service anew we simply
kill this cgroup, but not the main cgroup, in order to avoid killing any
long-running non-control processes from previous runs.
https://bugzilla.redhat.com/show_bug.cgi?id=805942 |
68faf98ca09314b61314ad2ac0cc133c400a83f9 |
|
12-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
execute: when we can't get the requested rlimit, get the next closest |
5430f7f2bc7330f3088b894166bf3524a067e3d8 |
|
12-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
relicense to LGPLv2.1 (with exceptions)
We finally got the OK from all contributors with non-trivial commits to
relicense systemd from GPL2+ to LGPL2.1+.
Some udev bits continue to be GPL2+ for now, but we are looking into
relicensing them too, to allow free copy/paste of all code within
systemd.
The bits that used to be MIT continue to be MIT.
The big benefit of the relicensing is that closed source code may now
link against libsystemd-login.so and friends. |
b30e2f4c18ad81b04e4314fd191a5d458553773c |
|
11-Apr-2012 |
Kay Sievers <kay@vrfy.org> |
move libsystemd_core.la sources into core/ |