Commit graph

8143 commits

Author SHA1 Message Date
Lennart Poettering 37099707e2 cgroup: fix alloca() misuse in cg_shorten_controllers() 2012-05-03 23:23:38 +02:00
Lennart Poettering 6e476bc9d1 dbus: handle invalid enum values better 2012-05-03 23:06:19 +02:00
Lennart Poettering 06dab8e18a dbus: include unit name in JobNew/JobRemoved signals
This breaks D-Bus interface slightly, but since the D-Bus API isn't
covered by the interface stability promise this should be OK.
2012-05-03 22:53:25 +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 3beddc7861 systemctl: allow 'systemctl reboot -ff' to succeed even without D-Bus 2012-05-03 16:29:15 +02:00
Lennart Poettering c32b90dec7 systemctl: print a nice error message if an unprivileged user calls systemctl reboot -ff 2012-05-03 16:17:58 +02:00
Lennart Poettering 65491fd8c9 systemctl: get rid of arg_immediate and fold it into arg_force 2012-05-03 16:17:39 +02:00
Lennart Poettering 04b6f7c1a7 rc-local-generator: hook halt-local in based on generator too 2012-05-03 16:00:49 +02:00
Lennart Poettering e677bf7ef6 hwclock: add taint flag for non-local hwclock 2012-05-03 16:00:49 +02:00
Lennart Poettering 741f8cf6b9 vconsole: fix some error messages 2012-05-03 15:10:09 +02:00
Lennart Poettering c374339916 units: explicit Type=dbus is now redundant 2012-05-03 14:48:35 +02:00
Lennart Poettering 0b86feac50 service: default to Type=dbus if BusName= is specified 2012-05-03 14:46:29 +02:00
Lennart Poettering 7e2668c6fd service: warn if a dbus name is specified but the service type is not dbus 2012-05-03 14:42:49 +02:00
Lennart Poettering 682fff7371 vconsole: fix error messages
https://bugs.freedesktop.org/show_bug.cgi?id=49192
2012-05-03 02:51:15 +02:00
Lennart Poettering e85647f73e update TODO 2012-05-03 02:25:49 +02:00
Kay Sievers 349b915de5 man: fix typo 2012-04-30 15:30:57 +02:00
Lennart Poettering 86fff24864 units: make sure /var is writable before initializing random seed 2012-04-30 10:56:46 +02:00
Lennart Poettering c3276d2791 TODO 2012-04-30 10:52:07 +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 a8ad0f8928 service: document new Type=idle 2012-04-30 10:52:07 +02:00
Lennart Poettering 896c3c783c update TODO 2012-04-30 10:52:07 +02:00
Kay Sievers 4ee7178202 update TODO 2012-04-30 00:46:38 +02:00
Lucas De Marchi b27ee00bf5 udev: use container_of() macro 2012-04-29 19:15:08 +02:00
Lucas De Marchi c4326aa4af util: introduce container_of() macro
This macro comes from kernel and it's useful for unwrapping structs
inside another one. The generated code is actually the same to the one
where this logic is used in udev, but using this macro is much cleaner
and less error prone.
2012-04-29 19:14:05 +02:00
Kay Sievers c8f8394a93 libudev: prefix log macros with 'udev_' 2012-04-26 17:43:48 +02:00
Kay Sievers e01a15b71e update TODO 2012-04-26 02:03:31 +02:00
Kay Sievers c693ccc0a2 udev: use only oom_score_adj interface 2012-04-26 01:49:15 +02:00
Kay Sievers 2028f1cd92 udev: docs - it's 'GUdev' 2012-04-26 01:48:24 +02:00
Michal Schmidt e0209d83e7 core: add NOP jobs, job type collapsing
Two of our current job types are special:
JOB_TRY_RESTART, JOB_RELOAD_OR_START.

They differ from other job types by being sensitive to the unit active state.
They perform some action when the unit is active and some other action
otherwise. This raises a question: when exactly should the unit state be
checked to make the decision?

Currently the unit state is checked when the job becomes runnable. It's more
sensible to check the state immediately when the job is added by the user.
When the user types "systemctl try-restart foo.service", he really intends
to restart the service if it's running right now. If it isn't running right
now, the restart is pointless.

Consider the example (from Bugzilla[1]):

sleep.service takes some time to start.
hello.service has After=sleep.service.
Both services get started. Two jobs will appear:
 hello.service/start  waiting
 sleep.service/start  running
Then someone runs "systemctl try-restart hello.service".

Currently the try-restart operation will block and wait for
sleep.service/start to complete.

The correct result is to complete the try-restart operation immediately
with success, because hello.service is not running. The two original
jobs must not be disturbed by this.

