Commit graph

170 commits

Author SHA1 Message Date
Lennart Poettering 4dcc1cb415 unit: implement new PropagateReloadTo=/PropagateReloadFrom= operations 2012-01-11 02:52:34 +01:00
Lennart Poettering 81527be142 build-sys: move public header files into a dir of their own 2012-01-05 16:01:58 +01:00
Lennart Poettering dc1ecd78e9 Merge branch 'journal' 2011-12-31 00:59:37 +01:00
Michal Schmidt cbd37330bc dbus: register to DBus asynchronously
Chen Jie observed and analyzed a deadlock. Assuming systemd-kmsg-syslogd
is already stopped, but rsyslogd is not started yet:
 1. systemd makes a synchronous call to dbus-daemon.
 2. dbus-daemon wants to write something to syslog.
 3. syslog needs to be started by systemd.
   ... but cannot be, because systemd is waiting in 1.

Solve this by avoiding synchronous D-Bus calls. I had to write an async
bus registration call. Interestingly, D-Bus authors anticipated this, in
documentation to dbus_bus_set_unique_name():
> The only reason to use this function is to re-implement the equivalent
> of dbus_bus_register() yourself. One (probably unusual) reason to do
> that might be to do the bus registration call asynchronously instead
> of synchronously.

Lennart's comments from IRC:
> though I think this doesn't fix the problem in its entirety
> simply because dbus_connection_open_private() itself is still synchronous
> i.e. the connect() call behind it is not async
> I think I listed that issue actually on some D-Bus todo list
> i.e. to make dbus_connection_get() fully async
> but that's going to be hard
> so your patch looks good

So it may not be perfect, but it's clearly an improvement.
I did not manage to reproduce the original deadlock with the patch.
2011-12-20 00:17:14 +01:00
Lennart Poettering 1e2579fdeb Merge branch 'master' into journal 2011-11-08 19:44:16 +01:00
Jonathan Nieder 5a8d081c58 audit: do not complain if kernel lacks audit
When running on a kernel without audit support, systemd currently
writes a mysterious-sounding error to its log:

	systemd[1]: Failed to connect to audit log: Protocol not supported

Better to suppress the audit_open() failure message when (and only
when) it is due to running on a kernel without audit support, since in
this case the admin probably does not mind systemd not writing to the
audit log.  This way, more serious errors like ENOMEM and EACCES will
stand out more.
2011-10-17 21:04:59 +02:00
Michal Schmidt 563ba9ea6e manager: fix a crash in isolating
HASHMAP_FOREACH is safe against the removal of the current entry, but
not against the removal of other entries. job_finish_and_invalidate()
can recursively remove other entries.

It triggered an assertion failure:
  Assertion 'j->installed' failed at src/manager.c:1218, function
  transaction_apply(). Aborting.

Fix the crash by iterating from the beginning when there is a
possibility that the iterator could be invalid.

It is O(n^2) in the worst case, but that's better than a crash.

https://bugzilla.redhat.com/show_bug.cgi?id=717325
2011-10-17 11:29:27 +02:00
Lennart Poettering 87d2c1ff6a journal: add preliminary incomplete implementation 2011-10-07 22:02:05 +02:00
Lennart Poettering 5dc4c17fd5 virt: add missing header inclusion 2011-09-23 17:20:45 +02:00
Michal Schmidt 4e240ab0c9 util: improve signal_to_string, signal_from_string
signal_to_string:
 Produce names for SIGRTMIN+n.
 Never give an "n/a" result. In the worst case give the number itself as
 a string.

signal_from_string:
 Parse "RTMIN+n".
 Parse any valid signal number.
