Commit graph

1181 commits

Author SHA1 Message Date
Lennart Poettering a016b9228f core: add new .slice unit type for partitioning systems
In order to prepare for the kernel cgroup rework, let's introduce a new
unit type to systemd, the "slice". Slices can be arranged in a tree and
are useful to partition resources freely and hierarchally by the user.

Each service unit can now be assigned to one of these slices, and later
on login users and machines may too.

Slices translate pretty directly to the cgroup hierarchy, and the
various objects can be assigned to any of the slices in the tree.
2013-06-17 21:36:51 +02:00
Zbigniew Jędrzejewski-Szmek 330fe879ba build-sys: add 'man' target
Useful when working just on the documentation.
2013-06-12 13:41:08 -04:00
Ross Burton 622004565e build-sys: don't install quotaon.service twice
quotaon.service is already installed through dist_systemunit_DATA, so it doesn't
need to be added to nodist_systemunit_DATA.  Installing the same file twice
results in a race condition where the install process can fail.

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

[zj: actually remove quotaon.service from the other list.]
2013-06-12 01:40:02 -04:00
Marius Vollmer 7a050b54b7 tests: add testcase for skipping-entries-on-direction-change-bug
This test case failed until a3e6f050de.

Taken from https://bugs.freedesktop.org/show_bug.cgi?id=65255.
2013-06-10 10:10:07 -04:00
Tom Gundersen 5b46fc6c60 Makefile.am: merge conditionals
Merge all ENABLE_TMPFILES conditionals into one, and merge two ENABLE_EFI
conditionals. Also make sure the .in files are always distributed.
2013-06-03 16:00:51 +02:00
Umut Tezduyar 6351163bf3 build-sys: option to disable tmpfiles 2013-06-02 11:12:14 +02:00
Martin Pitt 98627dced7 keymap: Add Logitech USB (iTouch)
https://launchpad.net/bugs/1152377
2013-05-24 08:35:47 +02: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 45fbe937d7 bus: add minimal locking around the memfd cache
We want to allow clients to process an sd_bus_message on a different
thread than it was received on. Since unreffing a bus message might
readd some of its memfds to the memfd cache add some minimal locking
around the cache.
2013-05-17 04:26:27 +02:00
Lennart Poettering e4ee6e5cc3 bus: make bus ref counting atomic
This is preparation to allow sd_bus_message obejcts to be processed in a
different thread from their originating sd_bus object.
2013-05-16 21:58:34 +02:00
Lennart Poettering 3f92e4b4b6 utmp: turn systemd-update-utmp-shutdown.service into a normal runtime service
With this change systemd-update-utmp-shutdown.service is replaced by
systemd-update-utmp.service which is started at boot and stays around
until shutdown. This allows us to properly order the unit against both
/var/log and auditd.

https://bugzilla.redhat.com/show_bug.cgi?id=853104
https://bugs.freedesktop.org/show_bug.cgi?id=64365
2013-05-16 00:19:03 +02:00
Lennart Poettering c35b956d34 units: rework systemd-random-seed-{load,save}.service to be a single service
That way ordering it with MountsRequiredFor= works properly, as this no
longer results in mount units start requests to be added to the shutdown
transaction that conflict with stop requests for the same unit.
2013-05-15 22:38:51 +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
Zbigniew Jędrzejewski-Szmek a7739f8f97 build-sys: add convinience 'make python-shell'
This will launch $(PYTHON) with $LD_LIBRARY_PATH and $PYTHONPATH
as ./configure-d and DESTDIR-ed. Use as:
   make install DESTDIR=/var/tmp/inst python-shell
2013-05-09 18:13:33 -04:00
Lennart Poettering 606c24e3bd build-sys: prepare 204 2013-05-09 15:45:50 +02:00
Zbigniew Jędrzejewski-Szmek 539e0a4d58 systemd-python: add wrappers for easy functions in sd-login
sd_get_uids, sd_get_seats, sd_get_sessions, and sd_get_machine_names.
2013-05-08 21:35:03 -04:00
Zbigniew Jędrzejewski-Szmek 0b95a21bd7 build-sys: properly mkdir for GENERAL_ALIASES
Previous commit (20d408766) was broken. The problem is not connected
to DESTDIR being set or not, but to the fact that targets in
$GENERAL_ALIASES have directory components, so mkdir -p wasn't
recursing deep enough.
2013-05-07 14:41:07 -04:00
Zbigniew Jędrzejewski-Szmek 20d4087669 build-sys: properly mkdir with DESTDIR set
grawity> ln: failed to create symbolic link
‘/home/grawity/pkg/aur/systemd-git/pkg/systemd//etc/systemd/system/multi-user.target.wants/remote-fs.target’: No such file or directory
2013-05-07 14:17:18 -04:00
Lennart Poettering 2f3fcf85c5 build-sys: prepare new release 2013-05-06 23:43:59 +02:00
Zbigniew Jędrzejewski-Szmek 19adb8a320 systemd-sleep: add support for freeze and standby
A new config file /etc/systemd/sleep.conf is added.
It is parsed by systemd-sleep and logind. The strings written
to /sys/power/disk and /sys/power/state can be configured.
This allows people to use different modes of suspend on
systems with broken or special hardware.

