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

2100 Commits

Author SHA1 Message Date
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
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
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
4f552cc7a0 pkg-config: rootlibexecdir -> systemdutildir
Better don't export historic names for split / vs. /usr filesysystems.
2012-01-30 16:32:18 +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
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
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
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
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
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
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
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
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
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
Michal Schmidt
ac155bb885 unit: remove union Unit
Now that objects of all unit types are allocated the exact amount of
memory they need, the Unit union has lost its purpose. Remove it.

"Unit" is a more natural name for the base unit class than "Meta", so
rename Meta to Unit.

Access to members of the base class gets simplified.
2012-01-16 13:34:42 +01:00
Michal Schmidt
7d17cfbc46 unit: reduce heap usage for unit objects
The storage of the unit objects on the heap is currently not very
efficient. For every unit object we allocate a chunk of memory as large
as the biggest unit type, although there are significant differences in
the units' real requirements.
pahole shows the following sizes of structs:
488  Target
496  Snapshot
512  Device
528  Path
560  Timer
576  Automount
1080 Socket
1160 Swap
1168 Service
1280 Mount

Usually there aren't many targets or snapshots in the system, but Device
is one of the most common unit types and for every one we waste
1280 - 512 = 768 bytes.

Fix it by allocating only the right amount for the given unit type.
On my machine (x86_64, with 39 LVM volumes) this decreases systemd's
USS (unique set size) by more than 300 KB.
2012-01-16 13:34:42 +01:00
Michal Schmidt
1637a8be55 logind: downgrade login message to debug
The messages make people nervous.

https://bugzilla.redhat.com/show_bug.cgi?id=727315
2012-01-16 13:18:17 +01:00
Lennart Poettering
fee80f6956 journal: drop privileges when storing coredump 2012-01-14 03:37:32 +01:00
Lennart Poettering
e6acda19b2 journal: when show blob data show length 2012-01-14 03:07:47 +01:00
Lennart Poettering
32895bb390 util: support formatting eta and peta bytes with format_bytes() 2012-01-14 03:07:29 +01:00
Lennart Poettering
a7bc2c2ac8 util: introduce FORMAT_BYTES_MAX 2012-01-14 03:06:57 +01:00
Lennart Poettering
de0229ca36 journal: collect coredump up to 24M in size 2012-01-14 03:05:34 +01:00
Lennart Poettering
4c7de07481 journal: handle empty syslog identifier properly 2012-01-14 01:54:33 +01:00
Lennart Poettering
5c3759bf8a journal: fix bad memory access 2012-01-14 01:54:33 +01:00
Lennart Poettering
0dad12c190 journal: if the data to be sent is larger than the maximum datagram size resort to passing a temporary fd over native protocol 2012-01-14 01:54:33 +01:00
Lennart Poettering
f5e04665eb journal: hook up coredumping with journal 2012-01-14 01:54:33 +01:00
Lennart Poettering
755a02c680 journal: add new system-cat tool as kind of a more powerfull BSD logger 2012-01-14 01:54:33 +01:00
Lennart Poettering
3043935f02 util: split out tty_is_vc_resolve() from default_term_for_tty() 2012-01-14 01:54:33 +01:00
Lennart Poettering
c1072ea0da util: rework ANSI escape code macros 2012-01-14 01:54:33 +01:00
Michal Schmidt
9ddc4a26e5 mount: fix quota
quotacheck.service and quotaon.service were not pulled in for fstab mounts.
Fix it by not clearing the default_dependencies flag.

The root filesystem may have quotas too, so don't check for "/" there.

No need to have duplicate code for adding dependencies on umount.target.

https://bugzilla.redhat.com/show_bug.cgi?id=773431
2012-01-14 00:12:10 +01:00
Lennart Poettering
6ef25fb65e pam: fix build 2012-01-13 20:52:45 +01:00
Lennart Poettering
fc7985ed67 pam: work correctly if a seat is specified but not vtnr 2012-01-13 20:51:58 +01:00
Lennart Poettering
d3f2bdbfee journal: add output mode that just prints simple messages without any decorations 2012-01-13 02:58:45 +01:00
Lennart Poettering
f987397649 api: add C++ guards to all headers 2012-01-13 00:49:21 +01:00
Lennart Poettering
ebda471d89 sd-login: teach sd_pid_get_unit() proper handling of instantiated services 2012-01-13 00:49:02 +01:00
Lennart Poettering
7c8bbccd07 journal: if the syslog forwarder socket is full, then don't block 2012-01-12 05:09:24 +01:00
Lennart Poettering
4cfa2c999d core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
Lennart Poettering
5ba081b0fb log: make internal log api log directly to the journal 2012-01-12 04:34:31 +01:00