Commit graph

9357 commits

Author SHA1 Message Date
Eelco Dolstra 22349cee29 Properly handle device aliases used as dependencies
If a device unit has aliases defined in udev rules, and there are
other units that depend on that alias, as in

  BindTo=sys-subsystem-net-devices-eth0.device

then systemd will fail the start the alias, and any dependent units
will time out.  See

  https://bugs.freedesktop.org/show_bug.cgi?id=52580

This is because unit_add_name() in device_add_escaped_name() will
return EEXIST.

The solution taken here is to call device_update_unit() on the alias
name.  Thus if a unit with the alias name already exists, we reuse it;
otherwise a new unit is created.  Creating multiple units for a single
device is perhaps suboptimal, but it's consistent with the treatment
of udev symlinks in device_process_new_device().
2012-10-17 09:54:53 -04:00
Lennart Poettering 5e6870eab5 journalctl: properly track rotated journals in follow mode 2012-10-16 23:00:04 +02:00
Lennart Poettering 44a5fa34d9 sd-journal: fix bad memory access 2012-10-16 22:59:28 +02:00
Lennart Poettering 4b69bfdb5b update TODO 2012-10-16 22:59:14 +02:00
Lennart Poettering fb0951b02e journal: implement time-based rotation/vacuuming
This also enables time-based rotation (but not vacuuming) after 1month,
so that not more one month of journal is lost at a time per vacuuming.
2012-10-16 22:58:07 +02:00
Lennart Poettering 1f2da9ec51 journal: sort data items of entries by offset
This should slightly optimize disk access patterns on rotating disks for
simple readers.
2012-10-16 21:40:48 +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 7708588119 logind: only release logind session from the PAM module if the same module instance actually created it 2012-10-16 19:21:21 +02:00
Lennart Poettering 183de6d7d9 id128: introduce new SD_ID128_CONST_STR() macro 2012-10-16 17:02:51 +02:00
Lennart Poettering 706911fba8 journal: don't export MESSAGE_ID() macro
If it is exported it would need to be prefixed, but since we need it
exclusively internally so far, simply move it to an internal header.
2012-10-16 16:26:41 +02:00
Michael Stapelberg 37e2941d14 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...
2012-10-16 16:18:41 +02:00
Colin Guthrie a2ab7ee612 journal: Set the last_unused pointer correctly when attaching an unused window
It seems the previous code was copy/pasted from context_detach_window()
but not updated.
2012-10-16 16:14:46 +02:00
Colin Guthrie 89de694724 journal: Properly track the number of allocated windows.
Checks were already in place to make sure that the number of
windows was limited to 64, but the count was never incremented
or decremented.
2012-10-16 16:13:33 +02:00
Lukas Nykryn 696c245a23 systemctl: append .service when unit does not have valid suffix
systemctl status a and systemctl status a.service lead to same output but
systemctl status a.b and systemctl status a.b.service do not.
2012-10-16 16:07:37 +02:00
Lennart Poettering c3f60ec54d journalctl: add --unit=/-u to match by unit name
This applies unit_name_mangle() to the specified unit names and hence
can handle weird characters nicely and will add unit suffixes as
necessary.
2012-10-16 02:59:27 +02:00
Wulf C. Krueger 78fbaacac0 configure.ac: Add a --without-python option.
Being able to be explicit about Python support (in addition to the
default of auto-detecting it) and acting upon the result, specifying
it as an option gains us more control about both dependencies and
the resulting build.

Furthermore, relying purely on auto-detection can lead to problems for
source-based distros. E. g. systemd being built before *both* 32-bit &
64-bit ABIs are installed will lead to build failures as systemd's
build system will pick up either 32-/64-bit Python, conclude both are
available and fail if that's not the case.
2012-10-16 02:24:31 +02:00
Thomas Bächler fd59a381e3 core/swap.c: Do not add Before=swap.target to swap units.
The fstab generator adds Before=swap.target by default, and when creating
a custom .swap unit, you can also add Before=swap.target to the unit.

