Commit graph

2255 commits

Author SHA1 Message Date
Kay Sievers 19c5f19d69 import udev repository 2012-04-03 21:08:04 +02:00
Lennart Poettering 3eff4208ff logind: log with AUTH facility 2012-04-03 19:26:02 +02:00
Lennart Poettering 3338b9595b fix a couple of AF_UNIX connect() calls 2012-04-03 19:24:12 +02:00
Lennart Poettering ba8d3790e8 journal: in json and export mode use double underscores to prefix location fields
Many programming languages don't allow variable names beginning in dots,
hence let's use double underscores for the location fields instead. This
gets us the simple rule:

__ is the prefix for location fields (i.e. fields that are used to
identify entries, rather than part of the entries)

_ is the prefix for trusted fields (i.e. those fields journald itself
adds to all entries)

no prefix for unrusted fields (i.e. all fields normal client code sends
us)
2012-04-03 18:15:28 +02:00
Lennart Poettering 568b679f2a systemctl: make -f short for both --follow and --force 2012-04-03 14:43:48 +02:00
David Ward 48bb58769a service: schedule JOB_RESTART from SERVICE_AUTO_RESTART state
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45511
2012-04-03 14:27:13 +02:00
Colin Guthrie 6070fe66ac analyze: Cosmetic exit when the bootup is not yet complete when plotting.
This is just a nicer message than a python traceback.
2012-04-02 22:12:35 +02:00
Michal Schmidt 6008900425 Revert "socket: if we fail to create an instantiated service for a socket, don't put the socket in failure mode"
This reverts commit 9586cdfab6.
(but not the TODO hunk).

The bug was already fixed by 1a710b43. And if other errors occur, we
don't want to leave the socket active in order to avoid having socket
tarpits.
2012-04-02 21:49:00 +02:00
Dave Reisner fb5ef067c4 install: check for proper return from dirent_ensure_type
Fixes 'systemctl list-unit-files', which previously returned only:

  Failed to issue method call: No such file or directory
2012-04-02 21:47:18 +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 1fa80181ae journal: decrease default mmap window size to allow a bigger number of journals to be traversed in parallel 2012-04-02 19:29:47 +02:00
Dave Reisner dcc219a273 bash-completion: update naming of loginctl
18b754d3 changed the name of systemd-loginctl to loginctl, but didn't
update the bash-completion to match.
2012-04-02 01:25:14 +02:00
Kay Sievers 18b754d345 rename /etc/systemd/systemd-{login,journal}d.conf to {login,journal}d.conf 2012-03-30 23:36:44 +02:00
Michal Schmidt bbd1a8374f job: add debug prints where job type gets changed 2012-03-28 11:13:13 +02:00
Michal Schmidt dd17d38879 job: fix loss of ordering with restart jobs
Suppose that foo.service/start is a job waiting on other job bar.service/start
to finish. And then foo.service/restart is enqueued (not using
--ignore-dependencies).

Currently this makes foo.service start immediately, forgetting about the
ordering to bar.service.

The runnability check for JOB_RESTART jobs looks only at dependencies for
stopping. That's actually correct, because restart jobs should be treated the
same as stop jobs at first. The bug is that job_run_and_invalidate() does not
treat them exactly the same as stop jobs. unit_start() gets called without
checking for the runnability of the converted JOB_START job.

The fix is to simplify the switch in job_run_and_invalidate(). Handle
JOB_RESTART identically to JOB_STOP.
Also simplify the handling of JOB_TRY_RESTART - just convert it to JOB_RESTART
if the unit is active and let it fall through to the JOB_RESTART case.
Similarly for JOB_RELOAD_OR_START - have a fall through to JOB_START.

In job_finish_and_invalidate() it's not necessary to check for JOB_TRY_RESTART
with JOB_DONE, because JOB_TRY_RESTART jobs will have been converted to
JOB_RESTART already.

Speeding up the restart of services in "auto-restart" state still works as
before.

