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 |
089b64d5f8418ffe257d07ce80077d8c6c68da15 |
|
03-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
core: move service_unwatch_control_pid() call into service_enter_running()
When we enter the running state we should forget about any control processes, in all cases, and not just when hit a
reload timeout... |
ce359e98f87c7fbe5aa1d275e43cf088ce46c2b0 |
|
03-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
core: when a service's ExecStartPre= times out, skip ExecStop=
This makes sure we never run two control processes at the same time, we cannot keep track off.
This introduces a slight change of behaviour but cleans up the definition of ExecStop= and ExecStopPost=. The former is
now invoked only if the service managed to start-up correctly. The latter is called even if start-up failed half-way.
Thus, ExecStopPost= may be used as clean-up step for both successful and failed start-up attempts, but ExecStop='s
purpose is clearly defined as being responsible for shutting down the service and nothing else.
The precise behaviour of this was not documented yet. This commit adds the necessary docs.
Fixes: #1254 |
fabab19068b6ccb894b0d2a6efbe0ad580771d05 |
|
01-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
core: no need to use unlink_noerrno() |
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 |
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 |
d8ccf5fdc91c46ab5d0ae86e38c206bc508d4188 |
|
21-Dec-2015 |
Daniel Mack <daniel@zonque.org> |
core: fix bus name synchronization after daemon-reload
During daemon-reload, PID1 temporarly loses its DBus connection, so there's
a small window in which all signals sent by dbus-daemon are lost.
This is a problem, since we rely on the NameOwnerChanged signals in order to
consider a service with Type=dbus fully started or terminated, respectively.
In order to fix this, a rewrite of bus_list_names() is necessary. We used
to walk the current list of names on the bus, and blindly triggered the
bus_name_owner_change() callback on each service, providing the actual name
as current owner. This implementation has a number of problems:
* We cannot detect if the the name was moved from one owner to the other
while we were reloading
* We don't notify services which missed the name loss signal
* Providing the actual name as current owner is a hack, as the comment also
admits.
To fix this, this patch carries the following changes:
* Track the name of the current bus name owner, and (de-)serialize it
during reload. This way, we can detect changes.
* In bus_list_names(), walk the list of bus names we're interested in
first, and then see if the name is active on the bus. If it is,
check it it's still the same as it used to be, and synthesize
NameOwnerChanged signals for the name add and/or loss.
This should fully synchronize the current name list with the internal
state of all services. |
366b7db4b65b994cd33cf4fd3c1be429be561307 |
|
01-Dec-2015 |
Klearchos Chaloulos <klearchos.chaloulos@nokia.com> |
journal-remote: split-mode=host, remove port from journal filename
When constructing the journal filename to store logs from a remote host, remove the port of the tcp connection, as the port will change with every reboot/connection loss between sender/reveiver machines. Having the port in the filename will cause a new journal file to be created for every reboot or connection loss.
For the implementation, a new argument "bool include_port" is added to the getpeername_pretty() function. This is passed to the sockaddr_pretty() function. The value of the include_port argument is set to true in all calls of getpeername_pretty(), except for 2 calls in journal-remote.c, where it is set to false. |
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. |
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. |
92bed4620a6d9b1b1b05e25d827d55f626a0ce2c |
|
12-Nov-2015 |
Torstein Husebø <torstein@huseboe.net> |
core: fix typo |
45f06b3450174a9649a51a0b48fdbbbe98f2bb5d |
|
11-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
core: pull in dbus.socket from Type=dbus services
Do so only on non-kdbus systems. And on non-kdbus systems don't bother
with .busname units. |
cb4c247d48fc195e64dd895a4e9dc8162ae62b23 |
|
11-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
core: change default deps of services to require sysinit.target instead of basic.target
With this change services by default will no longer require
basic.target, but instead only after it it via After=basic.target.
However, they will still Require= on sysinit.target.
This has the benefit that when booting into emergency mode it is
relatively safe to actviate individual services, as this will not pull
the entirety of basic.target anymore, thus avoid everything listed in
sockets.target and suchlike. However, during the usual boot no change
should be noticed. |
36b4a7ba555540edb7648e0f97019280b4ac38de |
|
11-Nov-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Remove snapshot unit type
Snapshots were never useful or used for anything. Many systemd
developers that I spoke to at systemd.conf2015, didn't even know they
existed, so it is fairly safe to assume that this type can be deleted
without harm.
The fundamental problem with snapshots is that the state of the system
is dynamic, devices come and go, users log in and out, timers fire...
and restoring all units to some state from the past would "undo"
those changes, which isn't really possible.
Tested by creating a snapshot, running the new binary, and checking
that the transition did not cause errors, and the snapshot is gone,
and snapshots cannot be created anymore.
New systemctl says:
Unknown operation snapshot.
Old systemctl says:
Failed to create snapshot: Support for snapshots has been removed.
IgnoreOnSnaphost settings are warned about and ignored:
Support for option IgnoreOnSnapshot= has been removed and it is ignored
http://lists.freedesktop.org/archives/systemd-devel/2015-November/034872.html |
4b1728250d75de4851bdbf4d62d3cf85f9abda60 |
|
02-Nov-2015 |
Daniel Mack <daniel@zonque.org> |
core: service: fix error message
The directive is called FileDescriptorStoreMax=, not FDStoreMax=. |
930d2838f206d725d890c78475312910cd16329a |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
service: exiting early is nicer than deeply-indented code blocks |
76583ef261c65feb6059680f95693ee582406c90 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
core: don't pass uninitialzed PIDs to pid_is_unwaited()
Since 5fd9b2c5467b0a42ccdabc7eb8e516d512609a8e passing a pid of 0 to
pid_is_unwaited() and pid_is_live() is considered as a request on the
current process, similar how the other calls in process-util.c handle a
PID of 0. This broke service.c, which passes a 0 PID and expects it to
be considered an unwaited process.
This fix make sure we can boot again. |
6bc73acb01e2782f0ef3ec70dde3dc3f5b5da081 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
process-util: rename get_parent_of_pid() → get_process_ppid()
In order to match the other get_process_xyz() calls. |
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] |
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move a number of fs operations into fs-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] |
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. |
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split out escaping code into escape.[ch]
This really deserves its own file, given how much code this is now. |
ac5b0c13d8023745c0fbdaaa95dcec5b7b21d1e2 |
|
19-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: add more void casts for various syscall invocations |
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. |
17dec0f703bea85d6cbbae2a75d7960a5f6bb666 |
|
07-Oct-2015 |
reverendhomer <mk.43.ecko@gmail.com> |
service: fix memory leak in service_add_fd_store()
fixes Coverity #1325767 |
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. |
95c906ae0727123e45a9d88782133cac4554ddcd |
|
03-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
core: don't unset reload result, unless we begin a start or reload operation
Much like the result of the service itself we should not reset the
reload result unless we actually start from the beginning, so that
clients can query it at any time.
Specifically, let's reset the result states only when we begin with a
start operation (for both the main result, and the reload result), when
we begin with a reload operation (only for the load result), or when the
use explicitly asks for that via "systemctl reset-failed".
This is a more generic fix for #1447.
Fixes #1447. |
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. |
478b619281667f4a5b5fa2f7f8c4feebb1852949 |
|
11-Sep-2015 |
Evgeny Vereshchagin <evvers@ya.ru> |
core: kill processes started due to the ExecReload= on timeout |
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. |
ece174c5439021e32ebcc858842de9586072c006 |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: drop {} from one-line if blocks
Patch via coccinelle. |
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. |
efdb02375beb0a940c3320865572913780b4d7de |
|
01-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
core: unified cgroup hierarchy support
This patch set adds full support the new unified cgroup hierarchy logic
of modern kernels.
A new kernel command line option "systemd.unified_cgroup_hierarchy=1" is
added. If specified the unified hierarchy is mounted to /sys/fs/cgroup
instead of a tmpfs. No further hierarchies are mounted. The kernel
command line option defaults to off. We can turn it on by default as
soon as the kernel's APIs regarding this are stabilized (but even then
downstream distros might want to turn this off, as this will break any
tools that access cgroupfs directly).
It is possibly to choose for each boot individually whether the unified
or the legacy hierarchy is used. nspawn will by default provide the
legacy hierarchy to containers if the host is using it, and the unified
otherwise. However it is possible to run containers with the unified
hierarchy on a legacy host and vice versa, by setting the
$UNIFIED_CGROUP_HIERARCHY environment variable for nspawn to 1 or 0,
respectively.
The unified hierarchy provides reliable cgroup empty notifications for
the first time, via inotify. To make use of this we maintain one
manager-wide inotify fd, and each cgroup to it.
This patch also removes cg_delete() which is unused now.
On kernel 4.2 only the "memory" controller is compatible with the
unified hierarchy, hence that's the only controller systemd exposes when
booted in unified heirarchy mode.
This introduces a new enum for enumerating supported controllers, plus a
related enum for the mask bits mapping to it. The core is changed to
make use of this everywhere.
This moves PID 1 into a new "init.scope" implicit scope unit in the root
slice. This is necessary since on the unified hierarchy cgroups may
either contain subgroups or processes but not both. PID 1 hence has to
move out of the root cgroup (strictly speaking the root cgroup is the
only one where processes and subgroups are still allowed, but in order
to support containers nicey, we move PID 1 into the new scope in all
cases.) This new unit is also used on legacy hierarchy setups. It's
actually pretty useful on all systems, as it can then be used to filter
journal messages coming from PID 1, and so on.
The root slice ("-.slice") is now implicitly created and started (and
does not require a unit file on disk anymore), since
that's where "init.scope" is located and the slice needs to be started
before the scope can.
To check whether we are in unified or legacy hierarchy mode we use
statfs() on /sys/fs/cgroup. If the .f_type field reports tmpfs we are in
legacy mode, if it reports cgroupfs we are in unified mode.
This patch set carefuly makes sure that cgls and cgtop continue to work
as desired.
When invoking nspawn as a service it will implicitly create two
subcgroups in the cgroup it is using, one to move the nspawn process
into, the other to move the actual container processes into. This is
done because of the requirement that cgroups may either contain
processes or other subgroups. |
6f883237f1b8a96ec0ea354866e033b6fcea9506 |
|
01-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
cgroup: drop "ignore_self" argument from cg_is_empty()
In all cases where the function (or cg_is_empty_recursive()) ignoring
the calling process is actually wrong, as a process keeps a cgroup busy
regardless if its the current one or another. Hence, let's simplify
things and drop the "ignore_self" parameter. |
957c3cf97cd0063a3b78aa068d5351ae3b1b0c0c |
|
01-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
unit: suppress unnecessary cgroup empty check
Rework the "service is good" check, to only check the cgroup state if we
really need to instead of always.
This allows us to suppress going to the cgroupfs for an empty check for
the majority of services.
No functional change. |
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. |
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 |
fc1ba5d1933d83c73cf9ddb61e8a2da2b15e26e1 |
|
24-Jul-2015 |
Lennart Poettering <lennart@poettering.net> |
core: print a nicer warning when two units have the same BusName= setting
This should make issues like #609 easier to debug. |
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. |
2d018ae23b838f050516d06859f50ecb9733d44b |
|
21-Jul-2015 |
Michal Schmidt <mschmidt@redhat.com> |
core: correct return value from reload methods
Return 1 from *_reload() methods to signify "we did something", just
like in *_start(). This causes "Reloading foo..." messages to be logged.
"Reloaded foo." messages are already logged. |
fc08079ef25a063f56be48b87035f8fde79153ba |
|
07-Jul-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
treewide: fix typos of let's |
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. |
de1d4f9b5c6345f63edd46f643485eca909995bf |
|
11-Jun-2015 |
Werner Fink <werner@suse.de> |
core: Let two more booleans survive a daemon-reload
Without the boolean bus_name_good services as well as cgroup_realized
for units a unit of Type=dbus and ExecReload sending SIGHUP to $MAINPID
will be terminated if systemd will be daemon reloaded.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=746151
https://bugs.freedesktop.org/show_bug.cgi?id=78311
https://bugzilla.opensuse.org/show_bug.cgi?id=934077 |
24882e06c135584f16f31ba8a00fecde8b7f6fad |
|
29-May-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split out signal-util.[ch] from util.[ch]
No functional changes. |
34959677900a45aa67f511e828c68167f8a7c816 |
|
12-May-2015 |
Tom Gundersen <teg@jklm.no> |
core: drop redundant logging about notification messages
Before:
May 12 17:11:22 tomegun-x2402 systemd[1]: systemd-udevd.service: Got notification message for unit.
May 12 17:11:22 tomegun-x2402 systemd[1]: systemd-udevd.service: Got notification message from PID 195 (READY=1)
May 12 17:11:22 tomegun-x2402 systemd[1]: systemd-udevd.service: Ggot READY=1
After:
May 12 17:11:22 tomegun-x2402 systemd[1]: systemd-udevd.service: Got notification message from PID 195 (READY=1) |
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. |
7dfbe2e3fc0215b49d8202a32beb6b1aae08c4e4 |
|
29-Apr-2015 |
Tom Gundersen <teg@jklm.no> |
core: annotate event sources |
a509f0e631b12cfec6aafe4d152532109082efc9 |
|
28-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
service: make restart logic a bit easier to understand |
597466f49752a52e85ea04051d020f97e8739f72 |
|
28-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
exit-status: introduce common exit_status_set_test() call for testing exit status set membership |
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. |
f06db33455f5134c5c94b71a5b1d94cc9d0d630c |
|
24-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
service: improve readability, by reducing line-breaks |
1db0db4b7f9c53f03efef2037ef6b0b384bfb248 |
|
21-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
service: transition through SIGKILL states only when SIGKILL is enabled
If there's no remaining process to kill, skip the SIGKILL states if
SIGKILL is disabled.
Effectively this doesn't change much since if there's nothing to kill
with SIGTERM or SIGABRT then there's also nothing to kill with SIGKILL.
However, this avoids confusion with the state engine jumping through
SIGKILL states for no reason... |
2ab2ab7b19de7b4e1ef977a6c056ce0b525c198a |
|
21-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
service: timeout on SIGABRT should also be considered an error to remember |
a00973af276f6e861aaf84cf4cae824223597b7f |
|
21-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
service: make more use of IN_SET() macro |
57614eb1a32680846adb6e5d2197da3313419b53 |
|
21-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
service: list states always in the same order |
4940c0b0b621c0d5a4a3c1f3bc281ecba6151c58 |
|
21-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
service: make kill operation mapping explicit |
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 |
6962fd3bd28cb5d3aaff69c1e3b6cc006e7c8426 |
|
14-Mar-2015 |
Michael Biebl <biebl@debian.org> |
service: don't add After= dependencies on .busname units if kdbus support is disabled |
3b1c524154c876aecebc98787975cc2943100210 |
|
10-Mar-2015 |
Shawn Landden <shawn@churchofgit.com> |
add REMOTE_ADDR and REMOTE_PORT for Accept=yes |
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. |
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. |
8545f7ceaa57734236e54614897d40b673a16795 |
|
07-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
service: automatically create After= dependency from services to their .busname units, if BusName= is set |
2339fc936a1f0b1c60cc8a3446a1dbf994c6aaf3 |
|
07-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
core: implement serialization/deserialization of fd store elements |
a354329f724d6ce913d2ccffb2be8f3327a67faa |
|
06-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
core: add new logic for services to store file descriptors in PID 1
With this change it is possible to send file descriptors to PID 1, via
sd_pid_notify_with_fds() which PID 1 will store individually for each
service, and pass via the usual fd passing logic on next invocation.
This is useful for enable daemon reload schemes where daemons serialize
their state to /run, push their fds into PID 1 and terminate, restoring
their state on next start from the data in /run and passed in from PID
1.
The fds are kept by PID 1 as long as no POLLHUP or POLLERR is seen on
them, and the service they belong to are either not dead or failed, or
have a job queued. |
b1491eba40715438b0ac874f2be79d5622b971e1 |
|
09-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
core: rename unit_destroy_cgroup() to unit_destroy_cgroup_if_empty() since it's not quite as destructive as it sounds nowadays |
9e37c9544b22aab2173695ac9c0e4b8bb02cb75c |
|
01-Dec-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core: warn and ignore SysVStartPriority=
Option was being parsed but not used for anything. |
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);/' |
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. |
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. |
1378a3b5a10444e6c9a17084c65032b4e1061c8e |
|
28-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
service: add missing state table entry |
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. |
056f95d0a70413e10e4a4ea9966baabb5a1450ed |
|
22-Oct-2014 |
Daniel Mack <daniel@zonque.org> |
sd-bus: rename sd_bus_get_owner_uid(), sd_bus_get_owner_machine_id() and sd_bus_get_peer_creds()
Clean up the function namespace by renaming the following:
sd_bus_get_owner_uid() → sd_bus_get_name_creds_uid()
sd_bus_get_owner_machine_id() → sd_bus_get_name_machine_id()
sd_bus_get_peer_creds() → sd_bus_get_owner_creds() |
a158dbf156acc8899806fe07daa295464e82b52b |
|
12-Oct-2014 |
Brandon L Black <blblack@gmail.com> |
Set $NOTIFY_SOCKET for control procs if NotifyAccess=all |
6041a7ee2c1bbff6301082f192fc1b0882400d42 |
|
09-Oct-2014 |
Michal Schmidt <mschmidt@redhat.com> |
service: enter SERVICE_STOP_SIGTERM state after getting "STOPPING=1"
SERVICE_STOP would mean we're running the ExecStop command. That's not
the case with "STOPPING=1".
Instead we should enter the same state as if we just told the service
to stop, i.e. SERVICE_STOP_SIGTERM.
This fixes a bug where voluntarily exiting services would hang around in
deactivating state until timeout. |
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> |
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. |
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. |
2928b0a863091f8f291fddb168988711afd389ef |
|
22-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
core: add support for a configurable system-wide start-up timeout
When this system-wide start-up timeout is hit we execute one of the
failure actions already implemented for services that fail.
This should not only be useful on embedded devices, but also on laptops
which have the power-button reachable when the lid is closed. This
devices, when in a backpack might get powered on by accident due to the
easily reachable power button. We want to make sure that the system
turns itself off if it starts up due this after a while.
When the system manages to fully start-up logind will suspend the
machine by default if the lid is closed. However, in some cases we don't
even get as far as logind, and the boot hangs much earlier, for example
because we ask for a LUKS password that nobody ever enters.
Yeah, this is a real-life problem on my Yoga 13, which has one of those
easily accessible power buttons, even if the device is closed. |
96fb8242cc1ef6b0e28f6c86a4f57950095dd7f1 |
|
21-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
service: allow services of Type=oneshot that specify no ExecStart= commands
This is useful for services that simply want to run something on
shutdown, but not at bootup. They should only set ExecStop= but leave
ExecStart= unset. |
21b2ce39d4038cd6176394836fdcfb7fba63f424 |
|
21-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
service: use the right timeout for stop processes we fork |
308d72dc1e2106f94ae637e2ea510e8d466d2af1 |
|
21-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
core: allow informing systemd about service status changes with RELOADING=1 and STOPPING=1 sd_notify() messages |
28849dbadb7cd127f7f89e8892ec94c6a05070da |
|
21-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
service,strv: introduce strv_find_startswith() and make use of it
Unlike strv_find_prefix() the new call will return a pointer to the
suffix of the item we found, instead of the whole item. This is more
closer inline with what startswith() does, and allows us to simplify a
couple of invocations. |
f49650cee2c5256dc0491432e1f12a4ae19be6c5 |
|
21-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
service: don't invoke functions at the same time as declaring variables |
8bb2d17d2b89e87b2e9d8f6c147a757f4670b0fc |
|
21-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
service: remove some pointless linebreaks, to make things more readable |
abb4c1cc0161cc6b371ee7ea2550df17a3bfc21e |
|
21-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
service: asynchronous_close() already checks for negative parameters, no need to duplicate that |
4c94096027f21d4ed0efe991534a926d39d52369 |
|
21-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
core: unify how we generate the prefix string when dumping unit state |
a7850c7d1339b490ac021ff82c2081285ea28503 |
|
19-Jul-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core: show timeouts when watchdog howls |
8cfdb077b8e3da1c47fc1d735d051f21f33144c1 |
|
07-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
service: flush status text and errno values each time a service is started
We shouldn't show status texts from previous service starts |
2040ccf171404b709acb0ecf1d1f17b87c5d05f0 |
|
07-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
service: don't accept negative ERRNO= notification messages |
5e56b378b40dc4dc5557e653487b608fd91fcc26 |
|
07-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
service: minor modernization |
4774e357268e4a1e9fa82adb0563a538932a4c8e |
|
07-Jul-2014 |
Miguel Angel Ajo <mangelajo@redhat.com> |
core: Added support for ERRNO NOTIFY_SOCKET message parsing, and added StatusErrno dbus property along StatusText to allow notification of numeric status condition while degraded service operation or any other special situation. |
55ebf98cbecdad288ba2e3f63f7026280c62f025 |
|
03-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
core: introduce exit_status_set_is_empty() to make things a bit easier to read |
3e2d435b3d2247a60d6def932d28a4856566a7d7 |
|
03-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
exit-status: rename ExitStatusSet's "code" field to "status"
We should follow the naming scheme waitid() uses, not come up with our
own reversed one... |
37520c1bec9a92adbe02fceaece588a7aa2fea2b |
|
03-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
core: introduce new RestartForceExitStatus= service setting
This does the inverse of RestartPreventExitStatus=: it forces a restart
of a service when a certain exit status is returned by a service
process. |
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)" |
6cfe2fde1cc919c2333a5749ea1cbc31fa757077 |
|
05-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
core: introduce new Restart=on-abnormal setting
Restart=on-abnormal is similar to Restart=on-failure, but avoids
restarts on unclean exit codes (but still doing restarts on all
obviously unclean exits, such as timeouts, signals, coredumps, watchdog
timeouts).
Also see:
https://fedorahosted.org/fpc/ticket/191 |
574634bcacb01efe15ca2742effd461a5b7afb5f |
|
15-May-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core: close socket fds asynchronously
http://lists.freedesktop.org/archives/systemd-devel/2014-April/018928.html |
e30bb6b53b0ae1d1da99c52266d9dec8c6ba0ae4 |
|
14-May-2014 |
Tom Gundersen <teg@jklm.no> |
core: sysvcompat - avoid repeated function call |
0404c609f399b2092a3de52eef9d75b0dc12e94c |
|
14-May-2014 |
Tom Gundersen <teg@jklm.no> |
core: sysvcompat - $network should be equivalent to network-online, rather than network target
Most likely the facility needed is actual connectivity, rather than whether or not the
network managment daemon is running.
We also need to explicitly pull in the network-online.target, as it is not active by
default.
This means {systemd-networkd,NetworkManager}-wait-online.service, can be enabled by default
as part of network-online.target, and only delay boot when some service actively pulls it in.
See: <https://bugzilla.gnome.org/show_bug.cgi?id=728965>
Cc: Pavel Å imerda <psimerda@redhat.com>
Cc: Michal Sekletar <msekleta@redhat.com> |
bf500566323bbc2240d1fdd1165a8c908faf4098 |
|
24-Apr-2014 |
Michael Olbrich <m.olbrich@pengutronix.de> |
service: rename StartLimitAction enum to FailureAction
It's used for the FailureAction property as well. |
93ae25e6fd62b2f87c3dd9ad3e81934eecc48057 |
|
24-Apr-2014 |
Michael Olbrich <m.olbrich@pengutronix.de> |
service: add FailureAction= option
It has the same possible values as StartLimitAction= and is executed
immediately if a service fails. |
efe6e7d33a9feb0b647c77862016284457895fa6 |
|
21-Apr-2014 |
Michael Olbrich <m.olbrich@pengutronix.de> |
service: add support for reboot argument when triggered by StartLimitAction=
When rebooting with systemctl, an optional argument can be passed to the
reboot system call. This makes it possible the specify the argument in a
service file and use it when the service triggers a restart.
This is useful to distinguish between manual reboots and reboots caused by
failing services. |
1c07b16c2f98e03d44f1dff5343110c60934ff07 |
|
24-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
service: don't take chkconfig priority into account
Given that native services do not carry a sysv priority anyway it is
pointless reading them from chkconfig headers, and pretend they'd work.
So let's drop this. |
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. |
6f285378aa6e4b5b23c939d1fea16f9ab0a57efb |
|
17-Mar-2014 |
Miklos Vajna <vmiklos@vmiklos.hu> |
core, libsystemd, systemd, timedate, udev: spelling fixes |
f8294e4175918117ca6c131720bcf287eadcd029 |
|
16-Mar-2014 |
Josh Triplett <josh@joshtriplett.org> |
Use strlen even for constant strings
GCC optimizes strlen("string constant") to a constant, even with -O0.
Thus, replace patterns like sizeof("string constant")-1 with
strlen("string constant") where possible, for clarity. In particular,
for expressions intended to add up the lengths of components going into
a string, this often makes it clearer that the expression counts the
trailing '\0' exactly once, by putting the +1 for the '\0' at the end of
the expression, rather than hidden in a sizeof in the middle of the
expression. |
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. |
bdd13f6be4b588568683a1ab54f421fc6a636dbb |
|
25-Feb-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Remove dead lines in various places
As pointed-out by clang -Wunreachable-code.
No behaviour changes. |
085afe36cb823e7d5b8c5f3ef21ebb9639bac78b |
|
24-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
core: add global settings for enabling CPUAccounting=, MemoryAccounting=, BlockIOAccounting= for all units at once |
ef417cfd2211ae017a38b9796c6db29130133e63 |
|
21-Feb-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
manager: be more precise in message about restart |
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. |
9f5650aecb22a1d864b2c0b749910556795f1490 |
|
18-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
util: generalize code that checks whether PIDs are alive or unwaited for |
e3025da104f96ab428a9121f738c6343964d5260 |
|
16-Feb-2014 |
Yuxuan Shui <yshuiv7@gmail.com> |
core: check for return value from get_process_state
Fix for commit e10c9985bb. |
e10c9985bbc3cf79f12f9ec7317adfe697fa8214 |
|
15-Feb-2014 |
Yuxuan Shui <yshuiv7@gmail.com> |
core: fix detection of dead processes
Commit 5ba6985b moves the UNIT_VTABLE(u)->sigchld_event before systemd
actually reaps the zombie. Which leads to service_load_pid_file accepting
zombie as a valid pid.
This fixes timeouts like:
[ 2746.602243] systemd[1]: chronyd.service stop-sigterm timed out. Killing.
[ 2836.852545] systemd[1]: chronyd.service still around after SIGKILL. Ignoring.
[ 2927.102187] systemd[1]: chronyd.service stop-final-sigterm timed out. Killing.
[ 3017.352560] systemd[1]: chronyd.service still around after final SIGKILL. Entering failed mode. |
3a33e61d2df24b6b2dec6176930562f93b3c4347 |
|
14-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
service: when we complain about a notify message we cannot map to main pid because we don't know anything about the main pid, do so at debug level |
336c6e4690ea017a11799aa331ffedd4c59a31ad |
|
14-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
service: if we don't know the main pid of a service, we cannot accept any notification messages |
a911bb9ab27ac0eb3bbf4e8b4109e5da9b88eee3 |
|
07-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
core: watch SIGCHLD more closely to track processes of units with no reliable cgroup empty notifier
When a process dies that we can associate with a specific unit, start
watching all other processes of that unit, so that we can associate
those processes with the unit too.
Also, for service units start doing this as soon as we get the first
SIGCHLD for either control or main process, so that we can follow the
processes of the service from one to the other, as long as process that
remain are processes of the ones we watched that died and got reassigned
to us as parent.
Similar, for scope units start doing this as soon as the scope
controller abandons the unit, and thus management entirely reverts to
systemd. To abandon a unit introduce a new Abandon() scope unit method
call. |
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. |
ebc2259da1d1579347b86fc2ebca9f96334b6f22 |
|
29-Jan-2014 |
Lennart Poettering <lennart@poettering.net> |
service: allow KillMode=mixed in conjunction with PAMName= |
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. |
ca76186598c56da9f08b7eb55b6915d9e2344570 |
|
06-Jan-2014 |
Kay Sievers <kay@vrfy.org> |
core: do not add implicit dbus.socket dependency
Sockets are ordered before sockets.target anyway, and sockets.target
is ordered before basic.target, and hence all bus services end up
being ordered after dbus.socket anyway. Since for kdbus clients
dbus.socket is obsolete, let's not add this dependency explicitly.
Also, it's hot in Australia and we are going for breakfast now. |
fccd44ec3a7abd305b558d39f54b5ef223f00b68 |
|
06-Jan-2014 |
Kay Sievers <kay@vrfy.org> |
core: --user -- add basic.target an sort against it like --system does |
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. |
da13d4d20f8ca12e86863abbae5ed47bca936828 |
|
03-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core/service: check if mainpid matches only if it is set
https://bugzilla.redhat.com/show_bug.cgi?id=1047304 |
41aef6fc747a3b5b8bf47faa468881be16509c66 |
|
03-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core/service: tweak messages on operation timeouts |
79a98c609da042c60260e8e0236464014d480dcb |
|
25-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
unit: include peer identity in description of per-connection socket-activated services |
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 |
30b5275ac775264fa94490ac88c1e35bc6b90b40 |
|
19-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
service: don't send out PropertiesChanged message for each watchdog notification |
bf108e5541e2a3cbc6f0c59e93665eceb7a5ce05 |
|
18-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
service: watch main pid even in final states
In some circumstances, for example when start-up times out we
immediately jump into the final state, at which point we still should
try to watch the main pid so that the SIGCHLD allows us to quickly
move into dead state. |
999b600390a2dff43d3367119ad594b7c40ed50d |
|
16-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
systemctl: properly initialize and free sd_bus_error in "systemctl cat"
We need to properly initialize all error structs before use and free
them after use.
Also, there's no point in flushing stdout if we output a \n anyway... |
c4ef331782b4c0c615a258d3a4e6c71d8ccc67e1 |
|
12-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
service: process watchdog timeouts with lowest priority |
7596e9e10a433c2104a2616dd8dd429a4243e38a |
|
12-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
service: actually leave watchdog enabled in the states where it matters |
842129f58752864d4433792c9c47d40508c4439a |
|
11-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
service: clean up watchdog logic a bit |
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. |
99f37ad86e114b2d1c9eaedf2bc1a0004a265d26 |
|
02-Dec-2013 |
Shawn Landden <shawn@churchofgit.com> |
service: remove unneccesary Socket.got_socket_fd |
49b832c5b810f4d8bb59249ff25472fd670503dc |
|
30-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: include unique and well known names in credentials object |
a4297f08ed774ed6d980b6cadaf844bfb2c7a403 |
|
28-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: merge sd_bus_get_owner() and sd_bus_get_owner_creds() into one call
Since the backing ioctl for this on kdbus is the same we retain
atomicity this way. |
5b12334d35eadf1f45cc3d631fd1a2e72ffaea0a |
|
28-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: add new sd_bus_creds object to encapsulate process credentials
This way we can unify handling of credentials that are attached to
messages, or can be queried for bus name owners or connection peers.
This also adds the ability to extend incomplete credential information
with data from /proc,
Also, provide a convenience call that will automatically determine the
most appropriate credential object for an incoming message, by using the
the attached information if possible, the sending name information if
available and otherwise the peer's credentials. |
613b411c947635136637f8cdd66b94512f761eab |
|
27-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
service: add the ability for units to join other unit's PrivateNetwork= and PrivateTmp= namespaces |
f5f6d0e25574dd63fb605b81fa7767dd71c454db |
|
26-Nov-2013 |
Daniel Buch <boogiewasthere@gmail.com> |
tree-wide usage of %m specifier instead of strerror(errno)
Also for log_error() except where a specific error is specified
e.g. errno ? strerror(errno) : "Some user specified message" |
e14c280244fc07a19d0acab2f08c9f783458af34 |
|
25-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
service: fix handling of PID file inotify events |
92c1622e14dd99890928b1a1596e4a670b31a7ff |
|
22-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
service: honour that for services RestartSec=0 means immediate restarts but TimeoutSec= means no timing out at all |
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. |
9cd861842ccb07372fbd665f2e6c054daaedacb4 |
|
16-Nov-2013 |
Olivier Brunel <jjk@jjacky.com> |
Fix RemainAfterExit services keeping a hold on console
When a service exits succesfully and has RemainAfterExit set, its hold
on the console (in m->n_on_console) wasn't released since the unit state
didn't change. |
3f41e1e5955552a771748225334b3e8a7eb02b8a |
|
08-Nov-2013 |
Lukas Nykryn <lnykryn@redhat.com> |
manager: configurable StartLimit default values
https://bugzilla.redhat.com/show_bug.cgi?id=821723 |
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. |
accdd018ede77ef1c057775396c18c73406cbcb4 |
|
19-Oct-2013 |
Tom Gundersen <teg@jklm.no> |
mount/service: drop FsckPassNo support
We now treat passno as boleans in the generators, and don't need this any more. fsck itself
is able to sequentialize checks on the same local media, so in the common case the ordering
is redundant.
It is still possible to force an order by using .d fragments, in case that is desired. |
8d1a28020409ee4afea6ef8c1c4d3522a209284e |
|
09-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
core: unify the way we denote serialization attributes |
6aca9a587d4ad40b1c044f99e3714022201b9fd4 |
|
08-Oct-2013 |
Sylvia Else <sylviabz1@cryogenic.net> |
systemd: serialize/deserialize forbid_restart value
The Service type's forbid_restart field was not preserved by
serialization/deserialization, so the fact that the service should not
be restarted after stopping was lost.
If a systemctl stop foo command has been given, but the foo service
has not yet stopped, and then the systemctl --system daemon-reload was
given, then when the foo service eventually stopped, systemd would
restart it.
https://bugs.freedesktop.org/show_bug.cgi?id=69800 |
7400b9d2e99938d17b281d7df43680eade18666e |
|
01-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
core: whenever a new PID is passed to us, make sure we watch it |
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 |
dc99a9764418a1974c46c55efa73b034f530a5a5 |
|
12-Sep-2013 |
Hannes Reinecke <hare@suse.de> |
service: Implement 'on-watchdog' restart option
Services using the watchdog option might want to be restarted
only if the watchdog triggers. |
9285c9ff263d90439810735ddca074b4b4193f05 |
|
10-Sep-2013 |
Lukas Nykryn <lnykryn@redhat.com> |
service: remove pidfile after exit of a service |
b0693d30863a36da63d2a2732aa298fff6d34d0d |
|
09-Aug-2013 |
Maciej Wereski <m.wereski@partner.samsung.com> |
service: prohibit Restart= set when Type=oneshot |
41efeaec037678ac790e2a02df9020f83cc3a359 |
|
09-Aug-2013 |
Lennart Poettering <lennart@poettering.net> |
service: always unwatch PIDs before forgetting old ones |
c961869ac580f5a3aea3737f9e45af71b0983662 |
|
18-Jul-2013 |
Michael Olbrich <m.olbrich@pengutronix.de> |
service: don't enter a second SIGTERM/SIGKILL cycle if no ExecStopPost= process is defined
It won't help if the main process is still there and there is no new
process to kill. |
6c12b52e19640747e96f89d85422941a23dc6b29 |
|
01-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
core: add new "scope" unit type for making a unit of pre-existing processes
"Scope" units are very much like service units, however with the
difference that they are created from pre-existing processes, rather
than processes that systemd itself forks off. This means they are
generated programmatically via the bus API as transient units rather
than from static configuration read from disk. Also, they do not provide
execution-time parameters, as at the time systemd adds the processes to
the scope unit they already exist and the parameters cannot be applied
anymore.
The primary benefit of this new unit type is to create arbitrary cgroups
for worker-processes forked off an existing service.
This commit also adds a a new mode to "systemd-run" to run the specified
processes in a scope rather then a transient service. |
c2756a68401102786be343712c0c35acbd73d28d |
|
28-Jun-2013 |
Lennart Poettering <lennart@poettering.net> |
core: add transient units
Transient units can be created via the bus API. They are configured via
the method call parameters rather than on-disk files. They are subject
to normal GC. Transient units currently may only be created for
services (however, we will extend this), and currently only ExecStart=
and the cgroup parameters can be configured (also to be extended).
Transient units require a unique name, that previously had no
configuration file on disk.
A tool systemd-run is added that makes use of this functionality to run
arbitrary command lines as transient services:
$ systemd-run /bin/ping www.heise.de
Will cause systemd to create a new transient service and run ping in it. |
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. |
62220cf70e381f6e08390523e4696f7bc431f927 |
|
10-Jun-2013 |
Ross Lagerwall <rosslagerwall@gmail.com> |
service: don't report alien child as alive when it's not
When a sigchld is received from an alien child, main_pid is set to
0 then service_enter_running calls main_pid_good to check if the
child is running. This incorrectly returned true because
kill(main_pid, 0) would return >= 0.
This fixes an error where a service would die and the cgroup would
become empty but the service would still report as active (running). |
af4713396cff773beb56fef23cd8a9a3803670ab |
|
06-Jun-2013 |
Lennart Poettering <lennart@poettering.net> |
service: execute ExecStopPost= commands when the watchdog timeout hits
We can assume that a service for which a watchdog timeout was triggered
is unresponsive to a clean shutdown. However, it still makes sense to
execute the post-stop cleanup commands that can be configured with
ExecStopPost=. Hence, when the timeout is hit enter STOP_SIGKILL rather
than FINAL_SIGKILL. |
9e9c3abcfa6b93500960531d0d7aa64b8b2b0349 |
|
21-May-2013 |
Michael Olbrich <m.olbrich@pengutronix.de> |
service: kill processes with SIGKILL on watchdog failure
Just calling service_enter_dead() does not kill any processes.
As a result, the old process may still be running when the new one is
started.
After a watchdog failure the service is in an undefined state.
Using the normal shutdown mechanism makes no sense. Instead all processes
are just killed and the service can try to restart. |
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. |
a827e37371be78ba7eda63fa6edca1074c431524 |
|
30-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
man: clarify what Restart= means
Related to https://bugzilla.redhat.com/show_bug.cgi?id=957135. |
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 |
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. |
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. |
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 |
ce2c2265376c22c16b4c9bff3ac2d402ddbeda03 |
|
25-Mar-2013 |
Frederic Crozat <fcrozat@suse.com> |
core: ensure LSB Provides are handled correctly
Let's say you have two initscripts, A and B:
A contains in its LSB header:
Required-Start: C
and B contains in its LSB header:
Provides: C
When systemd is parsing /etc/rc.d/, depending on the file order, you
can end up with either:
- B is parsed first. An unit "C.service" will be "created" and will be
added as additional name to B.service, with unit_add_name. No bug.
- A is parsed first. An unit "C.service" is created for the
"Required-Start" dependency (it will have no file attached, since
nothing provides this dependency yet). Then B is parsed and when trying
to handle "Provides: C", unit_add_name is called but will fail, because
"C.service" already exists in manager->units. Therefore, a merge should
occur for that case. |
3f95f83c548d180cddc6b9907f8d8d72ebd5abe9 |
|
24-Mar-2013 |
Miklos Vajna <vmiklos@frugalware.org> |
service: no need to drop rc. prefix anymore
This reverts commit f5c88ec1330b61787441156de7d764a140774bd2. It is no
longer necessary, and adds unnecessary magic. |
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(). |
11dac832c75cbdd0015fb0417b9877396ea57f6f |
|
06-Mar-2013 |
Michael Biebl <biebl@debian.org> |
service: sysv - properly handle init scripts with .sh suffix
Dropping the distribution specific #ifdefs in
88516c0c952b9502e8ef1d6a1481af61b0fb422d broke the .sh suffix stripping
since we now always used the else clause of the rc. check.
We eventually want to drop the rc. prefix stripping, but for now we
assume that no sysv init script uses both an rc. prefix and .sh suffix,
so make the check for the .sh suffix and rc. prefix mutually exclusive. |
bc41f93e90f6edcc9067f3bc1085bb6c85082c00 |
|
04-Mar-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core/path: install inotify watches top-down instead of bottom-up
When watches are installed from the bottom, it is always possible
to race, and miss a file creation event. The race can be avoided
if a watch is first established for a parent directory, and then for
the file in the directory. If the file is created in the time between,
the watch on the parent directory will fire.
Some messages (mostly at debug level) are added to help diagnose
pidfile issues.
Should fix https://bugzilla.redhat.com/show_bug.cgi?id=917075. |
117dcc57930b26bd8390516624700eb2024e1bb6 |
|
03-Mar-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core/service: use cleanup functions, wrap lines |
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]) |
cd2086fe6573df923dc53ef33998c9fff8c2bda5 |
|
26-Jan-2013 |
Lennart Poettering <lennart@poettering.net> |
core: unify kill code of mount, service, socket, swap units |
90527fbb2c48ffda5c6d8f232f8993a90b2632a4 |
|
25-Jan-2013 |
Michael Olbrich <m.olbrich@pengutronix.de> |
service: make sure the watchdog timer is not restarted while stopping
A watchdog notification may be handled after the watchdog timer was stopped
while stopping the service. As a result the timer is restarted and the
service may be restarted as well.
The watchdog timestamp is initially set during startup in
service_enter_start_post() and cleared when the timer is stopped. Therefore
it can be used as an indication if the timer should be reset. |
6d594baa3fa3a361efc2a4c1da3557fc4eba960d |
|
25-Jan-2013 |
Michael Olbrich <m.olbrich@pengutronix.de> |
service: really stop watchdog timer when stopping
For services without ExecStop= the state SERVICE_STOP is never entered. as
a result the watchdog timer is not stopped and the service is restarted (if
it is configuered to restart).
Stopping the watchdog timer for SERVICE_STOP_SIGTERM as well fixes this. |
71645acac27da55d510f2e4d61cc61b4e5b93035 |
|
19-Jan-2013 |
Lennart Poettering <lennart@poettering.net> |
unit: optionally allow making cgroup attribute changes persistent |
bbc9006e6b5665073149331d75c104a33224dc19 |
|
18-Jan-2013 |
Mirco Tischler <mt-ml@gmx.de> |
core: log USER_UNIT instead of UNIT if in user session |
464876c9c410b2f5bb997259510a13d0ee7d0af0 |
|
17-Jan-2013 |
Lennart Poettering <lennart@poettering.net> |
service: properly signal permanent failure of a service to its socket
This makes sure that a service is not indefinitely restarted in a tight
loop if it fails before it is able to process its socket.
This corrects the breakage introduced with
8d1b002a2e389e79a2414491523de549783abf73. Shame on me. |
5d4caf565471ff3401bd9b53aa814c8545a18a93 |
|
16-Jan-2013 |
Lennart Poettering <lennart@poettering.net> |
service: ignore dependencies on $syslog and $local_fs in LSB scripts
We no longer allow early-boot init scripts, however in late boot the
syslog socket and local mounts are established anyway, so let's simplify
our dep graph a bit.
If $syslog doesn't resolve to syslog.target anymore there's no reason to
keep syslog.target around anymore. Let's remove it.
Note that many 3rd party service unit files order themselves after
syslog.target. These will be dangling dependencies now, which should be
unproblematic, however. |
3f141375cb4ff4f850b267258e776c90df594990 |
|
16-Jan-2013 |
Kay Sievers <kay@vrfy.org> |
service: sysv - remove distribution specific targets
Systemd should not introduce any new facilities. Distributions which still
need to support their non-standard/legacy facilities should add them as
patches to their packaging.
The following facilities are no longer recognized:
$x-display-manager
$mail-transfer-agent
$mail-transport-agent
$mail-transfer-agent
$smtp
$null
This target is no longer available:
mail-transfer-agent.target |
fbeefb45ac1a257a0c5af975ad26d68ed6c39fda |
|
14-Jan-2013 |
Lennart Poettering <lennart@poettering.net> |
service: for Type=forking services, ignore exit status of main process depending on ExecStart's ignore setting
https://bugzilla.redhat.com/show_bug.cgi?id=860464 |
20771ae336a7c72dc6d2cac2f0c9b0c0f3003379 |
|
12-Jan-2013 |
Kay Sievers <kay@vrfy.org> |
service: remove distribution specific comments, the code runs unconditional now |
85a3fa0e1979a13683baa1f3dda6b6d0005f20ab |
|
12-Jan-2013 |
Kay Sievers <kay@vrfy.org> |
service: remove distribution specific comments, the code run unconditional now |
66870f90dec9b5bf4ad76f9757fafce703560a67 |
|
06-Jan-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
systemd: use unit logging macros |
a83ad683fd13e27b3c4e582ecd6c3852245dbe2f |
|
05-Jan-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
service: fixup after ifdef dropping
Commit 88516c0 removed one line too much. |
425c608d5319cae993d786a3915064bbb580c17b |
|
04-Jan-2013 |
Lennart Poettering <lennart@poettering.net> |
service: drop inserv.conf parsing
This Suse specific configuration file should really be done in a generator
that is shipped downstream by suse. |
88516c0c952b9502e8ef1d6a1481af61b0fb422d |
|
04-Jan-2013 |
Lennart Poettering <lennart@poettering.net> |
service: drop the per-distro ifdefs in service.c
They don't really hurt on other distros, and this allows us to ship
the same code on all distros |
0979f2855c81d144d4c7d814678a5b5b2d34155b |
|
24-Nov-2012 |
Lennart Poettering <lennart@poettering.net> |
build-sys: drop TARGET_UBUNTU
TARGET_UBUNTU is effectively the same as TARGET_DEBIAN. Given the Ubuntu
is unlikely to use systemd anytime soon there's no point in keeping this
separate. |
36697dc0199e25f09b78090fcf5f1cf8a3648ffd |
|
23-Nov-2012 |
Lennart Poettering <lennart@poettering.net> |
timer: implement calendar time events |
68b29a9fca915c83b9192790ec61189430cd5de6 |
|
22-Nov-2012 |
Lennart Poettering <lennart@poettering.net> |
manager: introduce watch_init() initializer for watches |
3cdebc217c42c8529086f2965319b6a48eaaeabe |
|
16-Nov-2012 |
Lennart Poettering <lennart@poettering.net> |
service: drop support for SysV scripts for the early boot
This remove distro-specific support for early-boot SysV init scripts.
(And leaves support for normal SysV scripts untouched).
If distributions wish to continue to allow early-boot SysV scripts in
their distribution-specific way they should either maintain this patch
downstream manually, or write a generator for them, or simply ship all
those scripts with a .service wrapper. |
0049f05a8bb82c3e084bacc5945596761d706c55 |
|
16-Nov-2012 |
Lennart Poettering <lennart@poettering.net> |
shutdown: readd explicit sync() when shutting down
As it turns out reboot() doesn't actually imply a file system sync, but
only a disk sync. Accordingly, readd explicit sync() invocations
immediately before we invoke reboot().
This is much less dramatic than it might sounds as we umount all
disks/read-only remount them anyway before going down. |
669b04a492e33601e6c34a40bc96ad9ffa11c5a2 |
|
31-Oct-2012 |
Lennart Poettering <lennart@poettering.net> |
service: drop special HTTP server target, as it is a bad idea anf Fedora specific
This was premarily intended to support the LSB facility $httpd which is
only known by Fedora, and a bad idea since it lacks any real-life
usecase.
Similar, drop support for some other old Fedora-specific facilities.
Also, document the rules for introduction of new facilities, to clarify
the situation for the future. |
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. |
97ae63e2a9c07ee64ab9f226b9b6121114f1d732 |
|
18-Oct-2012 |
Lennart Poettering <lennart@poettering.net> |
service: when invoking service processes in --user mode set MANAGERPID to PID of systemd |
37e2941d144f362c0585974939cf12ad01aa0258 |
|
16-Oct-2012 |
Michael Stapelberg <michael@stapelberg.de> |
service: Heuristically determine whether SysV scripts support reload
This commit checks for a usage line which contains [{|]reload[|}"] (to
not errnously match force-reload).
Heuristics like this suck, but it solves a real problem and there
appears to be no better way... |
2abba39d759bacebd7461f7370bb108f48dcce92 |
|
16-Oct-2012 |
Mantas MikulÄ—nas <grawity@gmail.com> |
core: allow Type=oneshot services to have ExecReload
Use cases:
* iptables.service – atomically reload rules without having to flush
them beforehand (which may leave the system insecure if reload fails)
* rpc-nfsd.service – reexport filesystems after /etc/exports update
without completely stopping and restarting nfsd
(In both cases, the actual service is provided by a kernel module and
does not have any associated user-space processes, thus Type=oneshot.) |
f801968466fed39d50d410b30ac828c26722cc95 |
|
21-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: completely rework the mmap cache as I too dumb to actually understand it
Instead of doing hand optimized fd bisect arrays just use plain old
hashmaps. Now I can understand my own code again. Yay!
As a side effect this should fix some bad memory accesses caused by
accesses after mmap(), introduced in 189. |
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 |
faa368e3376cb5e3e3c27550fdde652f1d3c9584 |
|
17-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
conf-parser: don't unescape parsed configuration strings by default
In many cases this might have a negative effect since we drop escaping
from strings where we better shouldn't have dropped it.
If unescaping makes sense for some settings we can readd it later again,
on a per-case basis.
https://bugs.freedesktop.org/show_bug.cgi?id=54522 |
bfba3256a02a0871579c4ee48d787dfe4585fd8d |
|
17-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
service: don't hit an assert if a service unit changes type and we get a spurious event from before |
8d1b002a2e389e79a2414491523de549783abf73 |
|
22-Aug-2012 |
Lennart Poettering <lennart@poettering.net> |
service: introduce a proper service result if the start limit is hit |
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. |
d568a3350ee8a45877eef87cd026a954124e2cf8 |
|
08-Aug-2012 |
Michal Sekletar <msekleta@redhat.com> |
systemd: introduced new timeout types
Makes possible to specify separate timeout for start and stop of
the service.
[ Improved the manpage. Coding style fix. -- michich ] |
956b78e8e3636bbf04e264ca96128edc2cbf3626 |
|
23-Jul-2012 |
Jim Meyering <jim@meyering.net> |
sd-daemon: remove unnecessary memset calls
There is no point in clearing the bits of a "struct stat" when the very
next statement just calls stat or fstat to fill in that same memory.
[zj: two more places] |
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 |
d4943dc7559dff51d4d3bb737232b9328d6726e1 |
|
18-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
service: don't print a warning if we are in autorestart state, and can't start a unit just yet |
a8bb2e6503fa2a4ed608aa958480d27a696f5146 |
|
18-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
service: make start jobs wait, not fail, when an automatic restart is queued
When an automatic restart is already queued, then make subsequent start
jobs wait until the restart can be handled (i.e. after the holdhoff
time), instead of simply fail. |
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 |
7f2cddae09fd2579ae24434df577bb5e5a157d86 |
|
13-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
unit: rename BindTo= to BindsTo=
all other dependencies are in 3rd person. Change BindTo= accordingly to
BindsTo=.
Of course, the dependency is widely used, hence we parse the old name
too for compatibility. |
b7def684941808600c344f0be7a2b9fcdda97e0f |
|
13-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
util: rename join() to strjoin()
This is to match strappend() and the other string related functions. |
bcbe497e5a73d889e8799f8a3680c303afede347 |
|
10-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
unit: get rid of UnitVTable.suffix, which is now unused |
451b34cc1d74960ee0262eef970a6346ec814f31 |
|
04-Jul-2012 |
Lennart Poettering <lennart@poettering.net> |
service: flush the start counter in "systemctl reset-failed" |
0c7f15b3a95c3596a4756de5c44eb1fdcd0034fc |
|
26-Jun-2012 |
Michal Schmidt <mschmidt@redhat.com> |
service: pass via FAILED/DEAD before going to AUTO_RESTART
With misconfigured mysql, which uses Restart=always, the following two
messages would loop indefinitely and the "systemctl start" would never
finish:
Job pending for unit, delaying automatic restart.
mysqld.service holdoff time over, scheduling restart.
In service_enter_dead() always set the state to SERVICE_FAILED/DEAD first
before setting SERVICE_AUTO_RESTART. This is to allow running jobs to
complete. OnFailure will be also triggered at this point, so there's no
need to do it again from service_stop() (where it was added in commit
f0c7b229).
Note that OnFailure units should better trigger only after giving up
auto-restarting, but that's for another patch to solve.
https://bugzilla.redhat.com/show_bug.cgi?id=832039 |
e201a0384da94f57f65c951a97d8ddaf990d6240 |
|
26-Jun-2012 |
Michal Schmidt <mschmidt@redhat.com> |
service: fix incorrect argument
The last argument to service_enter_dead() is bool allow_restart, not
a service result. |
d081dffbd3e57dc9da494a3384e333bf565d4175 |
|
22-Jun-2012 |
Lennart Poettering <lennart@poettering.net> |
core: remove sysv_console option
This option never made much sense. It was originally intended to make
sure that the usual startup output of sysv scripts goes to the terminal.
However, since SysV scripts started from a terminal would not output to
that terminal, but rather /dev/console this effect was more often than
not actually taking place. Nowadays systemd has much nicer boot time
status output than SysV which makes the sysv output redundant. Finally,
all output of services goes to the journal anyway, and is not lost.
Hence, let's drop this option, and simplify things a bit. |
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. |
98709151f3e782eb508ba15e2a12c0b46003f061 |
|
15-Jun-2012 |
Lukas Nykryn <lnykryn@redhat.com> |
service: timeout for oneshot services
Add possibility to specify timeout for oneshot services.
[ https://bugzilla.redhat.com/show_bug.cgi?id=761656
Added minor fixups. -- michich ] |
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. |
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. |
2e9d6c1251abc0af9aa5bc53610bd522d55be776 |
|
22-May-2012 |
David Ward <david.ward@ll.mit.edu> |
service: fix auto-restart handling in service_start()
Do not bypass the SERVICE_DEAD/SERVICE_FAILED state by manually issuing
a start job while an automatic restart is pending. |
f0c7b229e1aba12488ffb3ca39f606cc93291f55 |
|
22-May-2012 |
David Ward <david.ward@ll.mit.edu> |
service: fix auto-restart handling in service_stop()
When service_stop() handles a service in the SERVICE_AUTO_RESTART state,
it calls service_set_state() to transition it to the SERVICE_DEAD state.
However if the service failed, it should transition it to SERVICE_FAILED
instead, which will trigger its OnFailure units. To achieve this, we now
call service_enter_dead() in place of service_set_state(), which will
transition the service to either SERVICE_DEAD or SERVICE_FAILED as is
appropriate.
Also, some misleading comments are adjusted: service_stop() is not only
called on a user request, but also during an automatic restart in order
to handle dependencies.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45511 |
feae8adb848e26110b28a06d1244e02f36cdf382 |
|
22-May-2012 |
David Ward <david.ward@ll.mit.edu> |
service: actually delay auto-restart if another job is pending
https://bugs.freedesktop.org/show_bug.cgi?id=45511 |
c93ff2e913a6da516c83c0d3f8df73004acc6c8b |
|
21-May-2012 |
Frederic Crozat <fcrozat@suse.com> |
main: allow system wide limits for services |
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 |
0b86feac50be53f278fa4f47024335cc8c20cc24 |
|
03-May-2012 |
Lennart Poettering <lennart@poettering.net> |
service: default to Type=dbus if BusName= is specified |
7e2668c6fd5720ae4d2d55eb8a062739687516af |
|
03-May-2012 |
Lennart Poettering <lennart@poettering.net> |
service: warn if a dbus name is specified but the service type is not dbus |
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 |
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/ |