1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
Commit Graph

2333 Commits

Author SHA1 Message Date
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
Lennart Poettering
fc8af9ff3f login: introduce sd_session_get_display() 2012-02-15 04:56:10 +01:00
Lennart Poettering
2aa4c31529 timedate: don't fail if NTP is not installed
https://bugzilla.redhat.com/show_bug.cgi?id=790260
2012-02-15 00:05:31 +01:00
Lennart Poettering
51f58f083a login: add new sd_session_get_type() and sd_session_get_class API calls 2012-02-14 21:54:00 +01:00
Lennart Poettering
55efac6cbc login: track login class (i.e. one of "user", "greeter", "lock-screen") for each session
This introduces the new PAM environment variable XDG_SESSION_CLASS. If
not set, defaults to "user".

This is useful for apps that want to distuingish real user logins from
"fake" ones which just exist to show a gdm login screen or a lock
screen.
2012-02-14 21:37:49 +01:00
Kay Sievers
a82034ba58 update sd-daemon files 2012-02-14 14:44:34 +01:00
Lennart Poettering
283b73b3bb path-lookup: search for unit files in /lib/systemd/system only on split /usr systems 2012-02-14 00:24:49 +01:00
Lennart Poettering
72e764a691 dbus: update bus addresses to "unixexec:" protocol specifier
The new protocol specified that we are settling on is "unixexec:" rather
than just "exec:", hence let's update our code accordingly.

https://bugs.freedesktop.org/show_bug.cgi?id=35230
2012-02-13 23:50:03 +01:00
Lennart Poettering
50b1678aab sd-login: if NULL or 0 is passed as first parameter of the sd_xxx functions, work on objects of the calling process 2012-02-13 23:50:02 +01:00
Michael Biebl
a26c9cc604 Fix broken Git repository URLs 2012-02-13 17:49:09 +01:00
Kay Sievers
3ce4fad8f5 always use /etc/os-release and ignore all distro-specific files
The text mode welcome message will only show the distro name stored
in /etc/os-release and no longer read any distro-specific files.  If
/etc/os-release does not exist, 'Linux' will be printed.

When the source tree is is ./configure'd, only /etc-os-release is read
to guess the distro to build for. If /etc/os-release does not exist,
--with-distro= needs to be specified.
2012-02-13 01:51:51 +01:00
Lennart Poettering
4099a281bb util: fix handling of empty files in read_one_line_file()
https://bugs.freedesktop.org/show_bug.cgi?id=45362
2012-02-11 00:27:12 +01:00
Lennart Poettering
89f134406a logind: introduce CanReboot/CanPowerOff bus calls 2012-02-11 00:13:10 +01:00
Michal Schmidt
5c72face73 cgroup: fix inverted condition
A bug was introduced in acb14d3 "cgroup: when getting cgroup empty
notifications, always search up the tree".

When the given cgroup is found the hashmap, we should be happy and
return it, not go looking up the tree for another one.

Fixes the hanging NetworkManager on shutdown for me.
2012-02-10 02:57:45 +01:00
Lennart Poettering
1b73da108b logind: make seat device management accessible to normal users/via polkit 2012-02-10 02:35:48 +01:00
Benjamin Franzke
80df5f4c3b logind: Allow PowerOff/Reboot in default context 2012-02-10 02:33:41 +01:00
Lennart Poettering
02c4ef9c35 service: imply NotifyAccess=main if WatchdogSec= is used 2012-02-09 21:11:25 +01:00
Michael Olbrich
4b9397474f service: add StartLimitInterval/StartLimitBurst/StartLimitAction 2012-02-09 21:01:29 +01:00
Michal Schmidt
81006b8ad8 install: fix incorrect 'Access denied' message with a non-existent unit
With "systemctl is-enabled non-existent.service"
_UNIT_FILE_STATE_INVALID (-1) was wrongly interpreted as -errno.
Return -ENOENT in this case.

