Commit graph

204 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 92d700dea6 gitignore: add test-journal-init 2013-08-04 08:33:02 -04:00
Dave Reisner 41f1a1da57 remove systemd-timestamp from sources
No sense in keeping this around if support for reading RD_TIMESTAMP has
been removed.
2013-07-23 11:41:54 -04:00
Kay Sievers ddc77f6224 switch from udev keymaps to hwdb 2013-07-16 16:22:01 +02:00
Thomas H.P. Andersen 6aea6d10f4 Add test coverage and generate report with lcov
Enable coverage with --enable-coverage.
"make coverage" will create the report locally,
"make coverage-sync" will upload the report to
http://www.freedesktop.org/software/systemd/coverage/.

Requires lcov version 1.10 to handle naming in systemd and to
use the --no-external option.

[zj: make the coverage at least generate something with
     separate build dir, simplify rules a bit: all errors
     are mine. ]
2013-07-13 21:56:33 -04:00
Zbigniew Jędrzejewski-Szmek a8b409dbc9 tests: add tests for string lookup tables
The tests check if the tables have entries for all values
in the enum, and that the entries are unique.
2013-07-05 01:36:16 -04:00
Lennart Poettering 1ee306e124 machined: split out machine registration stuff from logind
Embedded folks don't need the machine registration stuff, hence it's
nice to make this optional. Also, I'd expect that machinectl will grow
additional commands quickly, for example to join existing containers and
suchlike, hence it's better keeping that separate from loginctl.
2013-07-02 03:47:23 +02:00
Lennart Poettering c2756a6840 core: add transient units
Transient units can be created via the bus API. They are configured via
the method call parameters rather than on-disk files. They are subject
to normal GC. Transient units currently may only be created for
services (however, we will extend this), and currently only ExecStart=
and the cgroup parameters can be configured (also to be extended).

Transient units require a unique name, that previously had no
configuration file on disk.

A tool systemd-run is added that makes use of this functionality to run
arbitrary command lines as transient services:

$ systemd-run /bin/ping www.heise.de

Will cause systemd to create a new transient service and run ping in it.
2013-06-28 04:12:58 +02:00
Jan Janssen 3b18ae6866 test: Add list testcase 2013-06-27 01:38:47 -04:00
Jan Janssen 3a0e7bf541 gitignore: Add test-journal-interleaving 2013-06-12 09:25:21 -04:00
Lennart Poettering 8f155917bf bus: add benchmark tool to determine the right threshold for copying vs. memfd 2013-05-22 16:04:39 +02:00
Lennart Poettering 86312ab8de bus: add a more comprehensive test for the bloom filter logic 2013-05-20 10:13:38 +02:00
Lennart Poettering 453a0c2946 bus: add support for adding memfds into message payload 2013-05-15 19:45:45 +02:00
Lennart Poettering ddeb424198 bus: add new API for kdbus memfd functionality 2013-05-10 14:37:05 +02:00
Lennart Poettering dd418b9a69 bus: add kdbus test case 2013-04-12 00:26:12 +02:00
Lennart Poettering cb0dac0548 time: add suppot for fractional time specifications
We can now parse "0.5s" as the same as "500ms". In fact, we can parse
"3.45years" correctly, too, and any other unit and fraction length.
2013-04-03 23:00:08 +02:00
Lennart Poettering f73141d765 shared: rework env file reader
Implement this with a proper state machine, so that newlines and
escaped chars can appear in string assignments. This should bring the
parser much closer to shell.
2013-04-03 20:12:57 +02:00
Lennart Poettering 392d5b378c bus: parse matches locally and allow registration of callbacks for them
This includes code to parse and split up match strings which will also
be useful to calculate bloom filter masks when the time comes.
2013-03-31 16:16:37 +02:00
Lennart Poettering 11c4c24920 bus: add missing test-bus-server.c 2013-03-30 15:30:23 +01:00
Kay Sievers e592143e5a gitignore: update 2013-03-30 15:06:51 +01:00
Zbigniew Jędrzejewski-Szmek 1a13e31d27 build-sys,man: use XML entities to substite strings
This makes it easier to add substitutions to man pages,
avoiding the separate transformation step.

mkdir -p's are removed from the rule, because xsltproc will
will create directories on it's own.

All in all, two or three forks per man page are avoided,
which should make things marginally faster.