Configuration is shared between systemd-sleep and logind
to enable logind to answer the question "can the system be
put to sleep" as correctly as possible without actually
invoking the action. If the user configured systemd-sleep
to only use 'freeze', but current kernel does not support it,
logind will properly report that the system cannot be put
to sleep.

https://bugs.freedesktop.org/show_bug.cgi?id=57793
https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=7e73c5ae6e7991a6c01f6d096ff8afaef4458c36
http://lists.freedesktop.org/archives/systemd-devel/2013-February/009238.html

SYSTEM_CONFIG_FILE and USER_CONFIG_FILE defines were removed
since they were used in only a few places and with the
addition of /etc/systemd/sleep.conf it becomes easier to just
append the name of each file to the dir name.
2013-05-06 22:51:57 +02:00
Lennart Poettering 8337416301 quota: use QUOTACHECK path correctly as tested in configure.ac
https://bugs.freedesktop.org/show_bug.cgi?id=63555
2013-05-06 21:15:38 +02:00
Harald Hoyer 8f51399e75 kernel-install: add default install scripts
Do the depmod in the kernel-install hooks, so hooks can produce/install
kernel modules and be part of the depmod.

Also move the basic boot loader entry creation and removal to a
plugin script.

If PRETTY_NAME is not defined in /etc/os-release, fallback to
PRETTY_NAME="Linux $KERNEL_VERSION".

Add documentation for everything in the man page.
2013-05-06 16:19:02 +02:00
Zbigniew Jędrzejewski-Szmek 202288be83 build-sys: tell rsync no to tranfer times and permissions
When rsyncing to fd.o, rsync would fail on symlinks in man/.
We don't care about the times too much anyway. rsync will
set times to "now", which is fine, since modification times
don't matter much outside of each uploader's machine anyway.

The point is to complete all steps of the transfer, so Python
documentation is properly updated.
2013-05-02 23:54:00 -04:00
Zbigniew Jędrzejewski-Szmek b5fafdf63f build-sys: "link" python _reader and pam_systemd against libsd-daemon-internal
The same old story as d3b9e0ff: those two use libsystemd-shared, and
in turn, some functions in libsystemd-shared use libsystemd-daemon.
The fact that *those* functions are used neither by the python modules
in question nor pam_systemd isn't always enough. Currently, I'm seeing
linking failures with -flto. The result of adding
libsystemd-daemon-internal to the list of linked libraries should be
harmless, with no change in size or final link requirements.
2013-05-02 22:55:38 -04:00
Daniel Buch 9341a4a167 test-hashmap.c: add unit-test for hashmap 2013-05-03 00:19:51 +02:00
Lennart Poettering 05947befce units: add an easy-to-use unit template file systemd-nspawn@.service for running containers as system services 2013-04-30 08:36:02 -03:00
Harald Hoyer 83cb95b530 add bash completion for systemd-analyze 2013-04-24 16:49:33 +02:00
Tom Gundersen 3e8037f17c units: rename systemd-static-nodes -> systemd-tmpfiles-setup-dev
This is really just a special case of systemd-tmpfiles-setup, moreover it could easily create more than static nodes.
2013-04-22 21:57:39 +02:00
Lennart Poettering ef3b524687 build-sys: prepare release 202 2013-04-19 00:41:24 +02:00
Josh Triplett 4befe2eba0 systemd-logind: Fix linking by reordering libraries in LDADD
libsystemd-audit needs functions from libsystemd-shared, so
libsystemd-audit needs to appear first.  Otherwise:

  CCLD   systemd-logind
./.libs/libsystemd-audit.a(audit.o): In function `audit_session_from_pid':
/home/josh/src/systemd/src/shared/audit.c:50: undefined reference to `detect_container'
2013-04-18 20:33:26 +02:00
Henrik Grindal Bakken cee22bd3cb buildsys: Add --disable-tests to avoid building tests
This patch adds --disable-tests to configure.  It is based on a patch
posted by Thierry Reding in 2010.  The motivation for adding it is that
some tests fail link-time when cross-compiling.

The patch adds a new Makefile variable -- manual_tests -- and uses
that instead of noinst_PROGRAMS.  However, if ENABLE_TESTS is true,
the former is added to the latter.  It also renames noinst_tests to
simply tests.
2013-04-18 17:15:59 +02:00
Zbigniew Jędrzejewski-Szmek a1c6506214 build-sys: make sure kdbus.h is part of tarball
Also fix 'update-man-list' rule and add rules for new man pages.
2013-04-17 00:09:16 -04:00
Auke Kok c4d58b0b6d bootchart: put the bootchart into the journal.
This bit of code is mostly stolen from coredump.c. We construct
a simple journal message and append the bootchart file in the
journal automatically.

You can extract the latest bootchart from the current boot with
something like:

$ journalctl -b MESSAGE_ID=9f26aa562cf440c2b16c773d0479b518 --field=BOOTCHART