https://bugzilla.redhat.com/show_bug.cgi?id=766579
2012-02-09 10:36:56 +01:00
Michal Schmidt
ab5919fa1a systemctl: check for no more work after chkconfig
Avoid a bogus message from 'systemctl enable ...' when all units given
are SysV services:
   Warning: unit files do not carry install information. No operation
   executed.

https://bugzilla.redhat.com/show_bug.cgi?id=787407
2012-02-09 10:05:15 +01:00
Lennart Poettering
353e12c2f4 service: ignore SIGPIPE by default 2012-02-09 03:18:04 +01:00
Dave Reisner
cea6691857 modules-load: resolve aliases before insert modules
This keeps behavior in line calling /sbin/modprobe -- aliases will be
resolved to the relevant modules, and errors from inserting modules
which are already loaded are ignored.
2012-02-09 01:44:54 +01:00
Lennart Poettering
cdb454f2de kmod: make GCC shut up 2012-02-09 01:24:40 +01:00
Tom Gundersen
83684a3553 modules-load: use libkmod rather than modprobe 2012-02-09 00:47:09 +01:00
Tom Gundersen
728beb28a7 kmod-setup: use libkmod rather than modprobe 2012-02-09 00:43:05 +01:00
Lennart Poettering
cafac610a7 ratelimit: if interval/burst are set to 0, assume ratelimiting shall be disabled 2012-02-08 21:35:49 +01:00
Michael Olbrich
6e0bcc980b service: set WATCHDOG_USEC environmen variable 2012-02-08 17:11:06 +01:00
Michael Olbrich
bb242b7b52 service: introduce WatchdogSec and hook up the watchdog with the existing failure logic 2012-02-08 17:10:38 +01:00
William Douglas
9e7c53579a systemd: Add systemd.setenv for /proc/cmdline parsing.
Check for systemd.setenv when parsing /proc/cmdline.
ex: systemd.setenv=PATH=/opt/bin
2012-02-08 16:33:55 +01:00
Benjamin Franzke
1d4ec31570 logind: Terminate bus_login_session_user_properties
Fixes segfault in systemd-logind, triggered by:
systemd-loginctl show-session $XDG_SESSION_ID.

Bug introduced by d200735e13,
so only systemd v39 is affected.
2012-02-07 23:52:58 +01:00
Lennart Poettering
cae5846b2c logind: fix introspection data 2012-02-07 20:12:21 +01:00
Lennart Poettering
84c3361e12 logind: introduce ActivateSessionOnSeat() 2012-02-07 20:12:13 +01:00
Lennart Poettering
acdfc041cc ratelimit: fix macro definition 2012-02-07 15:56:53 +01:00
Lennart Poettering
2c6db6fb9b main: use a shorter default $PATH if /usr is merged 2012-02-07 15:56:28 +01:00
Michal Schmidt
db1355b1c1 mount: adjust dependencies for remote filesystems
Currently remote mounts automatically get:
 After=remote-fs-pre.target network.target

remote-fs-pre.target is already After=network.target. Just make sure
remote-fs-pre.target is pulled in by remote-fs.target if any remote
filesystems are configured.
For the mount units it is then sufficient to get:
 After=remote-fs-pre.target

Later NetworkManager will hook its NM-wait-online.service into
remote-fs-pre.target.wants in order to remove the need for the administrator
to enable the service manually when he has any remote filesystems.