Unfortunately python parsers must too be tweaked to handle
entities. This isn't particularly easy: with lxml a custom
Resolver can be used, but the stdlib etree doesn't support
external entities *at all*. So when running without lxml,
the entities are just removed. Right now it doesn't matter,
since the entities are not indexed anyway. But I intend to
add indexing of filenames in the near future, and then the
index generated without lxml might be missing a few lines.
Oh well.
2013-03-29 20:30:21 -04:00
Lennart Poettering 30bdd69525 shared: add simple priority queue implementation 2013-03-21 02:54:47 +01:00
Lennart Poettering 89ffcd2ad5 bus: hook up client with socket communication 2013-03-20 23:00:10 +01:00
Lennart Poettering de1c301ed1 bus: add basic implementation of a native bus client library 2013-03-20 23:00:09 +01:00
Lennart Poettering 54c31a79f7 man: clarify systemctl --property= documentation a bit 2013-02-28 19:55:48 +01:00
Auke Kok 3e37b970b5 Add systemd-analyze to .gitignore 2013-02-13 14:51:12 -08:00
Kay Sievers 7b4d7cc082 bootctl: add boot loader and firmware interface tool 2013-02-11 19:35:52 +01:00
Thomas Hindoe Paaboel Andersen c62c294fd5 tests: add tests of strxcpyx
also fix a bad indentation in test-strbug.c
2013-02-10 23:06:16 +01:00
Thomas Hindoe Paaboel Andersen 97b5f60818 tests: add test of strbuf 2013-02-09 01:40:52 +01:00
Thomas Hindoe Paaboel Andersen 539ad707db test: add a few tests and tidy up
adds test of:
strv_find
strv_find_prefix
strv_overlap
strv_sort
streq_ptr
first_word

Splits tests of util.c into own file to avoid clutter as we add more.

Removed a few prints and uses _cleanup_free_ to make the tests more focused.
2013-02-06 21:15:23 +01:00
Lennart Poettering f4ce2b3e5c efi: add efi boot generator that automatically mounts the ESP to /boot 2013-01-21 01:04:16 +01:00
Lennart Poettering 2e3d069236 core: if the bootloader supports it, determine firmware and boot loader delay
This allows us to print simple performance data of all parts of the boot now:

- firmware
- boot loader
- kernel
- initrd
- userspace

This only works for bootloaders which support passing TSC data via EFI
variables. As of now that's only gummiboot.
2013-01-19 04:22:09 +01:00
Lennart Poettering a752addf67 git: ignore bootchart binary 2013-01-08 00:49:39 +01:00
Lennart Poettering e8bc0ea2b1 journalctl: strip TABs and ANSI color sequences from log messages when displaying them 2012-12-23 11:28:14 +01:00
Kay Sievers 1ebe2a47c4 gitignore: ignore .trs files from tests 2012-12-02 02:10:40 +01:00
Zbigniew Jędrzejewski-Szmek b5a223bfcf build-sys: use parallel tests driver
This saves test output to individual .log files.

