Commit Graph

18 Commits

Author SHA1 Message Date
Lukas Nykryn 96342de68d 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.
2012-08-14 14:46:03 +02:00
Lennart Poettering cba6e0627d units: apply default resource limits to socket/mount/swap processes too 2012-07-20 00:10:32 +02:00
Lennart Poettering c74f17d96c 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.
2012-07-20 00:10:32 +02:00
Lennart Poettering 4819ff0358 unit: split off KillContext from ExecContext containing only kill definitions 2012-07-20 00:10:31 +02:00
Lennart Poettering e06c73cc91 unit: set default working directory to the user's home directory when running in user mode 2012-07-16 12:44:42 +02:00
Lennart Poettering bcbe497e5a unit: get rid of UnitVTable.suffix, which is now unused 2012-07-10 17:16:50 +02:00
Eelco Dolstra 62bca2c657 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.
2012-06-22 00:14:08 +02:00
Lennart Poettering b6bfc7bbee swap: avoid bad memory access 2012-05-24 17:33:50 +02:00
Lennart Poettering 6b1dc2bd3c mount: replace PID1 internal fstab parser with generator
Bit by bit we should remove non-unit parsing from PID 1 and move into
generators, to clean up our code base a bit and clearly separate
parsers.
2012-05-22 19:25:17 +02:00
Michal Schmidt c69182961b 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.
2012-05-14 14:29:53 +02:00
Kay Sievers 9eb977db5b util: split-out path-util.[ch] 2012-05-08 02:33:10 +02:00
Lennart Poettering 88f3e0c91f 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
2012-05-03 21:54:44 +02:00
Lennart Poettering 2b93b027d3 remount: consolidate remount-api-vfs and remount-rootfs into one
This has the advantage of removing a confusing warning by mount if the
root directory is not listed in fstab.
2012-04-24 16:42:42 +02:00
Lennart Poettering f2b6878955 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.
2012-04-24 14:42:24 +02:00
Lennart Poettering 8d8e945624 manager: drop MountAuto= and SwapAuto= options
The ability to set MountAuto=no and SwapAuto=no was useful during the
adoption phase of systemd, so that distributions could stick to their
classic mount scripts a bit longer. It is about time to get rid of it
now.
2012-04-24 13:53:34 +02:00
Lennart Poettering ecedd90fcd 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
2012-04-13 23:29:59 +02:00
Lennart Poettering 5430f7f2bc 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.
2012-04-12 00:24:39 +02:00
Kay Sievers b30e2f4c18 move libsystemd_core.la sources into core/ 2012-04-11 16:03:51 +02:00
Renamed from src/swap.c (Browse further)