Improves: https://bugzilla.redhat.com/show_bug.cgi?id=753586
but it's still not perfect. With this fix the try-restart action will wait for
the restart to complete in the right order, but the optimal behaviour would be
to finish quickly (without disturbing the start job).
2012-03-28 11:13:13 +02:00
Lennart Poettering 6030831d5b journal: properly handle if we interleave files with different boot ids
If we try to locate a monotonic time in a file that doesn't have any
entries with the matching boot id, then don't fail on it, simply
fall back to calendar time.
2012-03-27 18:50:34 +02:00
Lennart Poettering d508ac0ba0 cat: fix priority type
Needs to be "int", not "char". Spotted by Frederic Crozat.
2012-03-27 00:20:48 +02:00
Lennart Poettering 2bd3c38a44 journalctl: add --local switch 2012-03-27 00:14:29 +02:00
Elan Ruusamäe 6ad548625e man: minor typo in reference to manual page 2012-03-26 18:20:55 +02:00
Kay Sievers 8482018afc libudev: monitor - do not memset() receive buffer 2012-03-22 03:46:16 +01:00
Lennart Poettering 75c8e3cffd logind: close FIFO before ending sessions cleanly
For clean session endings ask logind explicitly to get rid of the FIFO
before closing it so that the FIFO logic doesn't result in su/sudo to be
terminated immediately.
2012-03-22 02:06:40 +01:00
Lennart Poettering c9d8629baa logind: extend comment about X11 socket symlink 2012-03-22 01:43:36 +01:00
Frederic Crozat 4fd052aede add sparse support to detect endianness bug
le16/32/64_t type should be used when storing little-endian value

header to integrate with sparse from Josh Triplett <josh@joshtriplett.org>
2012-03-22 01:09:37 +01:00
Lennart Poettering 170dcb7bd5 binfmt: fix apply loop
Noticed by Sergey Ptashnick
2012-03-22 00:35:42 +01:00
Roberto Sassu 8161158639 main: added support for loading IMA custom policies
This is an S/MIME signed message

The new function ima_setup() loads an IMA custom policy from a file in the
default location '/etc/ima/ima-policy', if present, and writes it to the
path 'ima/policy' in the security filesystem. This function is executed
at early stage in order to avoid that some file operations are not measured
by IMA and it is placed after the initialization of SELinux because IMA
needs the latter (or other security modules) to understand LSM-specific
rules. This feature is enabled by default and can be disabled by providing
the option '--disable-ima' to the configure script.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Acked-by: Gianluca Ramunno <ramunno@polito.it>
2012-03-22 00:20:58 +01:00
Roberto Sassu 160481f68d systemd: mount the securityfs filesystem at early stage
This is an S/MIME signed message

The mount of the securityfs filesystem is now performed in the main systemd
executable as it is used by IMA to provide the interface for loading custom
policies. The unit file 'units/sys-kernel-security.mount' has been removed
because it is not longer necessary.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Acked-by: Gianluca Ramunno <ramunno@polito.it>
2012-03-22 00:20:48 +01:00
Lennart Poettering 7264278fbb journal: PAGE_SIZE is not known on ppc and other archs
Let's use NAME_MAX, as suggested by Dan Walsh
2012-03-21 23:47:44 +01:00
Lennart Poettering 0071d9f1db journal: react with immediate rotation to a couple of more errors 2012-03-21 23:40:51 +01:00
Vaidas Jablonskis abac5c7976 keymap: Add Samsung 90X3A
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2012-03-21 14:51:39 +01:00
Lennart Poettering de19ece738 sysctl: accept multiple passed configuration files 2012-03-20 15:31:09 +01:00
Lennart Poettering 4e2075ceea modules-load: drop /lib from search path if we don't have it split off 2012-03-20 15:30:42 +01:00
Lennart Poettering 133176702a bmfmt: allow passing more than one config file name 2012-03-20 15:29:49 +01:00
Michal Schmidt ee4cbc2c85 remove GTK pieces
They've moved to systemd-ui.
2012-03-20 13:10:22 +01:00
Kay Sievers 183215e7cd build-sys: place build binaries in the root 2012-03-18 17:04:47 +01:00
Michal Schmidt 5ebff53375 util: never follow symlinks in rm_rf_children()
The function checks if the entry is a directory before recursing, but
there is a window between the check and the open, during which the
directory could be replaced with a symlink.

CVE-2012-1174
https://bugzilla.redhat.com/show_bug.cgi?id=803358
2012-03-16 18:33:02 +01:00
Lennart Poettering 2af777ba96 man: document systemd-journalctl(1) 2012-03-16 00:50:52 +01:00
Lennart Poettering b47ffcfdfd man: document systemd-journald.conf(5) 2012-03-15 23:25:14 +01:00
Lennart Poettering 9aac0b2c19 man: document systemd-cat(1) 2012-03-15 22:19:36 +01:00
Frederic Crozat ccdbaf9111 journal: only use uint8_t for state 2012-03-15 20:53:03 +01:00
Lennart Poettering 34a35eced4 a couple of fixes to make llvm-analyze quiet 2012-03-15 20:49:25 +01:00
Tero Roponen 490e567dbb journalctl: add a missing 'break'
There is a 'break' missing in the -q handling
so, for example, 'systemd-journalctl --new-id128 -q'
does nothing.

