chiark / gitweb /
9 years agoservice: introduce WatchdogSec and hook up the watchdog with the existing failure...
Michael Olbrich [Wed, 8 Feb 2012 09:10:34 +0000 (10:10 +0100)]
service: introduce WatchdogSec and hook up the watchdog with the existing failure logic

9 years agoman: document systemd.setenv=
Lennart Poettering [Wed, 8 Feb 2012 15:33:16 +0000 (16:33 +0100)]
man: document systemd.setenv=

9 years agosystemd: Add systemd.setenv for /proc/cmdline parsing.
William Douglas [Tue, 7 Feb 2012 20:31:20 +0000 (12:31 -0800)]
systemd: Add systemd.setenv for /proc/cmdline parsing.

Check for systemd.setenv when parsing /proc/cmdline.
ex: systemd.setenv=PATH=/opt/bin

9 years agomove /usr/bin/systemd to /usr/lib/systemd/systemd
Kay Sievers [Tue, 7 Feb 2012 23:08:10 +0000 (00:08 +0100)]
move /usr/bin/systemd to /usr/lib/systemd/systemd

9 years agologind: Terminate bus_login_session_user_properties
Benjamin Franzke [Tue, 7 Feb 2012 21:39:35 +0000 (22:39 +0100)]
logind: Terminate bus_login_session_user_properties

Fixes segfault in systemd-logind, triggered by:
systemd-loginctl show-session $XDG_SESSION_ID.

Bug introduced by d200735e13c52dcfe36c0e066f9f6c2fbfb85a9c,
so only systemd v39 is affected.

9 years agologind: fix introspection data
Lennart Poettering [Tue, 7 Feb 2012 19:12:21 +0000 (20:12 +0100)]
logind: fix introspection data

9 years agologind: introduce ActivateSessionOnSeat()
Lennart Poettering [Tue, 7 Feb 2012 19:12:13 +0000 (20:12 +0100)]
logind: introduce ActivateSessionOnSeat()

9 years agoratelimit: fix macro definition
Lennart Poettering [Tue, 7 Feb 2012 14:56:53 +0000 (15:56 +0100)]
ratelimit: fix macro definition

9 years agomain: use a shorter default $PATH if /usr is merged
Lennart Poettering [Tue, 7 Feb 2012 14:56:28 +0000 (15:56 +0100)]
main: use a shorter default $PATH if /usr is merged

9 years agoconfigure: it makes no sense to install systemd with stow
Lennart Poettering [Tue, 7 Feb 2012 13:43:33 +0000 (14:43 +0100)]
configure: it makes no sense to install systemd with stow

9 years agoupdate TODO
Lennart Poettering [Tue, 7 Feb 2012 13:39:04 +0000 (14:39 +0100)]
update TODO

9 years agomount: adjust dependencies for remote filesystems
Michal Schmidt [Tue, 7 Feb 2012 10:05:18 +0000 (11:05 +0100)]
mount: adjust dependencies for remote filesystems

Currently remote mounts automatically get: is already Just make sure is pulled in by if any remote
filesystems are configured.
For the mount units it is then sufficient to get:

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

9 years agoNEWS: update v40
Lennart Poettering [Tue, 7 Feb 2012 02:38:23 +0000 (03:38 +0100)]
NEWS: update

9 years agobuild-sys: bump release
Lennart Poettering [Tue, 7 Feb 2012 02:32:03 +0000 (03:32 +0100)]
build-sys: bump release

9 years detect historic split-system-directories and add root options
Kay Sievers [Tue, 7 Feb 2012 02:23:05 +0000 (03:23 +0100)] detect historic split-system-directories and add root options

9 years agocgroup: when getting cgroup empty notifications, always search up the tree
Lennart Poettering [Fri, 3 Feb 2012 04:25:31 +0000 (05:25 +0100)]
cgroup: when getting cgroup empty notifications, always search up the tree

9 years agopath: convert failure field to enum
Lennart Poettering [Fri, 3 Feb 2012 04:04:48 +0000 (05:04 +0100)]
path: convert failure field to enum

9 years agoswap: replace failure boolean by result enum
Lennart Poettering [Fri, 3 Feb 2012 03:47:32 +0000 (04:47 +0100)]
swap: replace failure boolean by result enum

9 years agotimer: convert failure bool into enum
Lennart Poettering [Fri, 3 Feb 2012 03:03:21 +0000 (04:03 +0100)]
timer: convert failure bool into enum