The driver is only used in /Makefile.am, not in
/docs/*udev/Makefile.am because the latter don't seem to work with
this driver. They don't produce much output anyway.

.gitignore is alphabetized, and .log files are added to it.
Generated files from /build-aux are removed from the list.
2012-12-01 16:38:39 +01:00
Lennart Poettering 36697dc019 timer: implement calendar time events 2012-11-23 21:37:58 +01:00
Lennart Poettering d4205751d4 journal: implement message catalog
The message catalog can be used to attach short help texts to log lines,
keyed by their MESSAGE_ID= fields. This is useful to help the
administrator understand the context and cause of a message, find
possible solutions and find further related documentation.

Since this is keyed off MESSAGE_ID= this will only work for native
journal messages.

The message catalog supports i18n, and is useful to augment english
language system messages with explanations in the local language.

This commit only includes short explanatory messages for a few example
message IDs, we'll add more complete documentation for the relevant
systemd messages later on.
2012-11-15 23:09:07 +01:00
Holger Hans Peter Freyther bb11271068 sched: Only setting CPUSchedulingPriority=rr doesn't work
A service that only sets the scheduling policy to round-robin
fails to be started. This is because the cpu_sched_priority is
initialized to 0 and is not adjusted when the policy is changed.

Clamp the cpu_sched_priority when the scheduler policy is set. Use
the current policy to validate the new priority.

Change the manual page to state that the given range only applies
to the real-time scheduling policies.

Add a testcase that verifies this change:

$ make test-sched-prio; ./test-sched-prio
[test/sched_idle_bad.service:6] CPU scheduling priority is out of range, ignoring: 1
[test/sched_rr_bad.service:7] CPU scheduling priority is out of range, ignoring: 0
[test/sched_rr_bad.service:8] CPU scheduling priority is out of range, ignoring: 100
2012-11-15 16:16:45 +01:00
Lennart Poettering 6e6fb527f9 shared: add API for replacing @FOO@ style variables in strings 2012-11-14 22:21:16 +01:00
Lennart Poettering 6524990fdc logind: support for hybrid sleep (i.e. suspend+hibernate at the same time) 2012-10-28 00:50:35 +02:00
Lennart Poettering a4bcff5ba3 journal: introduce entry array chain cache
When traversing entry array chains for a bisection or for retrieving an
item by index we previously always started at the beginning of the
chain. Since we tend to look at the same chains repeatedly, let's cache
where we have been the last time, and maybe we can skip ahead with this
the next time.

This turns most bisections and index lookups from O(log(n)*log(n)) into
O(log(n)). More importantly however, we seek around on disk much less,
which is good to reduce buffer cache and seek times on rotational disks.
2012-10-26 03:24:03 +02:00
Kay Sievers b87377fca3 update .gitignore 2012-10-22 14:33:35 +02:00
Lennart Poettering 2087a7aff2 locale: add client tool localectl similar to hostnamectl/timedatectl 2012-10-19 04:55:49 +02:00
Lennart Poettering dbc4fbae58 hostname: add new hostnamectl tool as text client for hostnamed 2012-10-17 21:25:42 +02:00
Lennart Poettering 6d0274f115 timedatectl: introduce new command line client for timedated
Much like logind has a client in loginctl, and journald in journalctl
introduce timedatectl, to change the system time (incl. RTC), timezones
and related settings.
2012-10-17 21:25:42 +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
Lennart Poettering cfbc22abd0 journalctl: implement --since= and --until for filtering by time 2012-10-11 16:43:37 +02:00
Lennart Poettering 7b17a7d72f journal: add minimal journal gateway daemon based on GNU libmicrohttpd
This minimal HTTP server can serve journal data via HTTP. Its primary
purpose is synchronization of journal data across the network. It serves
journal data in three formats:

       text/plain: the text format known from /var/log/messages
       application/json: the journal entries formatted as JSON
       application/vnd.fdo.journal: the binary export format of the journal

The HTTP server also serves a small HTML5 app that makes use of the JSON
serialization to present the journal data to the user.

Examples:

This downloads the journal in text format:

 # systemctl start systemd-journal-gatewayd.service
 # wget http://localhost:19531/entries

Same for JSON:

 # curl -H"Accept: application/json" http://localhost:19531/entries

Access via web browser:

 $ firefox http://localhost:19531/
2012-09-28 00:55:24 +02:00
Lennart Poettering 2a2507e60d journal: add missing test file 2012-09-24 10:18:10 +02:00
Lennart Poettering ec29187225 Revert "multi-seat: drop multi-seat-x wrapper, as upstream X can handle multi-seat graphics on its own now"
This reverts commit 636d30a089.

Turns out we will need the multi-seat wrapper a bit longer, however
without the fb-specific bits in it.
2012-09-21 15:51:04 +02:00
Lennart Poettering 636d30a089 multi-seat: drop multi-seat-x wrapper, as upstream X can handle multi-seat graphics on its own now 2012-09-21 12:46:22 +02:00
Lennart Poettering b5b46d5995 when determining unit file list, include invalid unit names in an "invalid" state 2012-09-11 01:14:25 +02:00
Lennart Poettering 877d54e9b0 journal: generate structured journal messages for a number of events 2012-09-03 18:59:04 -07:00
Lennart Poettering 0284adc6a6 journal: split up journal-file.c 2012-08-16 17:10:57 +02:00
Zbigniew Jędrzejewski-Szmek 69b7fedfc0 gitignore: tags files 2012-07-17 12:22:19 +02:00
Lennart Poettering cbdca8525b journal: beef up journal matches considerably
we now can take multiple matches, and they will apply as AND if they
apply to different fields and OR if they apply to the same fields. Also,
terms of this kind can be combined with an overreaching OR.
2012-07-13 00:32:32 +02:00
Lennart Poettering b0193f1c1f systemctl: automatically turn paths and unescaped unit names into proper unit names
This makes sure that

  systemctl status /home

is implicitly translated to:

  systemctl status /home.mount

Similar, /dev/foobar becomes dev-foobar.device.

Also, all characters that cannot be part of a unit name are implicitly
escaped.
2012-06-22 13:08:48 +02:00
Lennart Poettering 87ce22cc0d readahead: merge three binaries into one
since the binaries share much of the same code and we better load only
one binary instead of two from disk at early boot let's merge the three
readahead binaries into one. This also allows us to drop a lot of
duplicated code.
2012-06-21 23:53:20 +02:00
Kay Sievers eb125fb693 update .gitignore 2012-06-10 18:28:53 +02:00
Lennart Poettering d360705f0f system-update: add system update generator
http://freedesktop.org/wiki/Software/systemd/SystemUpdates
2012-05-22 19:48:51 +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 27b5482cc0 delta: add systemd-delta tool to find overriden configuration and unit files 2012-05-16 03:24:50 +02:00
Lennart Poettering 6edd7d0a09 sleep: implement suspend/hibernate as first class targets 2012-05-08 13:54:23 +02:00
Lennart Poettering eecd1362f7 logind: implement delay inhibitor locks in addition to block inhibitor locks
This is useful to allow applications to synchronously save data before
the system is suspended or shut down.
2012-05-05 00:36:08 +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 acf9b2f154 update .gitignore 2012-04-17 16:04:42 +02:00
Kay Sievers f13b388f97 udev: install udevd as /usr/lib/systemd/systemd-udevd 2012-04-17 00:18:30 +02:00
Lennart Poettering f8e2fb7b14 logind: add shutdown/suspend/idle inhibition framework 2012-04-16 18:59:08 +02:00
Kay Sievers 3b6d9a7c50 update .gitignore 2012-04-13 21:58:01 +02:00
Lennart Poettering b562f5a57d build-sys: add stub makefiles to all subdirs to ease development with emacs 2012-04-13 21:37:59 +02:00
Kay Sievers 04a9d3a00a udev: fix gcc warnings showing up after adding $(AM_CFLAGS) 2012-04-10 17:27:46 +02:00
Lennart Poettering e96d6be763 systemd: add hardware watchdog support
This adds minimal hardware watchdog support to PID 1. The idea is that
PID 1 supervises and watchdogs system services, while the hardware
watchdog is used to supervise PID 1.

This adds two hardware watchdog configuration options, for the runtime
watchdog and for a shutdown watchdog. The former is active during normal
operation, the latter only at reboots to ensure that if a clean reboot
times out we reboot nonetheless.

If the runtime watchdog is enabled PID 1 will automatically wake up at
half the configured interval and write to the watchdog daemon.

By default we enable the shutdown watchdog, but leave the runtime
watchdog disabled in order not to break independent hardware watchdog
daemons people might be using.

This is only the most basic hookup. If necessary we can later on hook
up the watchdog ping more closely with services deemed crucial.
2012-04-05 22:15:29 +02:00
Kay Sievers 3e2147858f move imported udev into place 2012-04-04 05:05:07 +02:00
Lennart Poettering b070e7f3c9 journal: implicitly add code location to all messages logged with the native interface
This logic can be turned off by defining SD_JOURNAL_SUPPRESS_LOCATION
before including sd-journal.h.

This also saves/restores errno in all logging functions, in order to be
useful as logging calls without side-effects.

This also adds a couple of __unlikely__ around the early checks in the
logging calls, in order to minimize the runtime impact.
2012-04-02 19:29:48 +02:00
Lennart Poettering 169c4f6513 journalctl,loginctl: drop systemd- prefix in binary names
Let's make things a bit easier to type, drop the systemd- prefix for
journalctl and loginctl, but provide the old names for compat.

All systemd binaries are hence now prefixed with "systemd-" with the
exception of the three primary user interface binaries:

systemctl
loginctl
journalctl

For those three we do provide systemd-xyz names as well, via symlinks:

systemd-systemctl → systemctl
systemd-loginctl → loginctl
systemd-journalctl → journalctl

We do this only for the *primary* user tools, in order to avoid
unnecessary namespace problems. That means tools like systemd-notify
stay the way they are.
2012-03-26 20:58:47 +02:00
Lennart Poettering 9cacf56451 umount: don't try to umount /usr, if we are running from it 2012-03-06 01:28:32 +01:00
Lennart Poettering 36db9a8d5b login: add multi-session X wrapper
In preparation for https://bugzilla.gnome.org/show_bug.cgi?id=655380 we
decided it's better to include the multi-seat X wrapper in systemd,
rather than gdm. (Side effect: this makes this accessible for other
DMs)

This is a stop-gap for now, until X gins proper multi-seat graphics
support at which point this code will go away without replacement.
2012-01-23 23:34:36 +01:00
Kay Sievers c97e8d10fe add .vimrc 2012-01-23 04:42:11 +01:00
Lennart Poettering 8f2d43a012 cgtop: add new cgtop tool 2012-01-22 18:22:26 +01:00
Lennart Poettering f5e04665eb journal: hook up coredumping with journal 2012-01-14 01:54:33 +01:00
Lennart Poettering 755a02c680 journal: add new system-cat tool as kind of a more powerfull BSD logger 2012-01-14 01:54:33 +01:00
Lennart Poettering dcd5f1020c git: only ignore toplevel systemd file 2012-01-05 16:28:33 +01:00
Kay Sievers d4a66a7f96 libsystemd-id128: restructure Makefile.am 2011-12-31 08:53:06 +01:00
Kay Sievers 4668191d02 timedated: move sources to subdirectory 2011-12-31 06:40:48 +01:00
Lennart Poettering fc5e60ee0c git: update gitignore 2011-12-31 03:02:57 +01:00
Lennart Poettering 4b2d99d9f4 journal: add unit files and shared library glue 2011-12-30 17:50:37 +01:00
Lennart Poettering 87d2c1ff6a journal: add preliminary incomplete implementation 2011-10-07 22:02:05 +02:00
Lennart Poettering 346bce1f4c stdout-bridge: rename logger to stdout-syslog-bridge to make it more descriptive 2011-08-30 22:42:49 +02:00
Lennart Poettering 830964834f install: add new installer implementation
This new installer will replace the current code of "systemctl enable"
but also be available via D-Bus. It adds a couple of new features:

- Mask/Unmask calls
- Reenable call
- Preset call
- Support for enabling units temporarily (i.e. in /run/systemd instead
  of /etc/systemd)
- Enumeration of installed units
- Support for out-of-search-path units

systemctl and D-Bus are not hooked up with this yet
2011-07-22 04:31:21 +02:00
Lennart Poettering 3fd476bb11 git: hide more files from git 2011-07-14 23:52:16 +02:00
Lennart Poettering 114a50f898 sd-daemon: turn sd-daemon.c into a shared library 2011-07-14 23:06:31 +02:00
Lennart Poettering 74b91131ed logind: introduce libsystemd-login.so as fast path to access logind data 2011-07-14 22:51:28 +02:00
Lennart Poettering abca482291 loginctl: add basic implementation of loginctl for introspecting controlling sessions/users/seats 2011-07-07 03:29:56 +02:00
Lennart Poettering f401e48c2d mechanisms: add mechanisms to change system locale and clock 2011-06-21 19:29:45 +02:00
Lennart Poettering 5eda94dda2 logind: implement ACL management 2011-06-21 19:29:44 +02:00
Lennart Poettering 202630822f logind: first version that compiles fine 2011-06-21 19:29:44 +02:00
Lennart Poettering 7640a5de1b hostnamed: introduce systemd-hostnamed
http://www.freedesktop.org/wiki/Software/systemd/hostnamed
2011-04-16 02:03:35 +02:00
Lennart Poettering 151b190e79 binfmt: add binfmt tool to set up binfmt_misc at boot 2011-04-04 03:36:42 +02:00
Lennart Poettering 2a796654b9 getty: move automatic serial getty logic into generator 2011-03-15 00:45:46 +01:00
Lennart Poettering 8821347618 nspawn: add simple chroot(1) like tool to execute commands in a namespace container 2011-03-14 03:12:25 +01:00