This patch fixes the problem.
2012-03-15 14:12:30 +01:00
Lennart Poettering 27d1ae066c journald: don't try to roatet corrupted files when we open read-only anyway 2012-03-15 03:01:09 +01:00
Lennart Poettering 5e62067d08 journald: adjust permissions for rotated files 2012-03-15 03:01:09 +01:00
Lennart Poettering c042179388 journald: take corrupted files into account when calculating disk space 2012-03-15 03:01:09 +01:00
Lennart Poettering e7bf07b3d4 journald: be a bit more verbose 2012-03-15 03:01:09 +01:00
Lennart Poettering a3a52c0fd0 journald: fix calculation of disk space 2012-03-15 03:01:09 +01:00
Lennart Poettering 15944db871 journald: copy metrics/compression state from template when rotating 2012-03-15 03:01:09 +01:00
Lennart Poettering 71100051c5 journald: increase max file size to 128MB 2012-03-15 02:57:39 +01:00
Lennart Poettering 5c70eab445 journal: vacuum corrupted files, too 2012-03-15 01:35:03 +01:00
Lennart Poettering 9447a7f1de journal: if we encounter a corrupted file, rotate and go on 2012-03-15 01:13:01 +01:00
Lennart Poettering 4d1c38b807 nspawn: mount /etc/timezone into nspawn environment too 2012-03-15 00:45:02 +01:00
Lennart Poettering 6bc1ce40e5 journald: fix typo 2012-03-15 00:44:26 +01:00
Lennart Poettering 4f4d6a7073 journalctl: suppress messages about adm group if ACL support is not enabled 2012-03-15 00:44:10 +01:00
Lennart Poettering fb0864e7b9 virt: the pidns controller does not exist anymore 2012-03-15 00:43:47 +01:00
Lennart Poettering 67aa455172 journald: set SO_PASSEC only if selinux is enabled 2012-03-14 20:07:50 +01:00
Lennart Poettering 4367379907 journalctl: warn if the user is not in the adm group 2012-03-14 19:54:22 +01:00
Lennart Poettering 071fd8c21e journal: fix memory leak 2012-03-14 18:31:38 +01:00
Kay Sievers 91418155ae rules sort order: /lib, /run, /etc
After long consideration we came to the conclusion that user
configuration in /etc should always override the (generally
computer generated) configuration in /run. User configuration
should always be what matters over anything else. Hence rearrange
the search orders accordingly. In general this should change
very little as overriding like this is seldomn done so far,
and the order between /etc and /usr stays the same.
2012-03-14 18:10:59 +01:00
Marti Raudsepp 189f6d82ee journal: Don't hold pointers to journal while remapping
Hi!

I was trying out the journal and the journalctl utility sometimes
crashed on me. After some debugging, I tracked it down to the fact
that next_with_matches() holds the "c" object pointer through the
journal_file_next_entry_for_data() call -- which apparently may re-map
the journal file, invalidating the pointer.

The attached patch fixes this crash for me, but being unfamiliar with
the code, I don't know if I'm doing the right thing.

This patch is also available from my github repository:
git://github.com/intgr/systemd.git
https://github.com/intgr/systemd

Regards,
Marti

For the record, here's the original stack trace at the time of remapping:

ret=0x7fff1d5cdec0) at src/journal/journal-file.c:330
ret=0x7fff1d5cdf28) at src/journal/journal-file.c:414
ret=0x7fff1d5ce0a0, offset=0x7fff1d5ce098) at
src/journal/journal-file.c:1101
i=5705, ret=0x7fff1d5ce0a0, offset=0x7fff1d5ce098) at
src/journal/journal-file.c:1147
p=6413608, data_offset=66600, direction=DIRECTION_DOWN,
ret=0x7fff1d5ce0a0, offset=0x7fff1d5ce098) at
src/journal/journal-file.c:1626
direction=DIRECTION_DOWN, ret=0x7fff1d5ce120, offset=0x7fff1d5ce128)
at src/journal/sd-journal.c:533
direction=DIRECTION_DOWN, ret=0x7fff1d5ce170, offset=0x7fff1d5ce178)
at src/journal/sd-journal.c:595
src/journal/sd-journal.c:651

From 9266fc6a58065a7c5dab67430fd78925e519dce9 Mon Sep 17 00:00:00 2001
From: Marti Raudsepp <marti@juffo.org>
Date: Fri, 9 Mar 2012 16:23:00 +0200
Subject: [PATCH] journal: Don't hold pointers to journal while remapping