However, it is impossible to not have this ordering dependency right now.
Virtually all existing setups likely use the fstab generator, so this
change is unlikely to break anything.
2012-10-16 02:20:55 +02:00
Thomas Bächler 6bae23a038 core: Refuse to run a user instance when the system hasn't been booted with systemd.
Running as a user instance won't work at all if systemd isn't running as system
manager, so refuse to start in that case.
2012-10-16 02:17:46 +02:00
Daniel J Walsh 080ffcb4a1 selinux: selabel_lookup_raw can return ENOENT and be a non failure mode. 2012-10-16 01:58:42 +02:00
Daniel J Walsh a33c48d83c SELinux patch still broken, in that we are not checking the correct source context.
This patch does the dbus calls correctly.
2012-10-16 01:57:16 +02:00
Mantas Mikulėnas 2abba39d75 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.)
2012-10-16 01:36:18 +02:00
Michael Olbrich 9388e99e20 build-sys: check for name_to_handle_at declaration instead of its definition
AC_CHECK_FUNCS may be successful, even though name_to_handle_at and
'struct file_handle'  are not available.
2012-10-16 01:30:29 +02:00
Ferenc Wágner 7e505069d2 man: Fix typo in udevadm documentation 2012-10-16 01:11:42 +02:00
Lennart Poettering 9048b11f8b journalctl: harmonise in-stream comments
From now on, always use ANSI-SQL-style comments in log streams, i.e.
prefix with --. We also suffix things with this, just to be nice...
2012-10-16 01:09:09 +02:00
Lennart Poettering b1c806231b util: properly handle -1 timespec/timeval 2012-10-16 01:04:32 +02:00
Lennart Poettering f530371f1f update TODO 2012-10-16 01:04:32 +02:00
Andrew Eikum 16dad32e43 Reword sentences that contain psuedo-English "resp."
As you likely know, Arch Linux is in the process of moving to systemd.
So I was reading through the various systemd docs and quickly became
baffled by this new abbreviation "resp.", which I've never seen before
in my English-mother-tongue life.

Some quick Googling turned up a reference:
<http://www.transblawg.eu/index.php?/archives/870-Resp.-and-other-non-existent-English-wordsNicht-existente-englische-Woerter.html>

I guess it's a literal translation of the German "Beziehungsweise", but
English doesn't work the same way. The word "respectively" is used
exclusively to provide an ordering connection between two lists. E.g.
"the prefixes k, M, and G refer to kilo-, mega-, and giga-,
respectively." It is also never abbreviated to "resp." So the sentence
"Sets the default output resp. error output for all services and
sockets" makes no sense to a natural English speaker.

This patch removes all instances of "resp." in the man pages and
replaces them with sentences which are much more clear and, hopefully,
grammatically valid. In almost all instances, it was simply replacing
"resp." with "or," which the original author (Lennart?) could probably
just do in the future.

The only other instances of "resp." are in the src/ subtree, which I
don't feel privileged to correct.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
2012-10-16 01:03:01 +02:00
Zbigniew Jędrzejewski-Szmek edfb521a21 journalctl: skip informational messages in export/json modes 2012-10-15 18:17:49 +02:00
Lukas Nykryn 44386fc156 systemctl: don't mangle name when it is a path
systemctl enable, disable, ... can also accept full path and in this case
we don't need to alter it.