which prints it to stdout.

None of the other logic is touched. The journal entry is created
even if bootchart was run manually, which is probably wrong.
2013-04-15 16:28:41 -07:00
Lennart Poettering a56f19c4f9 kdbus: generare bloom filters properly for messages we send 2013-04-14 17:49:18 +02:00
Tom Gundersen 8c11aac1d7 tmpfiles: create static device nodes before udev is started
Since v183, the contents of /usr/lib/udev/devices is no longer copied to /dev
on boot, rather systemd-tmpfiles should be used instead. However, as
systemd-tmpfiles --create is only ran long after udevd has been started, it is
no longer possible to use udev rules to assign permissions to the static nodes.

This calls systemd-tmpfiles --create early, before udev is started, and
restricts the call to /dev, which is known to be mounted already.

In the future, this could also take over the creation of static device nodes
from systemd-udevd.
2013-04-12 02:43:01 +02:00
Lennart Poettering dd418b9a69 bus: add kdbus test case 2013-04-12 00:26:12 +02:00
Lennart Poettering 6629161f82 bus: basic implementation of kdbus client side 2013-04-11 23:10:41 +02:00
Pali Rohar 72bd03c636 keymap: Add HP EliteBook 8460p
Taken from
https://code.launchpad.net/~pali/ubuntu/raring/udev/hp-elitebook-8460p/+merge/157420

Signed-off-by: Martin Pitt <martinpitt@gnome.org>
2013-04-09 15:32:22 +02:00
Lennart Poettering d3a86981d1 build-sys: prepare 201 2013-04-08 22:24:19 +02:00
Lennart Poettering 0c20f88d55 build-sys: libsystemd-daemon.so is no longer required for pam_systemd 2013-04-05 19:27:00 +02:00
Zbigniew Jędrzejewski-Szmek ac2b34e155 build-sys: use LN_S in Makefile.am
For consistency only. We're Linux only, so it really makes no
difference.

