Commit Graph

37 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 20ad4cfd8e core: add catalog entry and MESSAGE_ID for overmounting 2012-12-05 12:25:50 +01:00
Lennart Poettering 36697dc019 timer: implement calendar time events 2012-11-23 21:37:58 +01:00
Will Woods bcbd5405b1 mount: make sure m->where is set before unit_add_exec_dependencies()
If you enter unit_add_exec_dependencies with m->where = NULL, you'll
very likely end up aborting somewhere under socket_needs_mount.

(When systemd goes to check to see if the journald socket requires your
mount, it'll do path_startswith(path, m->where)... *kaboom*)

This patch should ensure that:

    a) both branches in mount_add_one() set m->where, and
    b) mount_add_extras() calls unit_add_exec_dependencies() *after*
       setting m->where.
2012-10-23 01:53:02 +02:00
Lennart Poettering b87705cdd2 mount: don't try to initialize extra deps for mount units before initializing their basic fields
Under some circumstances this could lead to a segfault since we we
half-initialized a mount unit, then tried to hook it into the network of
things and while doing that recursively ended up looking at our
half-initialized mount unit again assuming it was fully initialized.
2012-10-16 19:50:26 +02:00
Lennart Poettering dd144c63e2 mount: simplify device node conditions a bit 2012-09-24 12:48:46 +02:00
Lennart Poettering 63a8b2f947 mount: only run fsck for actual device nodes 2012-09-24 12:39:13 +02:00
Lennart Poettering a99124d92f mount: reword directory empty warning a bit 2012-09-19 09:58:34 +02:00
Zbigniew Jędrzejewski-Szmek 67445f4e22 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.
2012-09-18 19:53:34 +02:00
Lennart Poettering 257f1d8ec4 mount: notify the user if we over-mount a non-empty directory
https://bugzilla.redhat.com/show_bug.cgi?id=858266
2012-09-18 18:52:33 +02:00
Lennart Poettering 3ef63c3174 unit-printf: before resolving exec context specifiers check whether the object actually has an exec context 2012-09-18 11:40:01 +02:00
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 b7def68494 util: rename join() to strjoin()
This is to match strappend() and the other string related functions.
2012-07-13 13:41:01 +02:00
Malte Starostik 36fcd77e02 mount: fix for complex automounts
If accessing an automount point triggers more changes to
/proc/self/mountinfo than just to add the directly wanted mount, these
changes can lead to spurious -ENODEV notifications on the automount unit
causing the request to fail when in fact the mount will be setup right
afterwards.
2012-07-10 18:27:03 +02:00
Lennart Poettering bcbe497e5a unit: get rid of UnitVTable.suffix, which is now unused 2012-07-10 17:16:50 +02:00
Michal Schmidt 8eba616fc0 mount: load only if we there's mountinfo or fragment
Having information from /proc/self/mountinfo is sufficient to consider a
mount unit loaded.

When there's no mountinfo, the loading of the fragment for the mount
unit is not optional. No extra dependency links must be added when the
loading fails.

https://bugzilla.redhat.com/show_bug.cgi?id=835848
2012-06-29 02:10:41 +02:00
Michal Schmidt 1a4ac87500 mount: split adding of extras from mount_load() 2012-06-29 02:04:30 +02:00
Lennart Poettering 93a1d735ac units: rename fsck@.service to systemd-fsck@.service
The rule is that units that encapsulate our own code are prefixed with
"systemd-". Since the fsck units invoke our own code, hence add the
missing prefix. Since a long long time the fsck units didn't invoke the
naked fsck binaries anymore, and it is unlikely that this well ever
change. On the opposite: the code in systemd-fsck will probably get more
complex over time to handle fsck progress to plymouth forwarding.

Same for quotacheck (but not quotaon!)
2012-06-25 14:28: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
Kay Sievers d2e54fae5c mkdir: append _label to all mkdir() calls that explicitly set the selinux context 2012-05-31 12:40:20 +02:00
Lennart Poettering 399c5f9633 mount: drop unused function 2012-05-22 19:50:10 +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
Lennart Poettering 92a39ae198 mount: use the same fstab extension option syntax everywhere
The man page and the actual code differed, and this is now corrected
2012-05-22 02:00:53 +02:00
Lennart Poettering f7f21d33db cryptsetup: a few simplifications 2012-05-21 17:22:40 +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 7c8fa05c4d unit: add new dependency type RequiresMountsFor=
RequiresMountsFor= is a shortcut for adding requires and after
dependencies to all mount units neeed for the specified paths.

This solves a couple of issues regarding dep loop cycles for encrypted
swap.
2012-04-30 10:52:07 +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 e0295d2651 mount: don't fail if fstab doesn't exist 2012-04-22 15:33:43 +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/mount.c (Browse further)