https://bugzilla.redhat.com/show_bug.cgi?id=787314
2012-02-07 11:22:48 +01:00
Lucas De Marchi
96b2eef25b builtin: kmod - depend on libkmod >= 5 2012-02-07 00:49:59 +01:00
Bruno Redondi
6118dab105 keymap: Add Fujitsu Siemens Amilo Li 2732
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2012-02-06 09:00:59 +01:00
Lennart Poettering
acb14d318b cgroup: when getting cgroup empty notifications, always search up the tree 2012-02-03 05:25:31 +01:00
Lennart Poettering
cd43ca73e1 path: convert failure field to enum 2012-02-03 05:06:04 +01:00
Lennart Poettering
e1770af812 swap: replace failure boolean by result enum 2012-02-03 05:06:04 +01:00
Lennart Poettering
067d72c9fe timer: convert failure bool into enum 2012-02-03 05:06:04 +01:00
Lennart Poettering
81a5c6d03e automount: convert failure boolean to enum 2012-02-03 05:06:04 +01:00
Lennart Poettering
9d2f51788e mount: replace failure boolean by enum 2012-02-03 05:06:03 +01:00
Lennart Poettering
cfc4eb4cba socket: replace failure boolean by enum 2012-02-03 05:06:03 +01:00
Lennart Poettering
f42806df7d service: replace "failure" boolean by enum, and export it
This should give admins more useful hints why a service failed.
2012-02-03 05:06:03 +01:00
Chris Paulson-Ellis
ec3f9b53f8 util: prevent daemon-reload from reaping service processes.
The reaping of generator processes run as part of a daemon-reload should not
call waitid(PID_ALL). The waitid() call in execute_directory() is intended only
to reap the executed processes, but if a service process exits at about the
same time as a daemon-reload, then that service process is reaped as well,
preventing it from being reaped in the proper place in
manager_dispatch_sigchld().

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43625
2012-02-02 19:11:16 +01:00
Alvaro Soliverez
ce09557917 sd-daemon: support for building sd-daemon.c with Bionic (Android)
sd-daemon.h is a drop-in file, so we should make sure it doesn't break
builds for anybody.

https://bugs.freedesktop.org/show_bug.cgi?id=42675
2012-02-02 19:11:16 +01:00
Michal Schmidt
bacbccb78c manager: tell correctly if the manager is booting
The assumption that the initial job is the job with id==1 is incorrect.
Some jobs may be enqueued before the job that starts the default unit as
in this example:

 -.mount changed dead -> mounted
 Trying to enqueue job quotacheck.service/start/fail
 Installed new job quotacheck.service/start as 1
 Installed new job systemd-stdout-syslog-bridge.socket/start as 2
 Enqueued job quotacheck.service/start as 1
 Trying to enqueue job quotaon.service/start/fail
 Installed new job quotaon.service/start as 5
 Enqueued job quotaon.service/start as 5
 Activating default unit: default.target
 Trying to enqueue job graphical.target/start/replace

This fixes a bug where displaying of boot status messages was turned off
too early.
2012-02-02 13:39:15 +01:00
Lennart Poettering
803a3464ce coredump: avoid coredump loops, divert coredump if journald itself is crashing 2012-02-02 01:22:49 +01:00
Lennart Poettering
5d6b158473 exec: include path name of binary we are about to execute when renaming forked off processes
Immediately after forking off a process change the comm name and argv[0]
to "(foobar)" where "foobar" is the basename of the path we are about to
execute.

This should be useful when charting boot progress.
2012-02-01 22:33:15 +01:00
Michael Olbrich
a6927d7ffc service: add watchdog timestamp
This patch adds WatchdogTimestamp[Monotonic] to the systemd service
D-Bus API. The timestamp is updated to the current time when the
service calls 'sd_nofity("WATCHDOG=1\n")'.
Using a timestamp instead of an 'alive' flag has two advantages:
1. No timeout is needed to define when a service is no longer alive.
   This simplifies both configuration (no timeout value) and
   implementation (no timeout event).
2. It is more robust. A 'dead' service might not be detected should
    systemd 'forget' to reset an 'alive' flag. It is much less likely
    to get a valid new timestamp if a service died.