https://bugs.freedesktop.org/show_bug.cgi?id=63036
2013-04-05 11:43:46 -04: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
Zbigniew Jędrzejewski-Szmek d3b9e0ff4e build-sys: "link" libsystemd-id128 against libsd-daemon-internal
georgem> libsystemd-id128.so: undefined reference to `sd_listen_fds'

In some toolchains (--as-needed not used or not working), the
toolchain doesn't drop this dependency. It is introduced because
sd-id128.so is linked against sd-shared.la, and some functions therein
use libsystemd-daemon, but libsd-id128 doesn't use any of those
functions.

This results in no change in libsystemd-id128.so when the unused
symbols are properly stripped.
2013-04-03 16:14:29 -04: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 d51539b182 stdio-bridge: rework stdio bridge to use libsystemd-bus 2013-04-01 03:29:30 +02:00
Lennart Poettering 9ab32f9daa bus: reuse sd_is_socket() call 2013-04-01 03:29:29 +02:00
Lennart Poettering a7edaadd78 journal-gatewayd: query PID 1 for virtalization
Since journal-gatewayd is now running unprivileged, and detecting
virtalization requires privileges, query PID1 via D-Bus for the used
virtualization.

This is also the first time we use libsystemd-bus for more than just
testing.

https://bugs.freedesktop.org/show_bug.cgi?id=62173
2013-03-31 18:16:02 +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 2181a7f558 bus: implement server mode, and anonymous authentication 2013-03-30 15:21:55 +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
Zbigniew Jędrzejewski-Szmek 4e7b3c20e0 build-sys: generate sed substitution from a list
I want to use the substitutions in different form for
xml entities.
2013-03-29 20:30:21 -04:00
Zbigniew Jędrzejewski-Szmek aa0bb9c2c4 Revert "build-sys: substitute strings in systemd.unit(5)"
This reverts commits c78ab91132
and 185c3be03c.

It is simpler to just use includes...
2013-03-29 20:30:21 -04:00
Zbigniew Jędrzejewski-Szmek 76877b46b6 tests: add some silly tests for path-util.c 2013-03-28 23:45:59 -04:00
Zbigniew Jędrzejewski-Szmek 844ec79b3c catalog: open up catalog internals
In order to write tests for the catalog functions, they
are made non-static and start taking a 'database' parameter,
which is the name of a file with the preprocessed catalog
entries.

This makes it possible to make test-catalog part of the
normal test suite, since it now only operates on files
in /tmp.

Some more tests are added.
2013-03-28 23:45:59 -04:00
Zbigniew Jędrzejewski-Szmek c8c9c69f39 build-sys: remove papersize option from sphinx
We don't use it currently for anything (no latex output),
but it was messing up stuff if /etc/papersize had comments.
2013-03-28 22:55:52 -04:00
Lennart Poettering 9ca3c17f20 build-sys: prepare release 200 2013-03-29 03:07:17 +01:00
Lennart Poettering 0c17fbce55 unit: replace remote-fs-setup.target by network-online.target
https://bugzilla.redhat.com/show_bug.cgi?id=787314
2013-03-29 03:07:17 +01:00
Auke Kok b0640287f7 readahead: cleanups
- check for OOM
- no need to use floats and round()
2013-03-26 11:35:27 -07:00
Auke Kok 94243ef299 readahead: chunk on spinning media
Readahead has all sorts of bad side effects depending on your
storage media. On rotating disks, it may be degrading startup
performance if enough requests are queued spanning linearly
over all blocks early at boot, and mount, blkid and friends
want to insert reads to the start of these block devices after.

The end result is that on spinning disks with ext3/4 that udev
and mounts take a very long time, and nothing really happens until
readahead is completely finished.

This has the net effect that the CPU is almost entirely idle
for the entire period that readahead is working. We could have
finished starting up quite a lot of services in this time if
we were smarter at how we do readahead.

This patch sorts all requests into 2 second "chunks" and sub-sorts
each chunk by block. This adds a single cross-drive seek per "chunk"
but has the benefit that we will have a lot of the blocks we need
early on in the boot sequence loaded into memory faster.

For a comparison of how before/after bootcharts look (ext4 on a
mobile 5400rpm 250GB drive) please look at:

    http://foo-projects.org/~sofar/blocked-tests/

There are bootcharts in the "before" and "after" folders where you
should be able to see that many low-level services finish 5-7
seconds earlier with the patch applied (after).
2013-03-26 10:32:32 -07:00
Lennart Poettering 03e1151676 build-sys: bump version and .so revisions 2013-03-26 15:43:43 +01:00
Lennart Poettering 810bc2e3d5 build-sys: ship missing unit file 2013-03-26 02:49:11 +01:00
Kay Sievers 06f4289808 build-sys: create kernel/install.d directories 2013-03-26 01:00:14 +01:00
Lennart Poettering e06e62f4a1 man: properly document the system targets that are also available for the user instance 2013-03-25 22:33:08 +01:00
Lennart Poettering e3d84721dc units: introduce new timers.target and paths.target to hook timer/path units into for boot 2013-03-25 21:28:30 +01:00
Kay Sievers 5ec6b15b65 build-sys: add missing sed substitution for DEBUGTTY 2013-03-25 19:28:00 +01:00
Lennart Poettering a7e3212d89 bus: split socket related code into bus-socket.[ch], to prepare for kdbus backend 2013-03-25 03:43:19 +01:00
Kay Sievers 1d09582ab9 hwdb: ID_PRODUCT_FROM_DATABASE --> ID_MODEL_FROM_DATABASE
With the conversion from pci-db + usb-db to hwdb, the property
got accitentially renamed.

Move the name back to the long established identifier *MODEL*
instead of *PRODUCT*.

  $ git grep -l ID_MODEL_FROM_DATABASE
  hwdb/20-pci-vendor-model.hwdb
  hwdb/20-usb-vendor-model.hwdb
  hwdb/ids-update.pl
  man/systemd.device.xml
  rules/78-sound-card.rules
  src/core/device.c
  src/cryptsetup/cryptsetup.c
2013-03-23 16:38:21 +01:00
Zbigniew Jędrzejewski-Szmek 478c82693c build-sys: move acl searching code into libsystemd-acl
This loop over acls is a bit too much to keep inside
of another loop.
2013-03-22 15:31:45 -04:00
Lennart Poettering e3017af973 bus: implement full method call timeout logic 2013-03-21 22:53:29 +01:00
Kay Sievers f5944e0fd6 MAkefile.am: whitespace cleanup 2013-03-21 22:16:55 +01:00
Michael Biebl b588b3c456 build-sys: include missing header in dist tarball 2013-03-21 11:05:43 +01: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
Tom Gundersen a3bd8447be udev: make firmware loading optional and disable by default
Distros that whish to support old kernels should set
  --with-firmware-dirs="/usr/lib/firmware/updates:/usr/lib/firmware"
to retain the old behaviour.
2013-03-18 15:19:51 +01:00
Zbigniew Jędrzejewski-Szmek b04c8c83e8 systemd-python: add systemd.daemon wrapping sd-daemon
Please see the documentation (e.g. pydoc3 systemd.daemon) for full
description. As usual, systemd._daemon wraps the raw interface, while
systemd.daemon provides the more pythonic API. sd_listen_fds,
sd_booted, sd_is_fifo, sd_is_socket, sd_is_socket_unix,
sd_is_socket_inet, sd_is_mq, and SD_LISTEN_FDS_START are currently
wrapped.
2013-03-15 22:55:24 -04:00
Kay Sievers 8f27a2212e sysctl: add 50-default.conf 2013-03-15 16:37:58 +01:00
Kay Sievers 94c525f076 sysctl: coredump.conf -> 50-coredump.conf 2013-03-15 15:59:21 +01:00
Harald Hoyer 9e5f0f9291 Make initrd.target the default target in the initrd
First, rename root-fs.target to initrd-root-fs.target to clarify its usage.

Mount units with "x-initrd-rootfs.mount" are now ordered before
initrd-root-fs.target. As we sometimes construct /sysroot mounts in
/etc/fstab in the initrd, we want these to be mounted before the
initrd-root-fs.target is active.

initrd.target can be the default target in the initrd.

                             (normal startup)
                                    :
                                    :
                                    v
                              basic.target
                                    |
             ______________________/|
            /                       |
            |                  sysroot.mount
            |                       |
            |                       v
            |             initrd-root-fs.target
            |                       |
            |                       v
            |            initrd-parse-etc.service
(custom initrd services)            |
            |                       v
            |            (sysroot-usr.mount and
            |             various mounts marked
            |               with fstab option
            |                x-initrd.mount)
            |                       |
            |                       v
            |                initrd-fs.target
            |                       |
            \______________________ |
                                   \|
                                    v
                               initrd.target
                                    |
                                    v
                          initrd-cleanup.service
                               isolates to
                         initrd-switch-root.target
                                    |
                                    v
             ______________________/|
            /                       |
            |        initrd-udevadm-cleanup-db.service
            |                       |
(custom initrd services)            |
            |                       |
            \______________________ |
                                   \|
                                    v
                        initrd-switch-root.target
                                    |
                                    v
                        initrd-switch-root.service
                                    |
                                    v
                               switch-root
2013-03-15 00:49:37 +01:00
Zbigniew Jędrzejewski-Szmek d29dd03302 build-sys: link libsystemd-login also against libsystemd-daemon-internal
https://bugs.freedesktop.org/show_bug.cgi?id=62085

/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libsystemd-login.so:
undefined reference to `sd_listen_fds'