9 years agoautomount: convert failure boolean to enum
Lennart Poettering [Fri, 3 Feb 2012 02:27:25 +0000 (03:27 +0100)]
automount: convert failure boolean to enum

9 years agomount: replace failure boolean by enum
Lennart Poettering [Fri, 3 Feb 2012 02:10:56 +0000 (03:10 +0100)]
mount: replace failure boolean by enum

9 years agosocket: replace failure boolean by enum
Lennart Poettering [Fri, 3 Feb 2012 01:31:54 +0000 (02:31 +0100)]
socket: replace failure boolean by enum

9 years agoservice: replace "failure" boolean by enum, and export it
Lennart Poettering [Fri, 3 Feb 2012 01:01:35 +0000 (02:01 +0100)]
service: replace "failure" boolean by enum, and export it

This should give admins more useful hints why a service failed.

9 years agoupdate TODO
Lennart Poettering [Thu, 2 Feb 2012 01:21:59 +0000 (02:21 +0100)]
update TODO

9 years agoutil: prevent daemon-reload from reaping service processes.
Chris Paulson-Ellis [Thu, 2 Feb 2012 17:32:05 +0000 (17:32 +0000)]
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


9 years agosd-daemon: support for building sd-daemon.c with Bionic (Android)
Alvaro Soliverez [Mon, 7 Nov 2011 18:10:25 +0000 (15:10 -0300)]
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.

9 years agomanager: tell correctly if the manager is booting
Michal Schmidt [Thu, 2 Feb 2012 11:39:33 +0000 (12:39 +0100)]
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:
 Trying to enqueue job

This fixes a bug where displaying of boot status messages was turned off
too early.

9 years agoman: document that we support tcpwrappers only for access control
Lennart Poettering [Thu, 2 Feb 2012 05:21:31 +0000 (06:21 +0100)]
man: document that we support tcpwrappers only for access control

We do not support, and explicitly never want to support environment
variable settings and suchlike in tcpwrappers.

9 years agocoredump: avoid coredump loops, divert coredump if journald itself is crashing
Lennart Poettering [Thu, 2 Feb 2012 00:22:49 +0000 (01:22 +0100)]
coredump: avoid coredump loops, divert coredump if journald itself is crashing

9 years agoexec: include path name of binary we are about to execute when renaming forked off...
Lennart Poettering [Wed, 1 Feb 2012 21:33:15 +0000 (22:33 +0100)]
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

This should be useful when charting boot progress.

9 years agoservice: add watchdog timestamp
Michael Olbrich [Wed, 1 Feb 2012 16:17:12 +0000 (17:17 +0100)]
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.

9 years agologind: add GetSessionByPID() bus call
Lennart Poettering [Wed, 1 Feb 2012 18:04:54 +0000 (19:04 +0100)]
logind: add GetSessionByPID() bus call

9 years agosocket: typo in dump output
Michal Schmidt [Tue, 31 Jan 2012 22:58:15 +0000 (23:58 +0100)]
socket: typo in dump output

9 years agologind: if we have to stop a session, kill at least its leader
Lennart Poettering [Tue, 31 Jan 2012 22:51:16 +0000 (23:51 +0100)]
logind: if we have to stop a session, kill at least its leader

9 years agoupdate TODO
Lennart Poettering [Tue, 31 Jan 2012 22:13:16 +0000 (23:13 +0100)]
update TODO

9 years agoload-fragment: properly parse size values denoted in bytes
Lennart Poettering [Tue, 31 Jan 2012 19:53:34 +0000 (20:53 +0100)]
load-fragment: properly parse size values denoted in bytes

9 years agojournal: increase compression threshold for objects from 64 to 512
Lennart Poettering [Tue, 31 Jan 2012 19:35:07 +0000 (20:35 +0100)]
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.

9 years agologin: lock down input devices on extra seats
Ray Strode [Tue, 31 Jan 2012 18:47:12 +0000 (13:47 -0500)]
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.

9 years agoupdate TODO
Lennart Poettering [Tue, 31 Jan 2012 17:23:23 +0000 (18:23 +0100)]
update TODO

9 years agopkg-config: rootlibexecdir -> systemdutildir
Kay Sievers [Mon, 30 Jan 2012 15:32:18 +0000 (16:32 +0100)]
pkg-config: rootlibexecdir -> systemdutildir