To fix this we introduce two new concepts:
- a new job type: JOB_NOP
  A JOB_NOP job does not do anything to the unit. It does not pull in any
  dependencies. It is always immediately runnable. When installed to a unit,
  it sits in a special slot (u->nop_job) where it never conflicts with
  the installed job (u->job) of a different type. It never merges with jobs
  of other types, but it can merge into an already installed JOB_NOP job.

- "collapsing" of job types
  When a job of one of the two special types is added, the state of the unit
  is checked immediately and the job type changes:
  JOB_TRY_RESTART     -> JOB_RESTART or JOB_NOP
  JOB_RELOAD_OR_START -> JOB_RELOAD or JOB_START
  Should a job type JOB_RELOAD_OR_START appear later during job merging, it
  collapses immediately afterwards.
  Collapsing actually makes some things simpler, because there are now fewer
  job types that are allowed in the transaction.

[1] Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=753586
2012-04-25 18:38:27 +02:00
Lennart Poettering e2875c4693 timedated: introduce systemd-timedated-ntp.target which is controlled by timedated's NTP setting
We shouldn't hardcode the name of the NTP implementation in the
timedated mechanism, especially since Fedora currently switched from NTP
to chrony.

This patch introduces a new target that is enabled/disabled instead of
the actual NTP implementation. The various NTP implementations should
then add .wants/ symlinks to their services and BindTo back to the
target, so that their implementations are started/stopped jointly with
the target.

https://bugzilla.redhat.com/show_bug.cgi?id=815748
2012-04-25 16:49:02 +02:00
Lennart Poettering bc2f673ec2 nspawn: add --read-only switch 2012-04-25 15:11:20 +02:00
Lennart Poettering 2547bb414c nspawn: bind mount /etc/resolv.conf from the host by default 2012-04-25 15:08:00 +02:00
Lennart Poettering b55d0651c0 shutdown: don't complain if we cannot lock memory, to make container shutdowns clean 2012-04-24 16:56:06 +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 a888b352eb update TODO 2012-04-24 14:59:54 +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 25f5971b5e man: rework nspawn man page to suggest yum --installroot instead of mock 2012-04-24 13:14:40 +02:00
Lennart Poettering 3b2d5b02ae readahead: rather than checking for virtualization in the C code, use ConditionVirtualization= in the unit 2012-04-24 13:14:40 +02:00
Michal Schmidt 5273510e9f transaction: cancel jobs non-recursively on isolate
Recursive cancellation of jobs would trigger OnFailure actions of
dependent jobs. This is not desirable when isolating.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=798328
2012-04-23 08:13:02 +02:00
Michal Schmidt 39a18c60d0 job: serialize jobs properly
Jobs were not preserved correctly over a daemon-reload operation.
A systemctl process waiting for a job completion received a job removal
signal. The job itself changed its id. The job timeout started ticking all
over again.

This fixes the deficiencies.
2012-04-24 01:54:15 +02:00
Michal Schmidt 1b9cea0caa transaction: abort does not need to use recursive deletion
Recursion is unnecessary, because we're deleting all transaction jobs
anyway. And the recursive deletion produces debug messages that are
pointless in transaction abort.
2012-04-24 01:54:15 +02:00
Michal Schmidt 4e7bd268ae transaction: fix detection of cycles involving installed jobs
A transaction can be acyclic, but when it's added to installed jobs,
a cycle may result.

transaction_verify_order_one() attempts to detect these cases, but it
fails because the installed jobs often have the exact generation number
that makes them look as if they were walked already.

Fix it by resetting the generation numbers of all installed jobs before
detecting cycles.

An alternative fix could be to add the generation counter to the
Manager and use it instead of starting always from 1 in
transaction_activate(). But I prefer not having to worry about it
wrapping around.
2012-04-24 01:54:14 +02:00
Michal Schmidt 055163ad15 transaction: improve readability
The functions looked complicated with the nested loops with breaks,
continues, and "while (again)".
Here using goto actually makes them easier to understand.

Also correcting the comment about redundant jobs.
2012-04-24 01:54:14 +02:00
Lennart Poettering ff64462375 shutdown: don't try to shut down DM devices in a container 2012-04-22 15:50:52 +02:00
Lennart Poettering fb3d2b8fec hostname: if there's already a hostname set when PID 1 is invoked, don't complain 2012-04-22 15:47:38 +02:00
Lennart Poettering 78ff1acdfe job: the status messages are proper sentences, hence end them with a full stop 2012-04-22 15:39:26 +02:00
Lennart Poettering e3f7277c6e units: remount file systems only if /etc/fstab actually exists 2012-04-22 15:35:35 +02:00
Lennart Poettering e0295d2651 mount: don't fail if fstab doesn't exist 2012-04-22 15:33:43 +02:00
Lennart Poettering 59e132a7f4 transaction: downgrade warnings about masked units 2012-04-22 15:22:52 +02:00