In ee465038ce 'build-sys: break dependency loop between
libsystemd-id128.la and -shared.la', a partial fix was applied, and
the use of functions from libsystemd-id128 was removed from
libsystemd-shared. Nevertheless, fdset.c was still using sd_listen_fds,
so libsystemd-login should be linked against libysystemd-daemon
or libsystemd-daemon-internal.

Tested-by: Elias Probst <mail@eliasprobst.eu>
2013-03-13 22:20:51 -04:00
Zbigniew Jędrzejewski-Szmek 4afb5c73a2 build-sys: add two new files to EXTRA_DIST
Also move custom-*.xsl EXTRA_DIST additions closer to where
they are used.
2013-03-13 13:24:14 -04:00
Hannes Reinecke 946f182575 libudev: implement udev_device_set_attribute_value() 2013-03-13 17:44:45 +01:00
Harald Hoyer 700e07ffd5 add initrd-fs.target and root-fs.target
Instead of using local-fs*.target in the initrd, use root-fs.target for
sysroot.mount and initrd-fs.target for /sysroot/usr and friends.

Using local-fs.target would mean to carry over the activated
local-fs.target to the isolated initrd-switch-root.target and thus in
the real root. Having local-fs.target already active after
deserialization causes ordering problems with the real root services and
targets.

We better isolate to targets for initrd-switch-root.target, which are
only available in the initrd.
2013-03-13 08:11:17 +01:00
Zbigniew Jędrzejewski-Szmek 783162123d build-sys: use -f with ln -s
Parallel builds would sometimes try to recreate the link,
and fail since 'ln -s' would refuse to overwrite.
2013-03-13 00:55:45 -04:00
Zbigniew Jędrzejewski-Szmek 702f64b93c man,html: say 'systemd 198' in the header
This should help readers of the man or HTML pages know if the documentation
is out of date. An alternative to use a date generated from 'git log' was
considered, but since we try to keep user visible documentation up to date,
showing the project version should be enough.
2013-03-12 23:57:46 -04:00
Zbigniew Jędrzejewski-Szmek a0b8045be2 man: strip the comments in man page headers
They contained the date, which creates a problem with multiarch
packages, since the generated file would be different each time.
2013-03-12 23:57:46 -04:00
Zbigniew Jędrzejewski-Szmek ee465038ce build-sys: break dependency loop between libsystemd-id128.la and -shared.la
The loop was added in d848b9cbfa 'Move generic specifier functions to shared'.
2013-03-12 23:05:53 -04:00
Lennart Poettering 6d031c0b60 bootchart: various superficial cleanups
Let's update bootchar to share the coding style a bit more with the rest
of the package.

- Some tabs/spaces fixes

- add #pragma to header

- split up header so that we have a 1:1 relation between .c and .h files
  like everywhere else

- Prefix user command line arguments/configuration settings with "arg_".

- other coding style fixes
2013-03-11 22:47:58 +01:00
Lennart Poettering e75dcf5737 bootchart: rename log.c to store.c to aovid confusion with src/shared/log.c 2013-03-11 19:18:53 +01:00
Michael Biebl f432bb9144 Move udevadm to rootbindir
The udevadm utility is needed during early boot, so move it to
rootbindir to support split-/usr configurations.
2013-03-11 07:18:33 +01:00
Zbigniew Jędrzejewski-Szmek 082cca735b python/docs: use the same links on top as in man pages
I forgot to commit the layout file, because it was gitignored.
Fixed now.
2013-03-09 09:56:19 -05:00
Zbigniew Jędrzejewski-Szmek 9f06e912f6 systemd-python: provide version info to sphinx 2013-03-09 08:47:50 -05:00
Zbigniew Jędrzejewski-Szmek 87cfe600c7 build-sys: generate links for html alias pages 2013-03-09 08:47:50 -05:00
Zbigniew Jędrzejewski-Szmek 9b2810721d build-sys: assemble HTML in docs/html
The goal is to be able to preview how the documenation
will look when uploaded. Just point your browser at
   docs/html/man/index.html.