2012-02-01 19:29:19 +01:00
Lennart Poettering
c4aa65e714 logind: add GetSessionByPID() bus call 2012-02-01 19:04:54 +01:00
Andreas Schwab
2b2823b4b5 ata_id: fix identify string fixup 2012-02-01 12:58:27 +01:00
Kay Sievers
09db3f5b66 ata_id: whitespace fixes 2012-02-01 12:58:27 +01:00
James M. Leddy
705b2a87cc keymap: Fix touchpad toggle button on Lenovo Ideapad
https://launchpad.net/bugs/922405

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2012-02-01 05:49:46 +01:00
Michal Schmidt
ede3deb425 socket: typo in dump output 2012-02-01 00:00:34 +01:00
Lennart Poettering
9b221b63e5 logind: if we have to stop a session, kill at least its leader 2012-01-31 23:51:39 +01:00
Lennart Poettering
9ba1a15985 load-fragment: properly parse size values denoted in bytes 2012-01-31 20:53:34 +01:00
Lennart Poettering
be19b7df6e journal: increase compression threshold for objects from 64 to 512
Apparently the perfomance price for compression is to steep to apply it
for all objects >= 64 and < 512 in size, as measured by Arjan Van De
Ven, hence increase the threshold to 512 which yields better results.
2012-01-31 20:38:53 +01:00
Ray Strode
8906b207d1 login: lock down input devices on extra seats
We need to tell the X server to grab the keyboards
and mice associated with a hotplugged seat, so that
it doesn't have the ability to control the kernel
vt consoles.
2012-01-31 20:00:36 +01:00
Kay Sievers
927f3bc468 extras: cdrom_id - create only /dev/cdrom 2012-01-30 19:03:05 +01:00
Kay Sievers
4f552cc7a0 pkg-config: rootlibexecdir -> systemdutildir
Better don't export historic names for split / vs. /usr filesysystems.
2012-01-30 16:32:18 +01:00
Kay Sievers
19b66dc57c extras: cdrom_id - create /dev/cdrom and conditionally /dev/dvd for sr0
Udev does no longer automatically create udev rules in /etc from the
device hotplug path.

No device name reservation will happen anymore; this model creates
too many problems for setups with many device changes or media which
is booted on different hardware.

Enumerated device names which are based on device discovery order or
on persistent on-disk name reservation will in general not be supported
by udev in the future. It is a problem that can not be solved properly,
and it always creates new problems at the same time it tries to solve
the original one. Udev will no longer pretend it can solve these issues,
and people should switch to available alternatives which provide the
far better compromise.

From now on, udev will only create /dev/cdrom for the first optical
drive, and if the drive is capable /dev/dvd. No other devices will
get any compatibility symlinks or enumerated device names like cdrom1,
cdrom2, and so on. The /dev/cdrom and /dev/dvd links have by default
a negative link priority, which will cause them to be overwritten by
any other device which clains the same names with already existing
udev rules.

If stable device names are needed, the /dev/disk/by-id/ links, which
uniquely identify a specific piece of hardware should be used. The links
usually contain a device serial number and the link names will not depend
on device discovery order.

If completely identical devices with identical or no serial number
need to be handled at the same time, the /dev/disk/by-path/ links can
be used. These links depend on the physical port which is used to connect
the device. It will change when the same device is moved to a different
port or host adapter.

If custom names are needed, custom udev rules which match on specific
device properties need to be added by the administrator.
2012-01-30 15:20:12 +01:00
Michal Schmidt
512947d46f main: don't force text mode in console_setup()
When systemd starts, plymouth may be already displaying progress
graphically. Do not switch the console to text mode at that time.
All other users of reset_terminal_fd() do the switch as before.

This avoids a graphical glitch with plymouth, especially visible with
vesafb, but could be also seen as a sub-second blink with radeon.