Better don't export historic names for split / vs. /usr filesysystems.

9 years agomain: don't force text mode in console_setup()
Michal Schmidt [Sun, 29 Jan 2012 20:55:51 +0000 (21:55 +0100)]
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.

9 years agologind: add sys_tty_config capability, to let it use VT_ACTIVATE ioctl on "activate...
Mike Kazantsev [Fri, 27 Jan 2012 20:13:42 +0000 (21:13 +0100)]
logind: add sys_tty_config capability, to let it use VT_ACTIVATE ioctl on "activate" action

9 years agologind: make sure we create /var/lib/systemd before using it
Lennart Poettering [Fri, 27 Jan 2012 19:48:28 +0000 (20:48 +0100)]
logind: make sure we create /var/lib/systemd before using it

9 years agobuild-sys: add creation of /var/lib/systemd path, used by logind
Mike Kazantsev [Fri, 27 Jan 2012 18:56:44 +0000 (19:56 +0100)]
build-sys: add creation of /var/lib/systemd path, used by logind

9 years agopkg-config: export libexecdir, so that that gdm can use it to find the x server wrapper
Lennart Poettering [Fri, 27 Jan 2012 18:06:34 +0000 (19:06 +0100)]
pkg-config: export libexecdir, so that that gdm can use it to find the x server wrapper

9 years agosocket: if SO_RCVBUFFORCE fails, fall back to SO_RCVBUF, to have at least a little...
Lennart Poettering [Fri, 27 Jan 2012 17:58:02 +0000 (18:58 +0100)]
socket: if SO_RCVBUFFORCE fails, fall back to SO_RCVBUF, to have at least a little effect

9 years agolog: increase socket buffers for logging by default
Lennart Poettering [Fri, 27 Jan 2012 17:57:37 +0000 (18:57 +0100)]
log: increase socket buffers for logging by default

9 years agolog: never delay logging if the log server is stuck, always drop messages quickly
Lennart Poettering [Fri, 27 Jan 2012 17:14:06 +0000 (18:14 +0100)]
log: never delay logging if the log server is stuck, always drop messages quickly

9 years agomount: fix automount regression
Michal Schmidt [Thu, 26 Jan 2012 00:19:19 +0000 (01:19 +0100)]
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 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 though.

9 years agoREADME: update header line
Lennart Poettering [Wed, 25 Jan 2012 01:20:38 +0000 (02:20 +0100)]
README: update header line

9 years agobuild-sys: enable automake's check-news option v39
Lennart Poettering [Wed, 25 Jan 2012 00:12:23 +0000 (01:12 +0100)]
build-sys: enable automake's check-news option

9 years agobuild-sys: bump release
Lennart Poettering [Wed, 25 Jan 2012 00:07:31 +0000 (01:07 +0100)]
build-sys: bump release

9 years agobuild-sys: include NEWS file for v38, v39
Lennart Poettering [Wed, 25 Jan 2012 00:02:41 +0000 (01:02 +0100)]
build-sys: include NEWS file for v38, v39

9 years agovirt: detect LXC+libvirt containers
Lennart Poettering [Tue, 24 Jan 2012 23:13:05 +0000 (00:13 +0100)]
virt: detect LXC+libvirt containers

9 years agoman: document systemd-cgtop tool
Lennart Poettering [Tue, 24 Jan 2012 23:12:47 +0000 (00:12 +0100)]
man: document systemd-cgtop tool

9 years agologin: fix multi-seat check
Lennart Poettering [Tue, 24 Jan 2012 04:15:04 +0000 (05:15 +0100)]
login: fix multi-seat check

9 years agologin: extend comments in multi-seat-x
Lennart Poettering [Tue, 24 Jan 2012 03:32:09 +0000 (04:32 +0100)]
login: extend comments in multi-seat-x

9 years agologin: add multi-session X wrapper
Lennart Poettering [Mon, 23 Jan 2012 22:34:36 +0000 (23:34 +0100)]
login: add multi-session X wrapper

In preparation for 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

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.

9 years agoupdate TODO
Lennart Poettering [Mon, 23 Jan 2012 21:03:32 +0000 (22:03 +0100)]
update TODO

9 years agoupdate TODO
Lennart Poettering [Mon, 23 Jan 2012 21:02:43 +0000 (22:02 +0100)]
update TODO