https://bugzilla.redhat.com/show_bug.cgi?id=866346
2012-10-15 16:34:23 +02:00
Lennart Poettering a7a3f28be4 update TODO 2012-10-15 16:28:39 +02:00
Zbigniew Jędrzejewski-Szmek c3eba2ab4e journalctl: make --follow really work 2012-10-14 15:29:38 +00:00
Zbigniew Jędrzejewski-Szmek e3ed66c52e journalctl: make --follow work again
Stopped working after cfbc22ab 'journalctl: implement --since= and
--until for filtering by time'.
2012-10-13 21:37:42 +02:00
Zbigniew Jędrzejewski-Szmek 0ab5c3ed87 journal-verify: get rid of an unused variable
When compiling without gcrypt, gcc emits an annoying warning.
2012-10-13 21:37:11 +02:00
Zbigniew Jędrzejewski-Szmek b1bafc00d5 journald: add missing include
./src/journal/journald.h:123:114: warning: ‘struct ucred’ declared inside parameter list [enabled by default]
2012-10-13 16:09:09 +00:00
Zbigniew Jędrzejewski-Szmek e4d1062c05 build-sys: always distribute file 2012-10-13 14:54:56 +02:00
Zbigniew Jędrzejewski-Szmek 6374a73b00 journal-gatewayd: rename variables to avoid -Wshadow warning 2012-10-13 14:54:56 +02:00
Zbigniew Jędrzejewski-Szmek e88baee88f journald: properly update message size after stripping the identifier
Valgrind says:
==29176== Conditional jump or move depends on uninitialised value(s)
==29176==    at 0x412A85: cunescape_length_with_prefix (util.c:1565)
==29176==    by 0x40B351: dev_kmsg_record (journald-kmsg.c:301)
==29176==    by 0x40B653: server_read_dev_kmsg (journald-kmsg.c:347)
==29176==    by 0x40B701: server_flush_dev_kmsg (journald-kmsg.c:365)
==29176==    by 0x409DE7: main (journald.c:1535)
2012-10-13 14:40:32 +02:00
Zbigniew Jędrzejewski-Szmek 1b4bb4fdac journal: fix build in VALGRIND compatibility mode 2012-10-13 14:40:32 +02:00
Zbigniew Jędrzejewski-Szmek 1ca6783f5e log: introduce a macro to format message id
The MESSAGE_ID=... stanza will appear in countless number of places.
It is just too long to write it out in full each time.

Incidentally, this also fixes a typo of MESSSAGE is three places.
2012-10-13 14:26:30 +02:00
Kay Sievers c0735bb218 build-sys: check - fix typo 2012-10-11 22:31:23 +02:00
Sebastian Ott 4ecc131848 udev: path_id - add scm support
Add support for scm block devices. Introduced here:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=f30664e2

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
2012-10-11 22:26:54 +02:00
Lennart Poettering cfbc22abd0 journalctl: implement --since= and --until for filtering by time 2012-10-11 16:43:37 +02:00
Martin Pitt fb5d873cfd rules: Fix persistent input symlinks for interface 00
Commits 5e9eb156c and 32567f8 introduced persistent symlinks for input devices
with more than one interface. However, this does not ensure stability for the
"default" interface, i. e. with interface number 00 or a nonexisting one. If a
device with a higher interface number appears first, it'll claim the symlink
name without an interface number, and the "interface 00" device won't get any.

Fix this by creating the default symlink only for interface 00 or a nonexisting
one, so that we properly partition the two cases over the two rules.

https://launchpad.net/bugs/1057824
2012-10-11 08:21:17 +02:00
Lennart Poettering 48383c2511 journal: support epxorting the journal in a format suitable for text/event-stream 2012-10-11 02:37:10 +02:00
Lennart Poettering 33316dbf20 journal: take scroll events in the entire white box in browse.html 2012-10-11 01:57:36 +02:00
Lennart Poettering 33162605bb journal: make buttons bigger in browse.html 2012-10-11 01:52:35 +02:00
Lennart Poettering 04909b0f2c journal: use localstorage instead of cookies in browse.html and store where the current position 2012-10-11 00:38:20 +02:00
Lennart Poettering 74bee4e336 journal: move buttons to the center in browse.html 2012-10-11 00:04:54 +02:00
Kay Sievers 19f8efacc5 journal: add mousewheel scrolling to browse.html 2012-10-10 23:59:29 +02:00
Lennart Poettering 6d5f2f5803 journal: add keyboard navigation to browse.html 2012-10-10 23:49:21 +02:00