https://bugzilla.redhat.com/show_bug.cgi?id=785548
2012-01-29 21:55:51 +01:00
Kay Sievers
e7f3289033 do not stop rule processing when device node is no longer around
Device nodes might have been deleted again by the kernel before an
'add' or 'change' event is even started. We need to run all rules,
regardless of the state in /dev.
2012-01-29 05:48:45 +01:00
Lennart Poettering
02b16a19a4 logind: make sure we create /var/lib/systemd before using it 2012-01-27 20:48:28 +01:00
Lennart Poettering
ab8da6c266 pkg-config: export libexecdir, so that that gdm can use it to find the x server wrapper 2012-01-27 19:06:34 +01:00
Lennart Poettering
7d9eaa8461 socket: if SO_RCVBUFFORCE fails, fall back to SO_RCVBUF, to have at least a little effect 2012-01-27 18:58:02 +01:00
Lennart Poettering
bb99a35a87 log: increase socket buffers for logging by default 2012-01-27 18:57:37 +01:00
Lennart Poettering
632117b71f log: never delay logging if the log server is stuck, always drop messages quickly 2012-01-27 18:14:06 +01:00
Kay Sievers
a3642381eb builtin: blkid - add missing ID_ prefix for PART_ENTRY_* keys 2012-01-26 17:56:18 +01:00
Michal Schmidt
da375869ff mount: fix automount regression
Tom Gundersen noticed a regression where comment=systemd.automount in
fstab no longer prevented the adding of the After=foo.mount dependency
into local-fs.target. He bisected it to commit 9ddc4a26.

It turns out that clearing the default_dependencies flag is necessary
after all, in order to avoid complementing of Wants= with After= in the
target unit. We still want to add the dependencies on quota units and
umount.target though.
2012-01-26 01:19:19 +01:00
Lennart Poettering
7d39db92c5 virt: detect LXC+libvirt containers 2012-01-25 00:13:05 +01:00
Lennart Poettering
caa9488700 man: document systemd-cgtop tool 2012-01-25 00:12:47 +01:00
Kay Sievers
9c4eda1260 fix path to extras 2012-01-24 15:12:46 +01:00
Lennart Poettering
be70cdd67a login: fix multi-seat check 2012-01-24 05:15:04 +01:00
Lennart Poettering
b16f53046d login: extend comments in multi-seat-x 2012-01-24 04:32:09 +01:00
Kay Sievers
e605cf7782 use sysname() for devices without a device node 2012-01-24 04:29:59 +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
Lennart Poettering
a558d00381 journal: move journal TODO into main TODO 2012-01-23 22:01:29 +01:00
Lennart Poettering
7c69716810 util: use /dev/rtc symlink if possible before we go searching for a suitable device 2012-01-23 21:56:55 +01:00
Kay Sievers
a7ef118174 move variable inside condition 2012-01-23 05:21:13 +01:00
Kay Sievers
0ecfcbd4f7 print warning when rules try to rename kernel device nodes 2012-01-23 05:15:12 +01:00
Kay Sievers
b0a0080677 use devnode() for $name not sysname(), device nodes might be in a subdirectory 2012-01-23 04:44:35 +01:00
Kay Sievers
a1525d1720 fix some fallout from tab removal 2012-01-22 22:44:13 +01:00
Kay Sievers
131a4dcfd4 login: move seat udev rules to login subdir 2012-01-22 18:32:13 +01:00
Lennart Poettering
8f2d43a012 cgtop: add new cgtop tool 2012-01-22 18:22:26 +01:00
Lennart Poettering
1733ca5475 tmpfiles: fix bad memory access 2012-01-22 18:22:26 +01:00
Lennart Poettering
1e5678d023 cgls: don't show kernel threads by default 2012-01-22 18:22:26 +01:00
Kay Sievers
d2b795f2b9 libudev: do not set DEVNAME= twice
When we read the 'uevent' file we need to make sure, that we do not
read the relative DEVNAME= path provided by the kernel and overwrite
the absolute path udev expects here.
2012-01-21 06:18:32 +01:00
Dan Horák
ce3fd7e72a journal: systemd v38 fails to build on big-endians
Hi,

during the builds for Fedora/s390x I've found that systemd v38 fails to
build on big-endian platforms.