2013-03-09 08:47:50 -05:00
Zbigniew Jędrzejewski-Szmek 86b4547712 build-sys: clean up make clean 2013-03-09 08:47:50 -05:00
Zbigniew Jędrzejewski-Szmek f6354e8c11 build-sys: fix distcheck 2013-03-09 08:47:50 -05:00
Michael Biebl 7b40ce553f build-sys: don't hard-code binary paths in initrd-*.service
Instead use @bindir@ for udevadm and @rootbindir@ for systemctl.
2013-03-09 10:05:01 +01:00
Lennart Poettering 01ec23582d build-sys: bump release and sonames 2013-03-07 21:53:53 +01:00
Zbigniew Jędrzejewski-Szmek e91fb201c7 build-sys: move sphinx output to docs/python-systemd
And on fd.o it goes into a dir parallel to man/.
2013-03-07 15:35:49 -05:00
Nathaniel Chen ffbd2c4d45 core: mount and initialize Smack
SMACK is the Simple Mandatory Access Control Kernel, a minimal
approach to Access Control implemented as a kernel LSM.

The kernel exposes the smackfs filesystem API through which access
rules can be loaded. At boot time, we want to load the access rules
as early as possible to ensure all early boot steps are checked by Smack.

This patch mounts smackfs at the new location at /sys/fs/smackfs for
kernels 3.8 and above. The /smack mountpoint is not supported.
After mounting smackfs, rules are loaded from the usual location.

For more information about Smack see:
  http://www.kernel.org/doc/Documentation/security/Smack.txt
2013-03-07 20:53:14 +01:00
Zbigniew Jędrzejewski-Szmek 17edd81a9d build-sys: force creation of symlink
For some reason make sometimes wants to rerun this, and
ln would refuse to recreate the link.
2013-03-07 11:29:08 -05:00
Zbigniew Jędrzejewski-Szmek 9304ef91c5 libsystemd-journal: export new function, increase library version
Since sd_journal_reliable_fd wasn't exported before, it is as if
it was added now. Library "current" number must be bumped.

michich> Someone links with the fixed version and produces a RPM with
         his program. The RPM will happily install on a system with an
         old systemd version (the deps will appear fine), but the
         program will fail to run.
2013-03-06 14:15:09 -05:00
Zbigniew Jędrzejewski-Szmek e76d2e20a5 build-sys: add missing $
Fixup for 25ee45f99.
2013-03-06 12:02:50 -05:00
Harald Hoyer 7fdf51751c Revert "add initrd-fs.target and initrd-fs-pre.target"
This reverts commit 39b83cdab3.
2013-03-06 11:03:39 +01:00
Lennart Poettering a24c64f03f journald: introduce new "systemd-journal" group and make it own the journal files
Previously all journal files were owned by "adm". In order to allow
specific users to read the journal files without granting it access to
the full "adm" powers, introduce a new specific group for this.

"systemd-journal" has to be created by the packaging scripts manually at
installation time. It's a good idea to assign a static UID/GID to this
group, since /var/log/journal might be shared across machines via NFS.

This commit also grants read access to the journal files by default to
members of the "wheel" and "adm" groups via file system ACLs, since
these "almost-root" groups should be able to see what's going on on the
system. These ACLs are created by "make install". Packagers probably
need to duplicate this logic in their postinst scripts.

This also adds documentation how to grant access to the journal to
additional users or groups via fs ACLs.
2013-03-05 18:59:03 +01:00
Michael Biebl d51167c626 build-sys: build and install systemd-coredumpctl conditionally
If coredump support is disabled via --disable-coredump, do not build and
install the systemd-coredumpctl binary and man page.
2013-03-04 23:23:06 +01:00
Harald Hoyer 39b83cdab3 add initrd-fs.target and initrd-fs-pre.target 2013-03-04 19:33:50 +01:00
Michael Biebl 25ee45f995 build-sys: replace backticks `` with $()
for consistencies sake use $() everywhere
2013-03-04 01:46:03 +01:00
Michael Biebl db059f1b03 build-sys: don't hard code bash-completion directory 2013-03-04 00:10:38 +01:00
Michael Biebl d611dadcc7 bash-completion: split completions and move to new location
Split the large bash completion script into separate, smaller files each
named after the binary it is used for and move the files to
/usr/share/bash-completion/completions. This way the completions can be
loaded on demand and we only install the completions for the tools we
actually build. The old path /etc/bash_completion.d/ is deprecated and
will disappear in the future.
2013-03-03 14:39:51 +01:00
Tom Gundersen cf84347794 initrd: add unit files needed for basic systemd-in-initrd support
This will:
 * mount all configured filesystems (typically the rootfs on /sysroot)
 * reload the configuration to pick up anything from the mounted fs (typically
   /sysroot/etc/fstab)
 * mount any newly configured filesystems (typically /usr on /sysroot/usr, if
   applicable)
 * shut-down and clean-up any daemons running in the initramfs (typically udevd)
 * switch-root to /sysroot and start the real init