This would cause a segfault otherwise.
2012-03-14 17:55:55 +01:00
Lennart Poettering 17a949114d log: introduce log_metav 2012-03-14 14:54:41 +01:00
Lennart Poettering 9d648202eb pkg-config: bring unit search path order in sync with the code 2012-03-14 14:31:57 +01:00
Lennart Poettering b412ab3bcc path-lookup: rearrange things so that the system path order follows the user path order 2012-03-14 14:31:50 +01:00
Lennart Poettering fc1a2e06a2 conf: when looking for configurations look in /etc first, in /run second
After long consideration we came to the conclusion that user
configuration in /etc should always override the (generally computer
generated) configuration in /run. User configuration should always be
what matters over anything else. Hence rearrange the search orders
accordingly.

In general this should change very little as overriding like this is
seldomn done so far, and the order between /etc and /usr stays the same.
2012-03-14 14:25:05 +01:00
Lennart Poettering 09b967eaa5 machine-id: initialize from $container_uuid if not set otherwise
This is a result of the discussions on

https://bugs.freedesktop.org/show_bug.cgi?id=46894
2012-03-14 14:06:42 +01:00
Lennart Poettering 2d44fc7ba5 journald: allocate PAGE_SIZE bytes for selinux label length
As suggested in https://bugzilla.redhat.com/show_bug.cgi?id=798760
2012-03-14 03:39:15 +01:00
Lennart Poettering 77b088c211 socket: make sure that the name for per-connection services are unique
If a client connects to us repeatedly always using the same source port
and we instantiate a service for the incoming connection this might
clash with an old instance. Hence, include the connection number, the
same way we do it for AF_UNIX to make connections unique.

https://bugs.freedesktop.org/show_bug.cgi?id=45297
2012-03-14 03:07:26 +01:00
Lennart Poettering 9586cdfab6 socket: if we fail to create an instantiated service for a socket, don't put the socket in failure mode
An incoming connection that is immediately terminated might result in
getpeername() or a similar call failing. Hence it is quite possible that
while we are setting up an instantiated service for a socket we might
get an error and we shouldn't take this as hint to take the listening
socket down.

https://bugs.freedesktop.org/show_bug.cgi?id=45297
https://bugzilla.novell.com/show_bug.cgi?id=741590
2012-03-14 03:01:27 +01:00
Kay Sievers 4b50a3d004 extras: ata_id - do not log error if HDIO_GET_IDENTITY fails
<tomegun> kay: is this a valid issue: https://bugs.archlinux.org/task/27060 ?
<kay> tomegun: udev does not really care if that fails
<tomegun> kay: the suggestion there is to treat EINVAL the same way we treat ENOTTY (i.e. as an info only)
<tomegun> if it really does not matter it might make sense to avoid bogus bug reports
<kay> tomegun: done
2012-03-14 01:01:16 +01:00
Kay Sievers 746b5152cc extras: path_id - add comment about readdir() rebase logic 2012-03-13 12:55:53 +01:00
Lennart Poettering 9631c090fd mount: fix assertion
https://bugzilla.redhat.com/show_bug.cgi?id=768523
2012-03-13 03:34:42 +01:00
Lennart Poettering 62f168a05b conf-parser: warn if an assignment is place outside of a section
https://bugzilla.redhat.com/show_bug.cgi?id=783134
2012-03-13 02:41:29 +01:00
Lennart Poettering b19be9eb9e util: add brute-force fallback for close_all_fds()
If /proc is not available (i.e. in chroot envs) let's fall back to brute
forcing our way through the fd table.

https://bugzilla.redhat.com/show_bug.cgi?id=784921
2012-03-13 02:29:27 +01:00
Lennart Poettering 7f2c63cbf4 journald: use SCM_SECURITY to race-freely determine peer SELinux label
https://bugzilla.redhat.com/show_bug.cgi?id=798760
2012-03-13 02:29:10 +01:00
Lennart Poettering 54ecda32c6 socket: add option for SO_PASSEC
https://bugzilla.redhat.com/show_bug.cgi?id=798760

(Note that this work is not complete yet, as the kernel seems to send us
useless data with SCM_SECURITY enabled)
2012-03-13 00:00:27 +01:00
Shawn Landden fa734f4da8 login: tag the Mimo 720 ID_AUTOSEAT
This device is a combination USB hub, displaylink graphics, and e2i touchscreen

