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. |
6bf0f408e4833152197fb38fb10a9989c89f3a59 |
|
10-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
core: make the StartLimitXYZ= settings generic and apply to any kind of unit, not just services
This moves the StartLimitBurst=, StartLimitInterval=, StartLimitAction=, RebootArgument= from the [Service] section
into the [Unit] section of unit files, and thus support it in all unit types, not just in services.
This way we can enforce the start limit much earlier, in particular before testing the unit conditions, so that
repeated start-up failure due to failed conditions is also considered for the start limit logic.
For compatibility the four options may also be configured in the [Service] section still, but we only document them in
their new section [Unit].
This also renamed the socket unit failure code "service-failed-permanent" into "service-start-limit-hit" to express
more clearly what it is about, after all it's only triggered through the start limit being hit.
Finally, the code in busname_trigger_notify() and socket_trigger_notify() is altered to become more alike.
Fixes: #2467 |
7a7821c878a6ddfb2e79268bb1cd8f7662a9b8f8 |
|
04-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
core: rework job_get_timeout() to use usec_t and handle USEC_INFINITY time events correctly |
36c16a7cdd6c33d7980efc2cd6a2211941f302b4 |
|
01-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
core: rework unit timeout handling, and add new setting RuntimeMaxSec=
This clean-ups timeout handling in PID 1. Specifically, instead of storing 0 in internal timeout variables as
indication for a disabled timeout, use USEC_INFINITY which is in-line with how we do this in the rest of our code
(following the logic that 0 means "no", and USEC_INFINITY means "never").
This also replace all usec_t additions with invocations to usec_add(), so that USEC_INFINITY is properly propagated,
and sd-event considers it has indication for turning off the event source.
This also alters the deserialization of the units to restart timeouts from the time they were originally started from.
Before this patch timeouts would be restarted beginning with the time of the deserialization, which could lead to
artificially prolonged timeouts if a daemon reload took place.
Finally, a new RuntimeMaxSec= setting is introduced for service units, that specifies a maximum runtime after which a
specific service is forcibly terminated. This is useful to put time limits on time-intensive processing jobs.
This also simplifies the various xyz_spawn() calls of the various types in that explicit distruction of the timers is
removed, as that is done anyway by the state change handlers, and a state change is always done when the xyz_spawn()
calls fail.
Fixes: #2249 |
62bc4efc7a617791d43f4e6cbef857554e6dbe2e |
|
30-Dec-2015 |
Susant Sahani <ssahani@gmail.com> |
core: socket options fix SCTP_NODELAY
SCTP_NODELAY is diffrent to TCP_NODELAY.
Apply proper options in case of SCTP. |
0a78712e819f2db29809ec752bf96c2c1012a181 |
|
22-Dec-2015 |
Daniel Mack <daniel@zonque.org> |
socket: nullify pointers after free
A socket shouldn't be used after socket_done() returns, but follow the
general guideline here and avoid dangling pointers anyway. |
a97b23d65a1800876a58235966f04e02f16f7f4d |
|
22-Dec-2015 |
Daniel Mack <daniel@zonque.org> |
socket: free fdname member
Plug a small memory leak. |
4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.
With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.
The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).
This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.
Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:
#define _cleanup_(function) __attribute__((cleanup(function)))
Or similar, to make the gcc feature easier to use.
Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.
See #2008. |
9d06297e262966de71095debd1537fc223f940a3 |
|
24-Nov-2015 |
Harald Hoyer <harald@redhat.com> |
core: Do not bind a mount unit to a device, if it was from mountinfo
If a mount unit is bound to a device, systemd tries to umount the
mount point, if it thinks the device has gone away.
Due to the uevent queue and inotify of /proc/self/mountinfo being two
different sources, systemd can never get the ordering reliably correct.
It can happen, that in the uevent queue ADD,REMOVE,ADD is queued
and an inotify of mountinfo (or libmount event) happend with the
device in question.
systemd cannot know, at which point of time the mount happend in the
ADD,REMOVE,ADD sequence.
The real ordering might have been ADD,REMOVE,ADD,mount
and systemd might think ADD,mount,REMOVE,ADD and would umount the
mountpoint.
A test script which triggered this behaviour is:
rm -f test-efi-disk.img
dd if=/dev/null of=test-efi-disk.img bs=1M seek=512 count=1
parted --script test-efi-disk.img \
"mklabel gpt" \
"mkpart ESP fat32 1MiB 511MiB" \
"set 1 boot on"
LOOP=$(losetup --show -f -P test-efi-disk.img)
udevadm settle
mkfs.vfat -F32 ${LOOP}p1
mkdir -p mnt
mount ${LOOP}p1 mnt
... <dostuffwith mnt>
Without the "udevadm settle" systemd unmounted mnt while the script was
operating on mnt.
Of course the question is, why there was a REMOVE in the first place,
but this is not part of this patch. |
74bb646ee5a812e91949c03fa461bc4bd7d2d7b8 |
|
18-Nov-2015 |
Susant Sahani <ssahani@gmail.com> |
socket: Add support for socket protcol
Now we don't support the socket protocol like
sctp and udplite .
This patch add a new config param
SocketProtocol: udplite/sctp
With this now we can configure the protocol as
udplite = IPPROTO_UDPLITE
sctp = IPPROTO_SCTP
Tested with nspawn: |
4bd29fe5cec9d744a4e39240c76b85d999bd2cf7 |
|
12-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
core: drop "override" flag when building transactions
Now that we don't have RequiresOverridable= and RequisiteOverridable=
dependencies anymore, we can get rid of tracking the "override" boolean
for jobs in the job engine, as it serves no purpose anymore.
While we are at it, fix some error messages we print when invoking
functions that take the override parameter. |
4c9ea260aeaff2e837f543e3c42d2e7102af1137 |
|
11-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
core: simplify things a bit by checking default_dependencies boolean in callee, not caller
It's nicer to hide the check away in the various
xyz_add_default_dependencies() calls, rather than making it explicit in
the caller, and thus require deeper nesing. |
9ff1a6f1d61d4569920d5b75c88cf1c2ad9adaae |
|
10-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
core: change type of distribute_fds() prototype to return void
We can't handle errors of thisc all sanely anyway, and we never actually
return any errors from the unit type that implements the call. Hence,
let's make this void, in order to simplify things. |
c386f5886466de6022b3b4b1c8ac8df72871fbc7 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
core: all unit types that watch control PIDs should use the same logic
When coldplugging the unit state, make sure to follow the same basic
logic for all unit types: always verify whether the control PID is still
a waitable process before proceeding. |
7b3e062cb6872e28ef5a2e069810070e28bbe0cd |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
process-util: move a couple of process-related calls over |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
8b43440b7ef4b81c69c31de7ff820dc07a780254 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move string table stuff into its own string-table.[ch] |
5f311f8c0e51e2f13773823feb6a71f7c6f2838c |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util: remove path_get_parent(), in favour of dirname_malloc()
We don't need two functions that do essentialy the same, hence drop
path_get_parent(), and stick to dirname_malloc(), but move it to
path-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] |
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. |
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. |
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. |
79c7626d1f239e02152ad698298a1b5d0e9fbacf |
|
06-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
core: simplify fd collection code, return number of fds as return value
Let's simplify the fd collection code a bit, and return the number of
collected fds as positive integer, the way it's customary in our usual
code. |
6ec4ed645e37ba7dd5628747ea78ec1663599ab7 |
|
06-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
socket: don't double close the same fd for FIFOs |
55301ec028937eab4722c9fd586fd77ffdbc50dd |
|
01-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
core: add new setting Writable= to ListenSpecial= socket units
Writable= is a new boolean setting. If ture, then ListenSpecial= will
open the specified path in O_RDWR mode, rather than just O_RDONLY.
This is useful for implementing services like rfkill, where /dev/rfkill
is more useful when opened in write mode, if we want to not only save
but also restore its state. |
e53fc357a9bb9d0a5362ccc4246d598cb0febd5e |
|
30-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: remove a number of invocations of strerror() and replace by %m
Let's clean up our tree a bit, and reduce invocations of the
thread-unsafe strerror() by replacing it with printf()'s %m specifier. |
3607810227b346ea151e4442579ea56b28043963 |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
socket: rename ffs_xyz to usbffs_xyz
The relation to USB should really be clearer. |
00411a134331cb6ffe6479407df0d496d24a236a |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
core: turn a large if statement into a switch |
710a6b5017ba23fde6713f55340db5390ea27cec |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
selinux: add _cleanup_ concepts to SELinux label allocation |
e8da24a642c78d55f5287011db70d7cd95bf3b2b |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
core: simplify how we create socket fds
Let's always return the allocated fds as return values where possible,
and make more use of _cleanup_close_ |
ed460b077a7efe607b2f02f5455a76cd94b5264f |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
core: small error message wording improvements |
7e55de3b9648a47286a9b49253f95b1e0d65287a |
|
28-Sep-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Move all unit states to basic/ and extend systemctl --state=help |
6b7e59231014b94636f4a1b730143fbe6f60c3f4 |
|
22-Sep-2015 |
Pawel Szewczyk <p.szewczyk@samsung.com> |
core: Add FFSDescriptors and FFSStrings service parameters
By using these parameters functionfs service can specify ffs descriptors
and strings which should be written to ep0. |
602524469ecd7db0e0d5a71ecd1dce34f7a108b6 |
|
22-Sep-2015 |
Pawel Szewczyk <p.szewczyk@samsung.com> |
core: Add socket type for usb functionfs endpoints
For handling functionfs endpoints additional socket type is added. |
15087cdbd63312f706f21339489daf210ae609d0 |
|
22-Sep-2015 |
Pawel Szewczyk <p.szewczyk@samsung.com> |
core: Add list of additional file descriptors to socket port
Some additional files related to single socket may appear in the
filesystem and they should be opened and passed to related service.
This commit adds optional list of file descriptors, which are
dynamically discovered and opened. |
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. |
d79200e26ee39d4b451f95e876fc4595df51fe51 |
|
31-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
unit: unify how we assing slices to units
This adds a new call unit_set_slice(), and simplifies
unit_add_default_slice(). THis should make our code a bit more robust
and simpler. |
172cfe8714754e1f16fc500e3ed02c4de68de92f |
|
31-Aug-2015 |
Robin Hack <rhack@redhat.com> |
socket: fix setsockopt call. SOL_SOCKET changed to SOL_TCP. |
21b735e798c580e7af8c33ace9f8565860b7f8df |
|
28-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
core: add unit_dbus_interface_from_type() to unit-name.h
Let's add a way to get the type-specific D-Bus interface of a unit from
either its type or name to src/basic/unit-name.[ch]. That way we can
share it with the client side, where it is useful in tools like cgls or
machinectl.
Also ports over machinectl to make use of this. |
057171efc103ac76c60a2a0d277d8bbf25415c21 |
|
27-Aug-2015 |
David Herrmann <dh.herrmann@gmail.com> |
Revert "sd-bus: do not connect to dbus-1 socket when kdbus is available"
This reverts commit d4d00020d6ad855d65d31020fefa5003e1bb477f. The idea of
the commit is broken and needs to be reworked. We really cannot reduce
the bus-addresses to a single address. We always will have systemd with
native clients and legacy clients at the same time, so we also need both
addresses at the same time. |
d4d00020d6ad855d65d31020fefa5003e1bb477f |
|
11-Aug-2015 |
Kay Sievers <kay@vrfy.org> |
sd-bus: do not connect to dbus-1 socket when kdbus is available
We should not fall back to dbus-1 and connect to the proxy when kdbus
returns an error that indicates that kdbus is running but just does not
accept new connections because of quota limits or something similar.
Using is_kdbus_available() in libsystemd/ requires it to move from
shared/ to libsystemd/.
Based on a patch from David Herrmann:
https://github.com/systemd/systemd/pull/886 |
5ab58c2091636209231fc3fd5bf97f21b77deb88 |
|
04-Aug-2015 |
WaLyong Cho <walyong.cho@samsung.com> |
smack-util: revise smack-util apis and add read smack attr apis
- Add smack xattr lookup table
- Unify all of mac_smack_apply_xxx{_fd}() to mac_smack_apply() and
mac_smack_apply_fd().
- Add smack xattr read apis similar with apply apis as
mac_smack_read{_fd}(). |
c382d69e3d39daedebcedb2da882beeb147a3cda |
|
21-Jul-2015 |
Michal Schmidt <mschmidt@redhat.com> |
core: remove generic job completion messages from unit vtables
These units' message format strings are identical to the generic
strings. Since we can always rely on the fallback, these are now
redundant. |
54255c64e6d223deb7d3863e426e78c443fda37c |
|
01-Jul-2015 |
Christos Trochalakis <yatiohi@ideopolis.gr> |
socket: Set SO_REUSEPORT before bind()
bind() fails if it is called before setting SO_REUSEPORT and another
process is already binded to the same addess.
A new reuse_port option has been introduced to socket_address_listen()
to set the option as part of socket initialization. |
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). |
920b52e4909d9dc812817fd8b82f83ca23a11c91 |
|
08-Jun-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tree-wide: remove spurious space |
24882e06c135584f16f31ba8a00fecde8b7f6fad |
|
29-May-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split out signal-util.[ch] from util.[ch]
No functional changes. |
cbf60d0a7fda7bd6c0578a6cc151f798a0edfd02 |
|
13-May-2015 |
Lennart Poettering <lennart@poettering.net> |
core: only set event source name when we create an event source |
b2c23da8cea1987a1a329f5a964d3299b7ca7890 |
|
11-May-2015 |
Lennart Poettering <lennart@poettering.net> |
core: rename SystemdRunningAs to ManagerRunningAs
It's primarily just a property of the Manager object after all, and we
try to refer to PID 1 as "manager" instead of "systemd", hence let's to
stick to this here too. |
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 |
6f856a0992aee3fb06cb13a761b902657ff228ea |
|
11-May-2015 |
Lennart Poettering <lennart@poettering.net> |
core: always initialize ExecParamters.bus_endpoint_fd to -1
Otherwise it might be passed in as 0, which is a valid fd, but usually
does not refer to a real endpoint. |
7410616cd9dbbec97cf98d75324da5cda2b2f7a2 |
|
06-May-2015 |
Lennart Poettering <lennart@poettering.net> |
core: rework unit name validation and manipulation logic
A variety of changes:
- Make sure all our calls distuingish OOM from other errors if OOM is
not the only error possible.
- Be much stricter when parsing escaped paths, do not accept trailing or
leading escaped slashes.
- Change unit validation to take a bit mask for allowing plain names,
instance names or template names or an combination thereof.
- Refuse manipulating invalid unit name |
cfa9677bd164574600d29a9bf99f9d1f28a7a170 |
|
29-Apr-2015 |
Mantas MikulÄ—nas <grawity@gmail.com> |
core: fix event source annotations
These looked like a mass-replace gone slightly wrong – two statements
with no { }'s, and no error checking. |
7dfbe2e3fc0215b49d8202a32beb6b1aae08c4e4 |
|
29-Apr-2015 |
Tom Gundersen <teg@jklm.no> |
core: annotate event sources |
be847e82cf95bf8eb589778df2aa2b3d1d7ae99e |
|
24-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
Revert "core: do not spawn jobs or touch other units during coldplugging"
This reverts commit 6e392c9c45643d106673c6643ac8bf4e65da13c1.
We really shouldn't invent external state keeping hashmaps, if we can
keep this state in the units themselves. |
6482f6269c87d2249e52e889a63adbdd50f2d691 |
|
10-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add formats-util.h |
e5403f09aa0c548d2739f132c2699a6ad44dad51 |
|
07-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
socket: minor modernizations |
6e392c9c45643d106673c6643ac8bf4e65da13c1 |
|
07-Mar-2015 |
Ivan Shapovalov <intelfx100@gmail.com> |
core: do not spawn jobs or touch other units during coldplugging
Because the order of coldplugging is not defined, we can reference a
not-yet-coldplugged unit and read its state while it has not yet been
set to a meaningful value.
This way, already active units may get started again.
We fix this by deferring such actions until all units have been at
least somehow coldplugged.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=88401 |
5ad096b3f1331b175340129a8c9a5a9d711e5415 |
|
02-Mar-2015 |
Lennart Poettering <lennart@poettering.net> |
core: expose consumed CPU time per unit
This adds support for showing the accumulated consumed CPU time per-unit
in the "systemctl status" output. The property is also readable via the
bus. |
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. |
c78e47a61fa8d9a21fece01c83e4c26ce0938d27 |
|
20-Feb-2015 |
Michal Schmidt <mschmidt@redhat.com> |
core, shared: in deserializing, match same files reached via different paths
When dbus.socket is updated like this:
-ListenStream=/var/run/dbus/system_bus_socket
+ListenStream=/run/dbus/system_bus_socket
... and daemon-reload is performed, bad things happen.
During deserialization systemd does not recognize that the two paths
refer to the same named socket and replaces the socket file with a new
one. As a result, applications hang when they try talking to dbus.
Fix this by finding a match not only when the path names are equal, but
also when they point to the same inode.
In socket_address_equal() it is necessary to move the address size
comparison into the abstract sockets branch. For path name sockets the
comparison must not be done and for other families it is redundant
(their sizes are constant and checked by socket_address_verify()).
FIFOs and special files can also have multiple pathnames, so compare the
inodes for them as well. Note that previously the pathname checks used
streq_ptr(), but the paths cannot be NULL.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1186018 |
d54ddab8cbad46290306fc6e3346089fe3772d5c |
|
11-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
core: don't watch for socket events when service is in SERVICE_STOP
If a service has an ExecStop= program that uses the socket the service was
activated by to tell it to terminate, then that should not be used as
trigger to start the service again.
http://lists.freedesktop.org/archives/systemd-devel/2015-February/028058.html |
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. |
82a2b6bb5e4e5d294f09af778c48974a7857afb6 |
|
28-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
core: output unit status output strings to console, only if we actually are changing unit state
Unit _start() and _stop() implementations can fail with -EAGAIN to delay
execution temporarily. Thus, we should not output status messages before
invoking these calls, but after, and only when we know that the
invocation actually made a change. |
d7b8eec7dc7fe307d3a08b32cf1a9ad4276ce6d5 |
|
28-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: add new line type 'v' for creating btrfs subvolumes |
fed1e721fd0c81e60c77120539f34e16c2585634 |
|
28-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
treewide: introduce UID_INVALID (and friends) as macro for (uid_t) -1 |
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(). |
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. |
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. |
db2cb23b5b179707000d28a11efb3d888d06ee80 |
|
28-Oct-2014 |
Umut Tezduyar Lindskog <umut.tezduyar@axis.com> |
core: send sigabrt on watchdog timeout to get the stacktrace
if sigabrt doesn't do the job, follow regular shutdown
routine, sigterm > sigkill. |
43b133b4e09a0e991ba1680b9ef5458b24f9dcc9 |
|
23-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
socket: properly label socket symlinks |
75514a707c74b69d64a5326ad075728212091cb4 |
|
23-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
socket: fix error comparison |
ecabcf8b6edcc856ec2fd5bd43fc675a8fe04731 |
|
23-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
selinux: clean up selinux label function naming |
7f416dae9bcf1cfb63689ee9ac851adf738f072b |
|
23-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
selinux: rework label query APIs
APIs that query and return something cannot silently fail, they must
either return something useful, or an error. Fix that.
Also, properly rollback socket unit fd creation when something goes
wrong with the security framework. |
d53e386db62ee7f03e7d493ae0e6db7a31a5d811 |
|
23-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
smack: rework smack APIs a bit
a) always return negative errno error codes
b) always become a noop if smack is off
c) always take a NULL label as a request to remove it |
c80d766c8072dd0be311dcd31c17f9719775be44 |
|
23-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
mac: rename all calls that apply a label mac_{selinux|smack}_apply_xyz(), and all that reset it to defaults mac_{selinux|smack}_fix()
Let's clean up the naming schemes a bit and use the same one for SMACK
and for SELINUX. |
cc56fafeebf814ef035e549115cf1850e6473fa5 |
|
23-Oct-2014 |
WaLyong Cho <walyong.cho@samsung.com> |
mac: rename apis with mac_{selinux/smack}_ prefix |
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> |
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. |
4c94096027f21d4ed0efe991534a926d39d52369 |
|
21-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
core: unify how we generate the prefix string when dumping unit state |
3cd761e4df278cdef6fda9d7f50be512d3c1d7ae |
|
19-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
socket: suffix newly added TCP sockopt time properties with "Sec"
This is what we have done so far for all other time values, and hence we
should do this here. This indicates the default unit of time values
specified here, if they don't contain a unit. |
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> |
cc567c9beace114554f7e7f50c3a5181cc44a07d |
|
15-Aug-2014 |
Susant Sahani <susant@redhat.com> |
socket: Add support for TCP defer accept
TCP_DEFER_ACCEPT Allow a listener to be awakened only when data
arrives on the socket. If TCP_DEFER_ACCEPT set on a server-side
listening socket, the TCP/IP stack will not to wait for the final
ACK packet and not to initiate the process until the first packet
of real data has arrived. After sending the SYN/ACK, the server will
then wait for a data packet from a client. Now, only three packets
will be sent over the network, and the connection establishment delay
will be significantly reduced. |
209e9dcd7b2f23b68ff93bf20fad025bc03219ac |
|
15-Aug-2014 |
Susant Sahani <susant@redhat.com> |
socket: Add Support for TCP keep alive variables
The tcp keep alive variables now can be configured via conf
parameter. Follwing variables are now supported by this patch.
tcp_keepalive_intvl: The number of seconds between TCP keep-alive probes
tcp_keepalive_probes: The maximum number of TCP keep-alive probes to
send before giving up and killing the connection if no response is
obtained from the other end.
tcp_keepalive_time: The number of seconds a connection needs to be
idle before TCP begins sending out keep-alive probes. |
4d8ddba9d71e51356cc9488f906b8fef89c60c23 |
|
14-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
Revert "socket: add support for TCP fast Open"
This reverts commit 9528592ff8d7ff361da430285deba8196e8984d5.
Apparently TFO is actually the default at least for the server side now.
Also the setsockopt doesn't actually take a bool, but a qlen integer. |
9528592ff8d7ff361da430285deba8196e8984d5 |
|
14-Aug-2014 |
Susant Sahani <susant@redhat.com> |
socket: add support for TCP fast Open
TCP Fast Open (TFO) speeds up the opening of successiveTCP)
connections between two endpoints.It works by using a TFO cookie
in the initial SYN packet to authenticate a previously connected
client. It starts sending data to the client before the receipt
of the final ACK packet of the three way handshake is received,
skipping a round trip and lowering the latency in the start of
transmission of data. |
4427c3f43a87c2e0c784fda6be1b9715be820733 |
|
14-Aug-2014 |
Susant Sahani <susant@redhat.com> |
socket: add support for tcp nagle
This patch adds support for TCP TCP_NODELAY socket option. This can be
configured via NoDelay conf parameter. TCP Nagle's algorithm works by
combining a number of small outgoing messages, and sending them all at
once. This controls the TCP_NODELAY socket option. |
8b835fccdad78d89f9cc64f9b02059fb75ffbab1 |
|
21-Jul-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
systemd-verify: a simple tool for offline unit verification
This tool will warn about misspelt directives, unknown sections, and
non-executable commands. It will also catch the common mistake of
using Accept=yes with a non-template unit and vice versa.
https://bugs.freedesktop.org/show_bug.cgi?id=56607 |
cee288adf88844acd880e4c0da5ed550c85cdd1a |
|
18-Jun-2014 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
socket: check return from exec_spawn |
817e224bbce3ed157817961ef19c80a250845a05 |
|
07-Jun-2014 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
Remove sysv parser from service.c
Parsing sysv files was moved to the sysv-generator in the previous commit.
This patch removes the sysv parsing from serivce.c.
Note that this patch drops the following now unused sysv-specific info
from service dump:
"SysV Init Script has LSB Header: (yes/no)"
"SysVEnabled: (yes/no)"
"SysVRunLevels: (levels)" |
e5a1c18d706c4d5e16100fe4fb8a07a80f2fa339 |
|
06-Jun-2014 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
fix warnings
Prevent use of uninitialized variable and removed a now unused
cleanup function for freeaddrinfo |
a4152e3fe28b53b8919cc404dd7eca7ead1bf9bd |
|
05-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
kdbus: when uploading bus name policy, resolve users/groups out-of-process
It's not safe invoking NSS from PID 1, hence fork off worker processes
that upload the policy into the kernel for busnames. |
3900e5fdff688dc3c273f177d9d913b7389d5561 |
|
05-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
socket: add SocketUser= and SocketGroup= for chown()ing sockets in the file system
This is relatively complex, as we cannot invoke NSS from PID 1, and thus
need to fork a helper process temporarily. |
811ba7a0e292eda0f2f470613cc28a97bda7ee66 |
|
04-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
socket: add new Symlinks= option for socket units
With Symlinks= we can manage one or more symlinks to AF_UNIX or FIFO
nodes in the file system, with the same lifecycle as the socket itself.
This has two benefits: first, this allows us to remove /dev/log and
/dev/initctl from /dev, thus leaving only symlinks, device nodes and
directories in the /dev tree. More importantly however, this allows us
to move /dev/log out of /dev, while still making it accessible there, so
that PrivateDevices= can provide /dev/log too. |
bd1fe7c79de3d81325afecb7ded46c1627f6c1df |
|
04-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
socket: optionally remove sockets/FIFOs in the file system after use |
d2edfae0f9bdbecf6a8518e2a5bcf06f470e0d9e |
|
28-May-2014 |
Kay Sievers <kay@vrfy.org> |
build-sys: use glibc's xattr support instead of requiring libattr |
640ace4a8de907994a1b95f6d368c3e6a8fcf60f |
|
22-May-2014 |
Lennart Poettering <lennart@poettering.net> |
socket: properly handle if our service vanished during runtime |
de0671ee7fe465e108f62dcbbbe9366f81dd9e9a |
|
15-May-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Remove unnecessary casts in printfs
No functional change expected :) |
d38f6e34a618e2d100b06888e0810f776eb83510 |
|
20-Apr-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Handle Unix domain socket connections from outside our namespace v2
This is a second attempt at 9754d56, reverted in 2f20a8e, because
I lost a 'break;' when moving chunks around. |
2f20a8ebdb5aed3146f366360762d8963efe8d82 |
|
19-Apr-2014 |
Kay Sievers <kay@vrfy.org> |
Revert "Handle Unix domain socket connections from outside our namespace"
This reverts commit 9754d56e9b21bfe89fc18f47987d6bef491b8521.
It causes a crash in PID1:
Apr 19 13:49:32 lon systemd[1]: Code should not be reached 'Unhandled socket type.'
at src/core/socket.c:684, function instance_from_socket(). Aborting.
Apr 19 13:49:32 lon systemd[1]: Caught <ABRT>, dumped core as pid 336.
Apr 19 13:49:32 lon systemd[1]: Freezing execution. |
9754d56e9b21bfe89fc18f47987d6bef491b8521 |
|
17-Apr-2014 |
Eelco Dolstra <eelco.dolstra@logicblox.com> |
Handle Unix domain socket connections from outside our namespace
NixOS uses Unix domain sockets for certain host <-> container
interaction; i.e. the host connects to a socket visible in the
container's directory tree, where the container uses a .socket unit to
spawn the handler program on demand. This worked in systemd 203, but
in 212 fails with "foo.socket failed to queue service startup job
(Maybe the service file is missing or not a template unit?): No data
available".
The reason is that getpeercred() now returns ENODATA if it can't get
the PID of the client, which happens in this case because the client
is not in the same PID namespace. Since getpeercred() is only used to
generate the instance name, this patch simply handles ENODATA by
creating an instance name "<nr>-unknown".
[zj: reorder clauses and remove (unsigned long) casts.] |
6a0f1f6d5af7c7300d3db7a0ba2b068f8abd222b |
|
24-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-event: rework API to support CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM, too |
598459cebac7cc93089769a992e7b03287f77e12 |
|
19-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
core: rework context initialization/destruction logic
Let's automatically initialize the kill, exec and cgroup contexts of the
various unit types when the object is constructed, instead of
invididually in type-specific code.
Also, when PrivateDevices= is set, set DevicePolicy= to closed. |
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. |
315db1a8aed226a51a4cf700172249cfd10ae115 |
|
14-Mar-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Do not return -1 (EINVAL) on allocation error |
9d16d0c7d0b05e3ff278c3c95e1f2f871f348dd3 |
|
12-Mar-2014 |
Daniel Buch <boogiewasthere@gmail.com> |
socket.c: make use of union sockaddr_union |
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. |
085afe36cb823e7d5b8c5f3ef21ebb9639bac78b |
|
24-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
core: add global settings for enabling CPUAccounting=, MemoryAccounting=, BlockIOAccounting= for all units at once |
151b9b9662a90455262ce575a8a8ae74bf4ff336 |
|
20-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
api: in constructor function calls, always put the returned object pointer first (or second)
Previously the returned object of constructor functions where sometimes
returned as last, sometimes as first and sometimes as second parameter.
Let's clean this up a bit. Here are the new rules:
1. The object the new object is derived from is put first, if there is any
2. The object we are creating will be returned in the next arguments
3. This is followed by any additional arguments
Rationale:
For functions that operate on an object we always put that object first.
Constructors should probably not be too different in this regard. Also,
if the additional parameters might want to use varargs which suggests to
put them last.
Note that this new scheme only applies to constructor functions, not to
all other functions. We do give a lot of freedom for those.
Note that this commit only changes the order of the new functions we
added, for old ones we accept the wrong order and leave it like that. |
ac84d1fb5a7293df4f75544eedf148ba0bb4ec21 |
|
29-Jan-2014 |
Lennart Poettering <lennart@poettering.net> |
core: make sure to always go through both SIGTERM and SIGKILL states of units
Given that we now have KillMode=mixed where SIGTERM might kill a smaller
set than SIGKILL we need to make sure to always go explicitly throught
the SIGKILL state to get the right end result. |
68db7a3bd9b2f8640c7297382b6d20eb995f7e1e |
|
27-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core: add function to tell when job will time out
Things will continue when either the job timeout
or the unit timeout is reached. Add functionality to
access that info. |
6c833cdfc36322cf77b83d3154bd216129352a3a |
|
11-Jan-2014 |
Michael Scherer <misc@zarb.org> |
make socket_instantiate_service use cleanup gcc attribute |
eff05270986a13e7de93ae16311f654d3f7c166f |
|
24-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
util: unify SO_PEERCRED/SO_PEERSEC invocations
Introduce new call getpeercred() which internally just uses SO_PEERCRED
but checks if the returned data is actually useful due to namespace
quirks. |
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. |
aec8de63b14a93b91b85dc15bf879604352fbbe1 |
|
22-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
core: no need to list properties for PropertiesChanged messages anymore
Since the vtable includes this information anyway, let's just use that |
16ac401407959cbc62312e61c2dd76dbc3a0793b |
|
16-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: when a busname unit refuses to activate a service it should flush the queue |
e821075a23fdfa3ca7738fc30bb2d4c430fe10c0 |
|
02-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: add .busname unit type to implement kdbus-style bus activation |
613b411c947635136637f8cdd66b94512f761eab |
|
27-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
service: add the ability for units to join other unit's PrivateNetwork= and PrivateTmp= namespaces |
718db96199eb307751264e4163555662c9a389fa |
|
20-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
core: convert PID 1 to libsystemd-bus
This patch converts PID 1 to libsystemd-bus and thus drops the
dependency on libdbus. The only remaining code using libdbus is a test
case that validates our bus marshalling against libdbus' marshalling,
and this dependency can be turned off.
This patch also adds a couple of things to libsystem-bus, that are
necessary to make the port work:
- Synthesizing of "Disconnected" messages when bus connections are
severed.
- Support for attaching multiple vtables for the same interface on the
same path.
This patch also fixes the SetDefaultTarget() and GetDefaultTarget() bus
calls which used an inappropriate signature.
As a side effect we will now generate PropertiesChanged messages which
carry property contents, rather than just invalidation information. |
f0511bd7e3d591383485a36ddcb764abe74b1939 |
|
17-Nov-2013 |
Shawn Landden <shawn@churchofgit.com> |
core/socket: fix SO_REUSEPORT |
e55001ebba6f6ad7d63db249f7bf93f25be12acd |
|
17-Nov-2013 |
Shawn Landden <shawn@churchofgit.com> |
core/socket: use _cleanup_free_ |
175a3d25d0e8596d4ba0759aea3f89ee228e7d6d |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
active: rework make_socket_fd() to be based on socket_address_listen()
Among other things this makes sure we set SO_REUSEADDR which is
immensely useful. |
1f19a534ea84458670ec011f6d1ba96f76e3f783 |
|
05-Nov-2013 |
Oleksii Shevchuk <alxchk@gmail.com> |
Configurable Timeouts/Restarts default values
https://bugs.freedesktop.org/show_bug.cgi?id=71132
Patch adds DefaultTimeoutStartSec, DefaultTimeoutStopSec, DefaultRestartSec
configuration options to manager configuration file. |
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. |
9a4e038c1519d836d217fac5df3722e6a02ea78d |
|
11-Oct-2013 |
Kay Sievers <kay@vrfy.org> |
smack: minimize ifdef use, and move all labeling to smack-util.c |
5a045dad1c5adf17d9198b15d085c9425c1dae8e |
|
10-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
security: missing header inclusions |
d682b3a7e7c7c2941a4d3e193f1e330dbc9fae89 |
|
10-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
security: rework selinux, smack, ima, apparmor detection logic
Always cache the results, and bypass low-level security calls when the
respective subsystem is not enabled. |
a57f7e2c828b852eb32fd810dcea041bb2975501 |
|
26-Sep-2013 |
Lennart Poettering <lennart@poettering.net> |
core: rework how we match mount units against each other
Previously to automatically create dependencies between mount units we
matched every mount unit agains all others resulting in O(n^2)
complexity. On setups with large amounts of mount units this might make
things slow.
This change replaces the matching code to use a hashtable that is keyed
by a path prefix, and points to a set of units that require that path to
be around. When a new mount unit is installed it is hence sufficient to
simply look up this set of units via its own file system paths to know
which units to order after itself.
This patch also changes all unit types to only create automatic mount
dependencies via the RequiresMountsFor= logic, and this is exposed to
the outside to make things more transparent.
With this change we still have some O(n) complexities in place when
handling mounts, but that's currently unavoidable due to kernel APIs,
and still substantially better than O(n^2) as before.
https://bugs.freedesktop.org/show_bug.cgi?id=69740 |
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. |
19f6d710772305610b928bc2678b9d77fe11e770 |
|
17-Sep-2013 |
Lennart Poettering <lennart@poettering.net> |
specifier: rework specifier calls to return proper error message
Previously the specifier calls could only indicate OOM by returning
NULL. With this change they will return negative errno-style error codes
like everything else. |
d137a488afb59801177dc34c218f339bfbbdb044 |
|
12-Sep-2013 |
Umut Tezduyar <umut@tezduyar.com> |
core: notify triggered by socket of a service |
f7db7a691c3f532cf60886312459f2baea755283 |
|
11-Jul-2013 |
Shawn Landden <shawnlandden@gmail.com> |
basic SO_REUSEPORT support |
74c964d369b11bbf465c140c3f2dfcde2c7f5977 |
|
27-Jun-2013 |
Lennart Poettering <lennart@poettering.net> |
dbus: hookup runtime property changes for mouns, services, sockets, swaps too |
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=). |
9444b1f20e311f073864d81e913bd4f32fe95cfd |
|
20-Jun-2013 |
Lennart Poettering <lennart@poettering.net> |
logind: add infrastructure to keep track of machines, and move to slices
- This changes all logind cgroup objects to use slice objects rather
than fixed croup locations.
- logind can now collect minimal information about running
VMs/containers. As fixed cgroup locations can no longer be used we
need an entity that keeps track of machine cgroups in whatever slice
they might be located. Since logind already keeps track of users,
sessions and seats this is a trivial addition.
- nspawn will now register with logind and pass various bits of metadata
along. A new option "--slice=" has been added to place the container
in a specific slice.
- loginctl gained commands to list, introspect and terminate machines.
- user.slice and machine.slice will now be pulled in by logind.service,
since only logind.service requires this slice. |
a016b9228f338cb9b380ce7e00826ef462767d98 |
|
17-Jun-2013 |
Lennart Poettering <lennart@poettering.net> |
core: add new .slice unit type for partitioning systems
In order to prepare for the kernel cgroup rework, let's introduce a new
unit type to systemd, the "slice". Slices can be arranged in a tree and
are useful to partition resources freely and hierarchally by the user.
Each service unit can now be assigned to one of these slices, and later
on login users and machines may too.
Slices translate pretty directly to the cgroup hierarchy, and the
various objects can be assigned to any of the slices in the tree. |
2b3e18de74ca89b374dd4f7a2c30e5731d347841 |
|
17-May-2013 |
Karol Lewandowski <k.lewandowsk@samsung.com> |
Make it possible to disable smack separately from xattr support
Additionally, compile out rule loading if feature is disabled. |
b00ad20fa0e490dde28e196739b4e18abb10e9b4 |
|
07-May-2013 |
Lennart Poettering <lennart@poettering.net> |
build-sys: support builds without EAs again |
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. |
31afa0a44c2d7f93d837c840cdbd623982ac165f |
|
26-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
unit: rework stop pending logic
When a trigger unit wants to know if a stop is queued for it, we should
just check precisely that and do not check whether it is actually
stopped already. This is because we use these checks usually from state
change calls where the state variables are not updated yet.
This change splits unit_pending_inactive() into two calls
unit_inactive_or_pending() and unit_stop_pending(). The former checks
state and pending jobs, the latter only pending jobs. |
449101fce2757575c4813a9512890536365445f6 |
|
18-Apr-2013 |
Simon Peeters <peeters.simon@gmail.com> |
Move bus_error to dbus-common and remove bus_error_message_or_strerror
bus_error and bus_error_message_or_strerror dit almost exactly the same,
so use only one of them and place it in dbus-common. |
67419600875f3dae2182e3f92640bae4c8cd1f2f |
|
02-Apr-2013 |
Oleksii Shevchuk <alxchk@gmail.com> |
Add Listen* to dbus properties
sockets.socket - Test
Loaded: loaded (/home/alxchk/.config/systemd/user/sockets.socket; static)
Active: inactive (dead)
Listen: Stream: /tmp/stream1
Stream: @stream4
Stream: [::]:9999
Stream: 127.0.0.2:9996
Stream: [::1]:9996
Datagram: /tmp/stream2
Datagram: @stream5
Datagram: [::]:9998
Datagram: 127.0.0.2:9995
Datagram: [::1]:9995
SequentialPacket: @stream6
SequentialPacket: /tmp/stream3
FIFO: /tmp/fifo1
Special: /dev/input/event9
Netlink: kobject-uevent 0
MessageQueue: /msgqueue1
[zj: - minor cleanups,
- free i.listen,
- remove sorting, because the order or sockets matters.] |
d7607eac6318ae8ff1c00ef5705fd55a614cd495 |
|
01-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core/socket: log errors when starting socket for this socket
When showing an error like 'Socket service not loaded', the
error won't show up in the status for the socket, unless it is
marked as SYSTEMD_UNIT=*.socket. Marking it as SYSTEMD_UNIT=*.service,
when the service is non-existent, is not useful. |
e3d84721dc9bcf9008f72dae03ff0f7842d0bb4b |
|
25-Mar-2013 |
Lennart Poettering <lennart@poettering.net> |
units: introduce new timers.target and paths.target to hook timer/path units into for boot |
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. |
814cc562121270e2d5de0630b773792c74990a9c |
|
13-Mar-2013 |
Michal Schmidt <mschmidt@redhat.com> |
core: single unit_kill implementation for all unit types
There are very few differences in the implementations of the kill method in the
unit types that have one. Let's unify them.
This does not yet unify unit_kill() with unit_kill_context(). |
cd2086fe6573df923dc53ef33998c9fff8c2bda5 |
|
26-Jan-2013 |
Lennart Poettering <lennart@poettering.net> |
core: unify kill code of mount, service, socket, swap units |
71645acac27da55d510f2e4d61cc61b4e5b93035 |
|
19-Jan-2013 |
Lennart Poettering <lennart@poettering.net> |
unit: optionally allow making cgroup attribute changes persistent |
74051b9b5865586bf4d30b9075649af838fb92bd |
|
17-Jan-2013 |
Lennart Poettering <lennart@poettering.net> |
units: for all unit settings that take lists, allow the empty string for resetting the lists
https://bugzilla.redhat.com/show_bug.cgi?id=756787 |
7d0c710d72f8a6e5c6909c65700aa088c53aebc6 |
|
15-Jan-2013 |
Michał Bartoszkiewicz <mbartoszkiewicz@gmail.com> |
core: do not make sockets dependent on lo
/sys/subsystem/net/devices/lo is never considered active, so sockets
with BindToDevice=lo would never be activated. |
66870f90dec9b5bf4ad76f9757fafce703560a67 |
|
06-Jan-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
systemd: use unit logging macros |
01e10de3c2b9c2944bd86b12fab83d1164d0b64a |
|
22-Dec-2012 |
Lennart Poettering <lennart@poettering.net> |
socket: support socket activation of containers |
ee09281729588900edc06152032a0cc09557f998 |
|
22-Dec-2012 |
Lennart Poettering <lennart@poettering.net> |
socket: properly serialize/desrialize mqueue fds |
80cba3795da3a43b27cbb219d7daf7d6f049b079 |
|
19-Dec-2012 |
Dimitrios Apostolou <jimis@gmx.net> |
socket: Too many incoming connections
Hello list,
some socket activated service gave me the error message you can see on
the subject, maybe systemd should be more verbose in that case.
Thanks,
Dimitris |
36697dc0199e25f09b78090fcf5f1cf8a3648ffd |
|
23-Nov-2012 |
Lennart Poettering <lennart@poettering.net> |
timer: implement calendar time events |
cf37cd2f305db327e05f8e001f5d84887f4fdfeb |
|
21-Nov-2012 |
Henrik Grindal Bakken <hgb@ifi.uio.no> |
Add #ifdef guards around xattr usage
This adds #ifdef HAVE_ATTR_XATTR_H guards around all usage of xattr.
This unbreaks building with --disable-xattr when <attr/xattr.h> doesn't exist.
<attr/xattr.h> and usage of fsetxattr() without |
10f70492aea211981e4bdbe58dd7ea110e05cd16 |
|
20-Nov-2012 |
Lennart Poettering <lennart@poettering.net> |
socket: improve error message when we cannot spawn the socket's service unit |
e4f44e734c4f397ee5e7ba3270e014a8ae0043dd |
|
06-Nov-2012 |
Dave Reisner <dreisner@archlinux.org> |
Revert "Implement SocketUser= and SocketGroup= for [Socket]"
This was never intended to be pushed.
This reverts commit aea54018a5e66a41318afb6c6be745b6aef48d9e. |
aea54018a5e66a41318afb6c6be745b6aef48d9e |
|
06-Nov-2012 |
Dave Reisner <dreisner@archlinux.org> |
Implement SocketUser= and SocketGroup= for [Socket]
Since we already allow defining the mode of AF_UNIX sockets and FIFO, it
makes sense to also allow specific user/group ownership of the socket
file for restricting access. |
0eb59ccfe619cbc4b42ef8ff02b52971994dfe05 |
|
30-Oct-2012 |
Auke Kok <auke-jan.h.kok@intel.com> |
SMACK: Add configuration options. (v3)
This adds SMACK label configuration options to socket units.
SMACK labels should be applied to most objects on disk well before
execution time, but two items remain that are generated dynamically
at run time that require SMACK labels to be set in order to enforce
MAC on all objects.
Files on disk can be labelled using package management.
For device nodes, simple udev rules are sufficient to add SMACK labels
at boot/insertion time.
Sockets can be created at run time and systemd does just that for
several services. In order to protect FIFO's and UNIX domain sockets,
we must instruct systemd to apply SMACK labels at runtime.
This patch adds the following options:
Smack - applicable to FIFO's.
SmackIpIn/SmackIpOut - applicable to sockets.
No external dependencies are required to support SMACK, as setting
the labels is done using fsetxattr(). The labels can be set on a
kernel that does not have SMACK enabled either, so there is no need
to #ifdef any of this code out.
For more information about SMACK, please see Documentation/Smack.txt
in the kernel source code.
v3 of this patch changes the config options to be CamelCased. |
b87705cdd2f791f8520edb78791d3e6f78afd481 |
|
16-Oct-2012 |
Lennart Poettering <lennart@poettering.net> |
mount: don't try to initialize extra deps for mount units before initializing their basic fields
Under some circumstances this could lead to a segfault since we we
half-initialized a mount unit, then tried to hook it into the network of
things and while doing that recursively ended up looking at our
half-initialized mount unit again assuming it was fully initialized. |
67445f4e22ad924394acdd4fd49e6f238244a5ca |
|
18-Sep-2012 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core: move ManagerRunningAs to shared
Note: I did s/MANAGER/SYSTEMD/ everywhere, even though it makes the
patch quite verbose. Nevertheless, keeping MANAGER prefix in some
places, and SYSTEMD prefix in others would just lead to confusion down
the road. Better to rip off the band-aid now. |
3ef63c317481c2b3f1fe39e1b0f130aac3544522 |
|
18-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
unit-printf: before resolving exec context specifiers check whether the object actually has an exec context |
41f9172f427bdbb8221c64029f78364b8dd4e527 |
|
18-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
unit: split unit_printf() and friends into its own .c file |
b14eda963c698aa89fac1d91501d572ec644cc2f |
|
18-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
logind: split up inhibit acquire policy |
c65a0b146652cac52fe3c43f7cb8fe6a2ac3e063 |
|
16-Sep-2012 |
Dave Reisner <dreisner@archlinux.org> |
socket: prevent signed integer overflow
src/core/socket.c:588:25: error: overflow in implicit constant conversion
src/core/socket.c:589:17: error: overflow in implicit constant conversion |
96342de68d0d6de71a062d984dafd2a0905ed9fe |
|
14-Aug-2012 |
Lukas Nykryn <lnykryn@redhat.com> |
service: add options RestartPreventExitStatus and SuccessExitStatus
In some cases, like wrong configuration, restarting after error
does not help, so administrator can specify statuses by RestartPreventExitStatus
which will not cause restart of a service.
Sometimes you have non-standart exit status, so this can be specified
by SuccessfulExitStatus. |
cba6e0627d659a33df31aaa74d0d701c4bc9f317 |
|
20-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
units: apply default resource limits to socket/mount/swap processes too |
c74f17d96cccd4cc998fd037cb92046930188c91 |
|
20-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
core: drop KillMode parameter from KillUnit() bus call
It made no sense, and since we are documenting the bus calls now and
want to include them in our stability promise we really should get it
cleaned up sooner, not later. |
4819ff0358b6317c195fd4b1768e03d09c871070 |
|
20-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
unit: split off KillContext from ExecContext containing only kill definitions |
e06c73cc91e02a1a3dffdb0976fef754f1109e74 |
|
16-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
unit: set default working directory to the user's home directory when running in user mode |
bcbe497e5a73d889e8799f8a3680c303afede347 |
|
10-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
unit: get rid of UnitVTable.suffix, which is now unused |
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. |
d2e54fae5ca7a0f71b5ac8b356a589ff0a09ea0a |
|
31-May-2012 |
Kay Sievers <kay@vrfy.org> |
mkdir: append _label to all mkdir() calls that explicitly set the selinux context |
1b64d026af01277e332d10d9e67e2eed5a4ded28 |
|
22-May-2012 |
Lennart Poettering <lennart@poettering.net> |
units: remove service sysv_path variable and replace it by generic unit_path
UnitPath= is also writable via native units and may be used by generators
to clarify from which file a unit is generated. This patch also hooks up
the cryptsetup and fstab generators to set UnitPath= accordingly. |
c69182961b00707d977957cf81d5c41cfbeab429 |
|
14-May-2012 |
Michal Schmidt <mschmidt@redhat.com> |
unit: unit type dependent status messages
Instead of generic "Starting..." and "Started" messages for all unit use
type-dependent messages. For example, mounts will announce "Mounting..."
and "Mounted".
Add status messages to units of types that used to be entirely silent
(automounts, sockets, targets, devices). For unit types whose jobs are
instantaneous, report only the job completion, not the starting event.
Socket units with non-instantaneous jobs are rare (Exec*= is not used
often in socket units), so I chose not to print the starting messages
for them either.
This will hopefully give people better understanding of the boot. |
9eb977db5b89b44f254ab40c1876a76b7d7ea2d0 |
|
08-May-2012 |
Kay Sievers <kay@vrfy.org> |
util: split-out path-util.[ch] |
88f3e0c91f08c65a479e1aa09f171550b744d829 |
|
03-May-2012 |
Lennart Poettering <lennart@poettering.net> |
service: explicitly remove control/ subcgroup after each control command
The kernel will only notify us of cgroups running empty if no subcgroups
exist anymore. Hence make sure we don't leave our own control/ subcgroup
around longer than necessary.
https://bugzilla.redhat.com/show_bug.cgi?id=818381 |
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. |
e9a5ef7cddcfcdb29b5aef3896931132b6fd5165 |
|
17-Apr-2012 |
Kay Sievers <kay@vrfy.org> |
selinux: unify systemd and udev code |
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 |
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/ |