For an example of what files should be included in an initramfs based on this
see
<https://mailman.archlinux.org/pipermail/arch-projects/2013-February/003628.html>.

Cc: Harald Hoyer <harald.hoyer@gmail.com>
Cc: Dave Reisner <d@falconindy.com>
2013-03-01 22:52:36 +01:00
Zbigniew Jędrzejewski-Szmek 37d3ab1b7e Merge branch 'python-systemd-reader'
* python-systemd-reader:
  python-systemd: rename Journal to Reader
  build-sys: upload python documentation to freedesktop.org
  systemd-python: add Journal class for reading journal
  python: build html docs using sphinx
  journalct: also print Python code in --new-id
  python: utilize uuid.UUID in logging
  python: add systemd.id128 module
  ... and 34 other commits

In short: python module systemd.id128 is added, and existing
systemd.journal gains a new class systemd.journal.Reader, which can be
used to iterate over journal entries. Documentation is provided, and
accessible under e.g.
    pydoc3 systemd.journal.Reader
or
    firefox http://www.freedesktop.org/software/systemd/man/python-systemd/
2013-02-28 20:05:12 -05:00
Zbigniew Jędrzejewski-Szmek 6a6633a16a python-systemd: check all errors and use automatic cleanup
__REALTIME_TIMESTAMP and __MONOTONIC_TIMESTAMP return ints.
It doesn't make sense to convert to string, just to convert
back to a number later on.

Also try to follow systemd rules for indentation.
2013-02-28 20:04:17 -05:00
Zbigniew Jędrzejewski-Szmek d426d8c863 build-sys: upload python documentation to freedesktop.org 2013-02-28 20:04:17 -05:00
Zbigniew Jędrzejewski-Szmek 603c0b7b14 build-sys: make sphinx support uncoditional
It needs to be invoked explicitly, so there's no need to check
explicitly.
2013-02-28 20:04:17 -05:00
Zbigniew Jędrzejewski-Szmek 2ca0435be9 systemd-activate: add a socket-activation test tool 2013-02-27 22:10:14 -05:00
Zbigniew Jędrzejewski-Szmek 185c3be03c build-sys: fix update-man-rules for vpath builds 2013-02-27 21:55:00 -05:00
Zbigniew Jędrzejewski-Szmek fcc43d0158 build-sys: tell Makefile.am to distribute kernel-install 2013-02-27 21:54:59 -05:00
Lennart Poettering 26d04f86a3 unit: rework resource management API
This introduces a new static list of known attributes and their special
semantics. This means that cgroup attribute values can now be
automatically translated from user to kernel notation for command line
set settings, too.

This also adds proper support for multi-line attributes.
2013-02-27 18:50:41 +01:00
Harald Hoyer 81516adcb7 kernel-install: add kernel-install tool 2013-02-25 18:58:06 +01:00
Dave Reisner 855f6f07fe build: remove explicit -shared in LDFLAGS
This doesn't need to be passed, as it's handled by libtool. Since the
default for autoconf is --disable-static, this change is effectively a
noop. It only matters if you pass --enable-static, in which case the
static libs for systemd libraries will actually be built.

Nitpicky, but this only affects systemd libs. The override for the
other libs remains since these libs are always loaded dynamically and
never compiled staticly.
2013-02-24 16:46:02 -05:00
Kay Sievers f948423bb5 build-sys: move systemd-analyze to /usr/bin 2013-02-22 17:02:41 +01:00
Steven Hiscocks c4e9b5b557 systemd-python: add Journal class for reading journal 2013-02-22 16:57:43 +01:00
Zbigniew Jędrzejewski-Szmek 9015fa646e python: build html docs using sphinx
Build instructions:
   make
   make DESTIDIR=/tmp/... install
   make DESTIDIR=/tmp/... sphinx-html sphinx-man sphinx-epub ...
2013-02-22 16:57:43 +01:00
Zbigniew Jędrzejewski-Szmek 927e96326c python: add systemd.id128 module
uuid.UUIDs are utilized to hold UUID values.
2013-02-22 16:57:43 +01:00
Harald Hoyer a5c32cff1f honor SELinux labels, when creating and writing config files
Also split out some fileio functions to fileio.c and provide a SELinux
aware pendant in fileio-label.c