2011-09-23 10:30:19 +02:00
Michal Schmidt 764e9b5f07 manager: fix job mode for SIGRTMIN+1, +2
The test did not work as intended and always resulted in JOB_REPLACE.
2011-09-23 10:18:07 +02:00
Lennart Poettering 27d340c772 fsck: show progress while fscking at boot 2011-09-01 21:05:06 +02:00
Lennart Poettering ad293f5a94 cgroup: honour sticky bit when trimming cgroup trees 2011-08-21 20:07:46 +02:00
Lennart Poettering 1d6702e8d3 umask: set umask of a number of sockets by default, even though we check creds on connections 2011-08-01 22:42:07 +02:00
Lennart Poettering 07f8a4aa49 manager: call generators with umask 0022 2011-08-01 20:51:18 +02:00
Lennart Poettering 44d9105692 util: use join() instead of asprintf() as an optimization 2011-08-01 02:39:22 +02:00
Lennart Poettering 253ee27a0c manager: add log control via RT signals 2011-07-23 04:15:38 +02:00
Lennart Poettering c800e48374 path-lookup: make inclusion of user private units optional 2011-07-22 04:31:20 +02:00
Lennart Poettering a755605296 manager: merge serialization and desrialization counter into one, and increase it when reexecuting
Instead of having individual counters n_serializing and n_deserializing
have a single one n_reloading, which should be sufficient.

Set n_reloading when we are about to go down for reexecution to avoid
cgroup trimming when we free the units for reexecution.
2011-07-06 00:47:42 +02:00
Lennart Poettering ccaa61498c add a few O_CLOEXEC where missing 2011-07-05 03:29:24 +02:00
Michal Schmidt 1b562e4604 manager: consider the active job when merging
In some cases systemd forgets to start enabled services, e.g. in this scenario:
1. The job "sendmail.service/start" is installed.
2. Before systemd proceeds with this job, a process requests a reload of
   sendmail. The job "sendmail.service/reload" is enqueued.
3. The original job is silently discarded. The service is not started.
   The reload job proceeds by doing nothing.

The fix is to allow merging transaction jobs with the active job.
With the fix the resulting merged job "sendmail.service/reload-or-start" is
installed and the service works as expected.

https://bugzilla.redhat.com/show_bug.cgi?id=633774
2011-07-02 17:32:05 +02:00
Lennart Poettering 530345e782 manager: use sd_notify() to notify parent systemd that we have finished startup 2011-06-30 02:15:41 +02:00
Lennart Poettering 18fa6b2705 dbus: send our finished signal when we are finished booting 2011-06-27 13:47:03 +02:00
Lennart Poettering 3df5bf6123 dbus: make bus_flags_to_events() and friends generally useful 2011-06-21 19:29:43 +02:00
Lennart Poettering 3661ac04b4 manager: include full systemctl status command line in error message 2011-06-20 21:39:28 +02:00
Lennart Poettering b23de6af89 dbus: make daemon reexecution synchronous
We simply keep open copies of the dbus connections across the
reexecution and close them as last step of it. A client can thus simply
wait until its connection is dropped to know when the reexecution is
finished.