Bus 001 Device 005: ID 058f:6254 Alcor Micro Corp. USB Hub
Bus 001 Device 006: ID 17e9:401a Newnham Research
Bus 001 Device 007: ID 1ac7:0001

|__ Port 1: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
    |__ Port 2: Dev 6, If 0, Class=vend., Driver=udlfb, 480M
    |__ Port 2: Dev 6, If 1, Class=HID, Driver=usbhid, 480M
    |__ Port 3: Dev 7, If 0, Class=vend., Driver=usbtouchscreen, 12M
2012-03-12 22:49:14 +01:00
Lennart Poettering 7f110ff9b8 conf: enforce UTF8 validty everywhere
we need to make sure that configuration data we expose via the bus ends
up in using getting an assert(). Even though configuration data is only
parsed from trusted sources we should be more careful with what we read.
2012-03-12 22:22:21 +01:00
Kay Sievers 481dcf7c8f extras: path_id - skip ATA transport class devices 2012-03-12 18:40:23 +01:00
Kay Sievers 4774868cca remove edd_id extra
The use of identifying disks by magic byte sequences outside of the
filesystem or partion table is fragile and usually creates more
problems than it solves.
2012-03-07 17:16:21 +01:00
Kay Sievers df4554c333 rules: move 42-qemu-usb.rules to rules/ dir 2012-03-07 17:12:15 +01:00
Kay Sievers 6997e3b2dc move src/extras subdirectories to src/ 2012-03-07 17:03:48 +01:00
Kay Sievers 4683a5fa06 udev.conf - do not set any value by default 2012-03-07 16:38:02 +01:00
Kay Sievers b618e9957b remove udev-acl
Udev-acl will be part of a future ConsoleKit release. On systemd systems,
advanced ConsoleKit and udev-acl functionality are natively provided by
systemd.
2012-03-07 16:34:56 +01:00
Lennart Poettering 48496df65c journal: make sure to refresh window position and pointer after we linked up a data object 2012-03-06 02:42:32 +01:00
Dave Reisner 85eda5721f mount: properly check return for mount_add_*
Previously, mount_load_etc_fstab() could never fail for reasons other
than a setmntent() or allocation failure.
2012-03-06 02:16:41 +01:00
Harald Hoyer e2e9329411 bash-completion: get rid of awk, sed and grep
Get rid of "awk", "sed" and "grep" calls.
This can be done entirely in bash!

With help from Dave Reisner
2012-03-06 02:11:01 +01:00
Lennart Poettering 52af21063b nspawn: be less cryptic when clone() fails
Based on a patch suggested by Shawn Landden.
2012-03-06 02:06:29 +01:00
Lennart Poettering 6bda96a023 socket: rename 'broken' failure result to 'failed-permanent' on order not to introduce new terminology 2012-03-06 01:29:29 +01: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
Michal Schmidt c2f3480897 socket: fail the socket if the service keeps dying on start
If the service reaches the start limit, mark the sockets that activate
it as failed (with the result code 'service-broken').
This way the sockets won't act as tarpits for clients connecting to
them.
2012-03-05 22:47:54 +01:00
Lennart Poettering e09a9a35a1 sd-login: c++ compatibility 2012-03-05 15:16:10 +01:00
Dave Reisner a84f9b3c1d systemd-analyze: call os.uname() once
Uses a format string, which is dependent on python 2.6.
2012-03-05 15:10:36 +01:00
Frederic Crozat 6a39419fe4 fix sparse warnings 2012-03-05 15:07:14 +01:00
Frederic Crozat 7be3aa1732 journal: fix endianness errors 2012-03-05 14:47:18 +01:00
Kay Sievers 4c80c73c2b systemctl: forward untrusted user reboot, poweroff requests to logind 2012-02-29 22:28:33 +01:00
Dirk Eibach 8dc6b88fd2 systemd-journald: fix endianess bug 2012-02-29 14:06:33 +01:00
Kay Sievers e000d7c079 builtin: path_id - remove dead cciss code 2012-02-23 16:22:05 +01:00
Kay Sievers e444cbf040 systemd-analyze: read /etc/os-release 2012-02-21 21:04:05 +01:00
Lennart Poettering e606bb61d0 systemctl: introduce systemctl reboot -ff 2012-02-15 20:05:49 +01:00
Lennart Poettering d4eb120a23 machine-id: initialize vom qemu/kvm -uuid parameter if available 2012-02-15 19:16:08 +01:00
Lennart Poettering 21d279cf54 namespace: temporaily reset umask when creating private /tmp 2012-02-15 05:00:54 +01:00