see https://bugzilla.redhat.com/show_bug.cgi?id=881577
2013-02-14 16:19:38 +01:00
Simon Peeters 2265fbf7e5 systemd-analyze: rewrite in C.
Written by Peeters Simon <peeters.simon@gmail.com>.
Makefile stuff and cleaned up a bit by Auke Kok <auke-jan.h.kok@intel.com>.
Some code inspired by Marc-Antoine Perennou <Marc-Antoine@Perennou.com>.
2013-02-13 14:46:50 -08:00
Lennart Poettering b872e9a059 build-sys: make EFI support build-time optional 2013-02-13 23:08:25 +01:00
Lennart Poettering 46ba8aae2b build-sys: make PolicyKit support compile-time optional (was runtime-optional already) 2013-02-13 23:08:25 +01:00
Zbigniew Jędrzejewski-Szmek 5322bdd4cc build-sys: fix build without -Wl,--gc-sections
bootctl needs libsystemd-daemon.la too.
2013-02-13 16:15:20 -05:00
Kay Sievers 7b4d7cc082 bootctl: add boot loader and firmware interface tool 2013-02-11 19:35:52 +01:00
Lennart Poettering 4d1a690438 env: considerably beef up environment cleaning logic
Now, actually check if the environment variable names and values used
are valid, before accepting them. With this in place are at some places
more rigid than POSIX, and less rigid at others. For example, this code
allows lower-case environment variables (which POSIX suggests not to
use), but it will not allow non-UTF8 variable values.

All in all this should be a good middle ground of what to allow and what
not to allow as environment variables.

(This also splits out all environment related calls into env-util.[ch])
2013-02-11 03:54:50 +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
Lennart Poettering c65eb83653 shutdown: issue a sync() as soon as shutdown.target is queued 2013-02-09 02:20:42 +01:00
Thomas Hindoe Paaboel Andersen 97b5f60818 tests: add test of strbuf 2013-02-09 01:40:52 +01:00
Kay Sievers 3d85f7e02a build-sys: link libudev against the internal sd-daemon lib, not the source file 2013-02-08 13:25:26 +01:00
Zbigniew Jędrzejewski-Szmek 9d6cbf7871 build-sys: fix build without -Wl,--gc-sections
In 8d81eb8e the new library was added for libudev, use it for
libsystemd-journal too.
2013-02-07 16:26:09 -05:00
Kay Sievers beb23689e3 udev: remove HWDB_BIN 2013-02-07 21:54:49 +01:00
Kay Sievers 8d81eb8e24 build-sys: at least for now, never link libudev against systemd's shared libraries 2013-02-07 14:35:20 +01:00
David Strauss 78c55e2155 build-sys: add libsystemd-id128 as libudev dependency
After d848b9cbfa 'Move generic specifier functions to shared' libudev
depends (through) libsystemd-shared.la on libsystemd-id128.so.  The
problem only appears when the linker does not support --gc-sections
and manifests itself as the inability to resolve sd_id128_get_machine
and other libsystemd-id128 functions, which aren't really used.
2013-02-07 01:28:16 -05:00
Zbigniew Jędrzejewski-Szmek 42007a09f3 build-sys: restore man/index.html as link to systemd.index.html
It got lost in the transformation to XML generation.
2013-02-07 01:16:30 -05:00
Zbigniew Jędrzejewski-Szmek 13219b7f74 man: describe unit load path in systemd.unit(5)
In other cases where multiple directories are searched for unit files,
the list of directories is described in the man page describing the
format. I think this makes sense too in case of systemd directories,
since the systemd(1) manpage already has an overview of many different
topics.
2013-02-07 01:00:10 -05:00
Zbigniew Jędrzejewski-Szmek c78ab91132 build-sys: substitute strings in systemd.unit(5)
Makefile.am is updated to deal with .xml.in sources.  Nothing in the
output is really changed yet, this is just preparation.
2013-02-06 23:16:17 -05:00
Zbigniew Jędrzejewski-Szmek 56ba3c78ae build-sys: create Makefile-man.am automatically
man rules were repeating the same information in too many places,
which was error prone. Those rules can be easily generated from .xml
files. For efficiency and because python is not a required dependency,
Makefile-man.am is only regenerated when requested with

  make update-man-list

If no metadata in man/*.xml changed, this file should not change. So
only when a new man page or a new alias is added, this file should
show up in 'git diff'. The change should then be committed.

If the support for building from git without python was dropped, we
could drop Makefile-man.am from version control. This would also
increase the partial build time (since more stuff would be rebuild
whenever sources in man/*.xml would be modified), so it would probably
wouldn't be worth it.
2013-02-06 23:16:16 -05:00
Zbigniew Jędrzejewski-Szmek 823eb4e64e build-sys: split man alias rules into separate file
There shouldn't be any functional change. This is an 'automake include',
so the generated Makefile is the same (apart from ordering).
2013-02-06 23:16:16 -05:00
Zbigniew Jędrzejewski-Szmek 63ed840e59 build-sys: replace one last mkdir hook with list item
Previously, errors would be ignored. Now they are not. But I don't see
how we could fail to create the directory, so I don't think that it
matters.
2013-02-06 23:16:03 -05: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
Kay Sievers 2a4b7e7bf2 build-sys: fix empty lines 2013-01-30 18:14:44 +01:00