https://bugzilla.redhat.com/show_bug.cgi?id=698198
2011-04-28 22:07:01 +02:00
Lennart Poettering 2121dcdded manager: fix serialization counter 2011-04-27 15:54:34 +02:00
Lennart Poettering 38c52d4606 cgroup: don't accidentaly trim on reload
https://bugzilla.redhat.com/show_bug.cgi?id=678555
2011-04-20 03:53:12 +02:00
Lennart Poettering a08dab55f2 manager: when running in test mode, do not write generated unit files to /run/systemd/generator 2011-04-19 22:17:54 +02:00
Lennart Poettering 4fe60156fc manager: drop all pending jobs when isolating 2011-04-16 02:03:34 +02:00
Lennart Poettering c8f4d7642b manager: introduce IgnoreOnIsolate flag so that we can keep systemd-logger around when isolating 2011-04-16 02:03:34 +02:00
Lennart Poettering d718bbb51b manager: downgrade a few log messages 2011-04-16 02:03:34 +02:00
Lennart Poettering f1d19aa412 manager: no need to use randomized generator dir when running as system manager 2011-04-07 21:22:41 +02:00
Lennart Poettering 20c03b7be2 don't make up buffer sizes, use standard LINE_MAX instead 2011-04-07 18:48:50 +02:00
Lennart Poettering 01d67b43b0 manager: serialize/deserialize max job id and /usr taint flag 2011-04-07 18:46:39 +02:00
Lennart Poettering a8049b7a7c manager: don't garbage collect jobs when isolating, to change global state 2011-04-07 18:45:34 +02:00
Lennart Poettering cebe0d41e4 job: fix deserialization of jobs: do not ignore ordering 2011-04-06 19:09:33 +02:00
Lennart Poettering 67370238b5 manager: don't show PID for incoming signals if it is 0 2011-04-06 01:33:34 +02:00
Michal Schmidt 4466ee6a71 manager: fd must be int, not char
This should fix the crash reported by Dan Horak on s390x which
does not have VTs.
2011-04-04 15:34:53 +02:00
Lennart Poettering da19d5c19f src: our lord is coverity 2011-03-31 15:35:40 +02:00
Lennart Poettering fac9f8df1f analyze: beautify output a bit 2011-03-30 20:15:45 +02:00
Lennart Poettering 72bc8d0056 manager: fix taint check for /usr 2011-03-30 00:47:50 +02:00
Kay Sievers 2b583ce657 use /run instead of /dev/.run
Instead of the /dev/.run trick we have currently implemented, we decided
to move the early-boot runtime dir to /run.

An existing /var/run directory is bind-mounted to /run. If /var/run is
already a symlink, no action is taken.

An existing /var/lock directory is bind-mounted to /run/lock.
If /var/lock is already a symlink, no action is taken.

To implement the directory vs. symlink logic, we have a:
  ConditionPathIsDirectory=
now, which is used in the mount units.

Skipped mount unit in case of symlink:
  $ systemctl status var-run.mount
  var-run.mount - Runtime Directory
    Loaded: loaded (/lib/systemd/system/var-run.mount)
    Active: inactive (dead)
            start condition failed at Fri, 25 Mar 2011 04:51:41 +0100; 6min ago
     Where: /var/run
      What: /run
    CGroup: name=systemd:/system/var-run.mount

The systemd rpm needs to make sure to add something like:
  %pre
  mkdir -p -m0755 /run >/dev/null 2>&1 || :
or it needs to be added to filesystem.rpm.

Udev -git already uses /run if that exists, and is writable at bootup.
Otherwise it falls back to the current /dev/.udev.

Dracut and plymouth need to be adopted to switch from /dev/.run to run
too.

Cheers,
Kay
2011-03-28 23:00:00 +02:00
Lennart Poettering f1dd0c3f9b syslog: rework syslog detection so that we need no compile-time option what the name of the syslog implementation is 2011-03-18 04:53:31 +01:00
Lennart Poettering dfa7f7e139 main: check if we have a valid PID before getting the name of it 2011-03-16 02:55:55 +01:00
Lennart Poettering e03ae6615a manager: don't show kernel boot-up time for containers 2011-03-14 21:47:41 +01:00
Lennart Poettering 72fe22f930 manager: show who killed us 2011-03-14 21:30:54 +01:00
Lennart Poettering 391ade8606 audit: give up sending auditing messages when it failed due to EPERM 2011-03-14 17:48:48 +01:00
Lennart Poettering 6f79c579ec main: remove AF_UNIX sockets before binding 2011-03-14 16:15:31 +01:00
Lennart Poettering 91b22f21f3 core: move abstract namespace sockets to /dev/.run
Now that we have /dev/.run there's no need to use abstract namespace
sockets. So, let's move things to /dev/.run, to make things more easily
discoverable and improve compat with chroot() and fs namespacing.
2011-03-14 03:12:25 +01:00