9 years agojournal: move journal TODO into main TODO
Lennart Poettering [Mon, 23 Jan 2012 21:01:29 +0000 (22:01 +0100)]
journal: move journal TODO into main TODO

9 years agoutil: use /dev/rtc symlink if possible before we go searching for a suitable device
Lennart Poettering [Mon, 23 Jan 2012 20:56:55 +0000 (21:56 +0100)]
util: use /dev/rtc symlink if possible before we go searching for a suitable device

9 years agoadd .vimrc
Kay Sievers [Mon, 23 Jan 2012 03:42:11 +0000 (04:42 +0100)]
add .vimrc

9 years agoREADME: fix git URLs
Kay Sievers [Sun, 22 Jan 2012 17:40:13 +0000 (18:40 +0100)]
README: fix git URLs

9 years agologin: move seat udev rules to login subdir
Kay Sievers [Sun, 22 Jan 2012 17:20:42 +0000 (18:20 +0100)]
login: move seat udev rules to login subdir

9 years agocgtop: add new cgtop tool
Lennart Poettering [Sun, 22 Jan 2012 17:21:15 +0000 (18:21 +0100)]
cgtop: add new cgtop tool

9 years agotmpfiles: fix bad memory access
Lennart Poettering [Sun, 22 Jan 2012 17:19:24 +0000 (18:19 +0100)]
tmpfiles: fix bad memory access

9 years agocgls: don't show kernel threads by default
Lennart Poettering [Sun, 22 Jan 2012 17:18:51 +0000 (18:18 +0100)]
cgls: don't show kernel threads by default

9 years agojournal: systemd v38 fails to build on big-endians
Dan Horák [Thu, 19 Jan 2012 11:42:53 +0000 (12:42 +0100)]
journal: systemd v38 fails to build on big-endians


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 for a
full build log and attachment for a proposed fix.

With regards


9 years agosystemctl: don't show ln -s/rm output in 'install' mode if --quiet is passed
Lennart Poettering [Sat, 21 Jan 2012 02:44:11 +0000 (03:44 +0100)]
systemctl: don't show ln -s/rm output in 'install' mode if --quiet is passed

9 years agoutil: open the first RTC that has hctosys=1 set
Lennart Poettering [Sat, 21 Jan 2012 02:15:54 +0000 (03:15 +0100)]
util: open the first RTC that has hctosys=1 set

9 years agoreadahead: don't monopolize IO when replaying
Lennart Poettering [Sat, 21 Jan 2012 01:51:13 +0000 (02:51 +0100)]
readahead: don't monopolize IO when replaying

9 years agodbus: export ControlGroupPersistent field on the bus again
Lennart Poettering [Sat, 21 Jan 2012 00:47:53 +0000 (01:47 +0100)]
dbus: export ControlGroupPersistent field on the bus again

9 years agoupdate TODO
Kay Sievers [Sat, 21 Jan 2012 00:19:57 +0000 (01:19 +0100)]
update TODO

9 years agosocket: don't fail the socket on ENOTCONN
Michal Schmidt [Fri, 20 Jan 2012 22:44:22 +0000 (23:44 +0100)]
socket: don't fail the socket on ENOTCONN

Albert Strasheim reported a socket unit with Accept=yes was failing
getpeername() returns ENOTCONN if the connection was killed by TCP RST.
The socket unit must not fail when it happens.

Reproducer available at:

9 years agodbus-execute: don't publish control_group_persistent on DBus for now
Michal Schmidt [Fri, 20 Jan 2012 02:03:25 +0000 (03:03 +0100)]
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.

9 years agoservice: add missing pid file unwatch in the destructor
Michal Schmidt [Thu, 19 Jan 2012 22:58:07 +0000 (23:58 +0100)]
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


9 years agolog: move #pragma around the function
Michal Schmidt [Thu, 19 Jan 2012 12:00:34 +0000 (13:00 +0100)]
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

9 years agopersistant -> persistent
Kay Sievers [Wed, 18 Jan 2012 20:47:30 +0000 (21:47 +0100)]
persistant -> persistent

9 years agotmpfiles: support writing short strings to files, in order to support /sys manipulati...
Lennart Poettering [Wed, 18 Jan 2012 15:39:04 +0000 (16:39 +0100)]
tmpfiles: support writing short strings to files, in order to support /sys manipulations at boot time, a la sysctl