...
make[2]: Entering directory `/root/systemd'
  CC     src/journal/libsystemd_journal_la-sd-journal.lo
src/journal/sd-journal.c: In function 'init_location':
src/journal/sd-journal.c:69:22: error: incompatible types when
initializing type 'long unsigned int' using type 'sd_id128_t'
src/journal/sd-journal.c:69:20: error: incompatible types when assigning
to type 'sd_id128_t' from type 'long unsigned int'
make[2]: *** [src/journal/libsystemd_journal_la-sd-journal.lo] Error 1

I see the problem in using le64toh() on the 16 bytes boot_id structure
in init_location()

Please see
http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=544375 for a
full build log and attachment for a proposed fix.

With regards

Dan
2012-01-21 03:48:26 +01:00
Lennart Poettering
d1f262fa46 systemctl: don't show ln -s/rm output in 'install' mode if --quiet is passed 2012-01-21 03:44:11 +01:00
Lennart Poettering
51122dc9e3 util: open the first RTC that has hctosys=1 set 2012-01-21 03:15:54 +01:00
Kay Sievers
430959910f warn about deprecated RUN+="socket:" use 2012-01-21 03:07:32 +01:00
Lennart Poettering
05aa9edde0 readahead: don't monopolize IO when replaying 2012-01-21 02:51:13 +01:00
Lennart Poettering
aa001cd699 dbus: export ControlGroupPersistent field on the bus again 2012-01-21 01:47:53 +01:00
Michal Schmidt
1a710b430b socket: don't fail the socket on ENOTCONN
Albert Strasheim reported a socket unit with Accept=yes was failing
sometimes.
getpeername() returns ENOTCONN if the connection was killed by TCP RST.
The socket unit must not fail when it happens.

Reproducer available at:
https://bugzilla.redhat.com/show_bug.cgi?id=783344
2012-01-20 23:57:54 +01:00
Michal Schmidt
229b5d55f6 dbus-execute: don't publish control_group_persistent on DBus for now
Since the addition of ControlGroupPersistent, systemd is trivially
killed by "systemctl status any.service".
bus_property_append_bool must not be used for a tri-state int.
Also, should it really "b", or do we want the tri-state nature to be seen?

For now just comment out the buggy DBus property.
2012-01-20 03:03:25 +01:00
Michal Schmidt
3e52541ef5 service: add missing pid file unwatch in the destructor
The pid file watch could outlive the service unit if a daemon-reload
request came at the right time. The inotify event would then be
delivered to who knows where.

Fix it by unwatching in the service destructor.

Further changes will be needed to preserve the state of the pid file
watch across daemon-reload. For now let's just fix the crash observed
by Jóhann Guðmundsson:
Assertion 's->state == SERVICE_START || s->state == SERVICE_START_POST'
failed at src/service.c:2609, function service_fd_event().  Aborting

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=783118
2012-01-20 00:51:56 +01:00
Michal Schmidt
a3f914b2a2 log: move #pragma around the function
Koen reported errors with gcc 4.5.4 for arm:
src/log.c:624:9: error: #pragma GCC diagnostic not allowed inside
functions
2012-01-19 13:00:34 +01:00
Kay Sievers
891703e1ee persistant -> persistent 2012-01-18 21:47:30 +01:00
Lennart Poettering
31ed59c511 tmpfiles: support writing short strings to files, in order to support /sys manipulations at boot time, a la sysctl 2012-01-18 16:39:04 +01:00
Lennart Poettering
88f0664562 manager: don't place units in the 'cpu' group when run as user instance, for now 2012-01-18 15:41:21 +01:00
Lennart Poettering
9058851be7 journal: when sending journal data via file, place it in /dev/shm, to allow early boot operation, even if it sucks 2012-01-18 15:40:58 +01:00
Lennart Poettering
8d53b4534a exec: introduce ControlGroupPersistant= to make cgroups persistant 2012-01-18 15:40:21 +01:00
Lennart Poettering
62f21ec91a journalctl: properly honour -n when -f is passed, too 2012-01-18 13:56:02 +01:00
Lennart Poettering
468d726bdd tmpfiles: add support for creating symlinks, char/block device nodes 2012-01-18 13:56:02 +01:00
Lennart Poettering
fc3c1c6e09 logind: move X11 socket 2012-01-18 13:56:02 +01:00
Lennart Poettering
129eebe020 logind: simplify session_activate() a bit 2012-01-18 13:56:02 +01:00
Lennart Poettering
abc5bbc6f0 logind: allow to create multiple sessions on non-multi-session seats to deal with left-over sessions 2012-01-18 13:56:02 +01:00
Martin Pitt
46505c52a6 keymap: Add Alienware M14xR1
https://launchpad.net/bugs/901513
2012-01-18 12:14:54 +01:00
Martin Pitt
c861d52fd6 keymap: Fix keyboard brightness keys on Samsung 700Z series
https://launchpad.net/bugs/902332
2012-01-18 12:06:58 +01:00
Martin Pitt
1cb6889100 keymap: Fix eject button on Samsung 700Z series
https://launchpad.net/bugs/902798
2012-01-18 12:05:01 +01:00
Martin Pitt
4bebab9998 keymap: Fix rfkill button on Hewlett-Packard HP ProBook
https://bugs.launchpad.net/bugs/914838
2012-01-18 11:34:44 +01:00
Kay Sievers
e64fae5573 udevd: kill hanging event processes after 30 seconds
Some broken kernel drivers load firmware synchronously in the module init
path and block modprobe until the firmware request is fulfilled.

The modprobe-generated firmware request is a direct child device of the
device which caused modprobe to run. Child device event are blocked until
the parent device is handled. This dead-locks until the kernel firmware
loading timeout of 60 seconds is reached.

The hanging modprobe event should now time-out and allow the firmware
event to run before the 60 second kernel timeout.
2012-01-18 05:06:18 +01:00
Michal Schmidt
281605bf14 util: fix ANSI sequence for red color
Red turned green by mistake in commit c1072ea0.
2012-01-17 12:54:45 +01:00
Michal Schmidt
b7f336383d log: make asserts cheaper
On my x86_64 this shrinks the size of .text by 53 KB (7 %).
2012-01-17 12:34:53 +01:00
Michal Schmidt
2b7dec8661 log: remove useless variable
abort() never returns. Not even if the signal handler catches SIGABRT.
2012-01-17 12:34:53 +01:00
Michal Schmidt
e2110e5d1b dbus-unit: make functions static
The dbus_unit_append_*() functions are not referenced from outside anymore.
2012-01-17 12:34:53 +01:00
Kay Sievers
1b9e13e2e2 builtin: blkid - add missing ID_ prefix
<ridikulus_rat>  60-persistent-storage.rules gpt by-partlabel/by-partuuid
  symlinks not created in udev-177 util-linux-2.20.1 kmod-3 in Archlinux x86_64.
<falconindy> ridikulus_rat: fix the rule, or fix the blkid builtin ;)
<kay> oh, i missed the ID_ stuff? :)
2012-01-16 15:38:41 +01:00
Michal Schmidt
d200735e13 dbus: more efficient implementation of properties
The way the various properties[] arrays are initialized is inefficient:
 - only the .data members change at runtime, yet the whole arrays of
   properties with all the fields are constructed on the stack one by
   one by the code.
 - there's duplication, eg. the properties of "org.freedesktop.systemd1.Unit"
   are repeated in several unit types.

Fix it by moving the information about properties into static const
sections. Instead of storing the .data directly in the property, store
a constant offset from a run-time base.
The small arrays of struct BusBoundProperties bind together the constant
information with the right runtime information (the base pointer).

On my system the code shrinks by 60 KB, data increases by 10 KB.
2012-01-16 13:34:42 +01:00
Michal Schmidt
595ed347a8 unit: use safe downcasts, remove pointless casts
Always use the macros for downcasting.
Remove a few obviously pointless casts.
2012-01-16 13:34:42 +01:00
Michal Schmidt
1124fe6f01 unit: use the UNIT() macro consistently
The UNIT() macro upcasts from specific unit types to the base Unit.
Use it everywhere, rather than accessing the 'meta' member directly.
2012-01-16 13:34:42 +01:00