9 years agomanager: don't place units in the 'cpu' group when run as user instance, for now
Lennart Poettering [Wed, 18 Jan 2012 14:41:21 +0000 (15:41 +0100)]
manager: don't place units in the 'cpu' group when run as user instance, for now

9 years agojournal: when sending journal data via file, place it in /dev/shm, to allow early...
Lennart Poettering [Wed, 18 Jan 2012 14:40:58 +0000 (15:40 +0100)]
journal: when sending journal data via file, place it in /dev/shm, to allow early boot operation, even if it sucks

9 years agoexec: introduce ControlGroupPersistant= to make cgroups persistant
Lennart Poettering [Wed, 18 Jan 2012 14:40:21 +0000 (15:40 +0100)]
exec: introduce ControlGroupPersistant= to make cgroups persistant

9 years agojournalctl: properly honour -n when -f is passed, too
Lennart Poettering [Tue, 17 Jan 2012 14:21:40 +0000 (15:21 +0100)]
journalctl: properly honour -n when -f is passed, too

9 years agotmpfiles: add support for creating symlinks, char/block device nodes
Lennart Poettering [Tue, 17 Jan 2012 14:04:12 +0000 (15:04 +0100)]
tmpfiles: add support for creating symlinks, char/block device nodes

9 years agologind: move X11 socket
Lennart Poettering [Tue, 17 Jan 2012 13:03:00 +0000 (14:03 +0100)]
logind: move X11 socket

9 years agologind: simplify session_activate() a bit
Lennart Poettering [Tue, 17 Jan 2012 13:02:47 +0000 (14:02 +0100)]
logind: simplify session_activate() a bit

9 years agologind: allow to create multiple sessions on non-multi-session seats to deal with...
Lennart Poettering [Tue, 17 Jan 2012 13:02:09 +0000 (14:02 +0100)]
logind: allow to create multiple sessions on non-multi-session seats to deal with left-over sessions

9 years agoupdate TODO
Lennart Poettering [Tue, 17 Jan 2012 12:30:58 +0000 (13:30 +0100)]
update TODO

9 years agoutil: fix ANSI sequence for red color
Michal Schmidt [Tue, 17 Jan 2012 11:50:42 +0000 (12:50 +0100)]
util: fix ANSI sequence for red color

Red turned green by mistake in commit c1072ea0.

9 years agolog: make asserts cheaper
Michal Schmidt [Tue, 17 Jan 2012 11:05:33 +0000 (12:05 +0100)]
log: make asserts cheaper

On my x86_64 this shrinks the size of .text by 53 KB (7 %).

9 years agolog: remove useless variable
Michal Schmidt [Tue, 17 Jan 2012 09:21:30 +0000 (10:21 +0100)]
log: remove useless variable

abort() never returns. Not even if the signal handler catches SIGABRT.

9 years agodbus-unit: make functions static
Michal Schmidt [Tue, 17 Jan 2012 08:20:32 +0000 (09:20 +0100)]
dbus-unit: make functions static

The dbus_unit_append_*() functions are not referenced from outside anymore.

9 years agobuild-sys: cleanup sysctl.d/coredump.conf
Kay Sievers [Mon, 16 Jan 2012 12:49:08 +0000 (13:49 +0100)]
build-sys: cleanup sysctl.d/coredump.conf

9 years agodbus: more efficient implementation of properties
Michal Schmidt [Sun, 15 Jan 2012 23:23:59 +0000 (00:23 +0100)]
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.

9 years agounit: use safe downcasts, remove pointless casts
Michal Schmidt [Sun, 15 Jan 2012 11:37:16 +0000 (12:37 +0100)]
unit: use safe downcasts, remove pointless casts

Always use the macros for downcasting.
Remove a few obviously pointless casts.

9 years agounit: use the UNIT() macro consistently
Michal Schmidt [Sun, 15 Jan 2012 11:25:20 +0000 (12:25 +0100)]
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.

9 years agounit: remove union Unit
Michal Schmidt [Sun, 15 Jan 2012 11:04:08 +0000 (12:04 +0100)]
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.

9 years agounit: reduce heap usage for unit objects
Michal Schmidt [Sun, 15 Jan 2012 09:53:49 +0000 (10:53 +0100)]
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.

9 years agologind: downgrade login message to debug
Michal Schmidt [Mon, 16 Jan 2012 12:18:17 +0000 (13:18 +0100)]
logind: downgrade login message to debug

The messages make people nervous.