chiark / gitweb /
8 years agosystemctl: tweak output of Listen: fields a bit
Lennart Poettering [Fri, 5 Apr 2013 18:12:39 +0000 (20:12 +0200)]
systemctl: tweak output of Listen: fields a bit

It's probably a good idea to minimize the number of field names to show
in the "systemctl status" output, in order to make them useful as a
guide for the reader how things are "grouped". This patch moves
information about the used socket technology to the end of the output
lines in brackets, rather than into the field names. This turns the used
socket technology into what it is -- peripheral meta information --
instead of something that was at the core.

New output:

systemd-journald.socket - Journal Socket
         Loaded: loaded (/usr/lib/systemd/system/systemd-journald.socket; static)
         Active: active (running) since Fr 2013-03-29 02:16:30 CET; 1 weeks 0 days ago
           Docs: man:systemd-journald.service(8)
         Listen: /run/systemd/journal/stdout (Stream)
                 /run/systemd/journal/socket (Datagram)
                 /dev/log (Datagram)

8 years agosystemctl: Add DropIn paths to status message
Oleksii Shevchuk [Fri, 5 Apr 2013 17:58:04 +0000 (20:58 +0300)]
systemctl: Add DropIn paths to status message

$ systemctl status - NYAN
   Loaded: loaded (/home/alxchk/.config/systemd/user/; disabled)
  Drop-In: /home/alxchk/.config/systemd/user/
           └─ descr.conf, install-1.conf, install.conf
           └─ test.conf
   Active: active since Пт 2013-04-05 20:42:13 EEST; 1min 58s ago

8 years agobuild-sys: is no longer required for pam_systemd
Lennart Poettering [Fri, 5 Apr 2013 17:27:00 +0000 (19:27 +0200)]
build-sys: is no longer required for pam_systemd

8 years agobuild-sys: add new man pages to makefile
Lennart Poettering [Fri, 5 Apr 2013 17:24:47 +0000 (19:24 +0200)]
build-sys: add new man pages to makefile

8 years agologind: consider key inhibitors that are taken by non-session processes as global
Lennart Poettering [Fri, 5 Apr 2013 16:57:58 +0000 (18:57 +0200)]
logind: consider key inhibitors that are taken by non-session processes as global

This should allow system services to take over key handling for all
sessions, globally.

8 years agoPAM, uaccess: check for logind, not for systemd
Martin Pitt [Tue, 26 Mar 2013 10:36:31 +0000 (11:36 +0100)]
PAM, uaccess: check for logind, not for systemd

It is possible to build systemd without logind or run logind without systemd
init. Commit 66e41181 fixed sd_booted() to only succeed for systemd init; with
that, testing for systemd init is wrong in the parts that talk to logind.

In particular, this affects the PAM module and the "uaccess" udev builtin.
Change sd_booted() to a new logind_running() which tests for

For details, see:

8 years agoshell-completion: work on session shell is --user is used
Zbigniew Jędrzejewski-Szmek [Fri, 5 Apr 2013 11:45:30 +0000 (07:45 -0400)]
shell-completion: work on session shell is --user is used

8 years agobuild-sys: use LN_S in
Zbigniew Jędrzejewski-Szmek [Fri, 5 Apr 2013 11:25:10 +0000 (07:25 -0400)]
build-sys: use LN_S in

For consistency only. We're Linux only, so it really makes no

8 years agobus: various improvements for test-bus-chat
Lennart Poettering [Fri, 5 Apr 2013 12:55:28 +0000 (14:55 +0200)]
bus: various improvements for test-bus-chat

8 years agobus: convert a couple of calls over to new convenience functions
Lennart Poettering [Fri, 5 Apr 2013 12:49:45 +0000 (14:49 +0200)]
bus: convert a couple of calls over to new convenience functions

8 years agobus: add convenience calls for method replies, too
Lennart Poettering [Fri, 5 Apr 2013 12:48:43 +0000 (14:48 +0200)]
bus: add convenience calls for method replies, too

8 years agobus: when parsing signature strings, accept NULL as empty signature
Lennart Poettering [Fri, 5 Apr 2013 12:48:20 +0000 (14:48 +0200)]
bus: when parsing signature strings, accept NULL as empty signature

8 years agobus: make sure callback structs are always properly initialized
Lennart Poettering [Fri, 5 Apr 2013 12:47:49 +0000 (14:47 +0200)]
bus: make sure callback structs are always properly initialized

8 years agovconsole-setup: fix vconsole.conf vs. cmdline overriding logic
Michal Schmidt [Fri, 5 Apr 2013 11:32:34 +0000 (13:32 +0200)]
vconsole-setup: fix vconsole.conf vs. cmdline overriding logic

Skipping the parsing of /etc/vconsole.conf just because some values were
already assigned from the cmdline never made sense. And by the way, commit
f73141d changed the return values of parse_env_file() - it now gives 0
on success. Which means in current HEAD /etc/vconsole.conf overrides the
cmdline, which is the reverse of what's expected.

We need to parse /etc/vconsole.conf first and then let vconsole.*
overrides from cmdline take effect. The behaviour is documented in

8 years agobus: use C99 struct construction for error initializers
Lennart Poettering [Fri, 5 Apr 2013 11:11:26 +0000 (13:11 +0200)]
bus: use C99 struct construction for error initializers

That way we can allocate an error struct on-the-fly while calling a
function. Nice!

8 years agotest-strv: do not declare table to be sorted const
Zbigniew Jędrzejewski-Szmek [Fri, 5 Apr 2013 04:31:59 +0000 (00:31 -0400)]
test-strv: do not declare table to be sorted const

Segmentation fault under clang.

8 years agotest-catalog,core/load-dropin: remove unused variables
Zbigniew Jędrzejewski-Szmek [Fri, 5 Apr 2013 04:03:24 +0000 (00:03 -0400)]
test-catalog,core/load-dropin: remove unused variables

8 years agojournal: u64log2 can be expressed just as __builtin_clzll(n) ^ 63U
Cristian Rodríguez [Thu, 4 Apr 2013 23:09:50 +0000 (20:09 -0300)]
journal: u64log2 can be expressed just as __builtin_clzll(n) ^ 63U

8 years agosystemctl: align cgroups to 'n' in 'name='
Zbigniew Jędrzejewski-Szmek [Fri, 5 Apr 2013 01:14:32 +0000 (21:14 -0400)]
systemctl: align cgroups to 'n' in 'name='

Also drop ':' in repeated Docs lines.

8 years agosd-id128: check that the kernel is feeding us proper data
Zbigniew Jędrzejewski-Szmek [Wed, 3 Apr 2013 20:58:16 +0000 (16:58 -0400)]
sd-id128: check that the kernel is feeding us proper data

The characters are already checked, so we show that
we don't trust the kernel. Make sure we don't overrun
the buffer too.

8 years agoudevadm-hwdb: avoid leak in error path
Zbigniew Jędrzejewski-Szmek [Wed, 3 Apr 2013 20:48:46 +0000 (16:48 -0400)]
udevadm-hwdb: avoid leak in error path

8 years agoefivars: un-leak a few strings
Zbigniew Jędrzejewski-Szmek [Wed, 3 Apr 2013 20:32:01 +0000 (16:32 -0400)]
efivars: un-leak a few strings

8 years agotimedated: fix a few memory leaks
Zbigniew Jędrzejewski-Szmek [Tue, 2 Apr 2013 20:07:21 +0000 (16:07 -0400)]
timedated: fix a few memory leaks

Contents of /etc/adjtime and more.

8 years agobus: add convenience functions for constructing and sending method calls/signals...
Lennart Poettering [Fri, 5 Apr 2013 02:15:39 +0000 (04:15 +0200)]
bus: add convenience functions for constructing and sending method calls/signals in one call

8 years agobus: properly detect and handle if a callback is installed/removed from within a...
Lennart Poettering [Fri, 5 Apr 2013 01:55:58 +0000 (03:55 +0200)]
bus: properly detect and handle if a callback is installed/removed from within a callback

8 years agobus: don't allow recursive invocation of sd_bus_process()
Lennart Poettering [Fri, 5 Apr 2013 01:15:10 +0000 (03:15 +0200)]
bus: don't allow recursive invocation of sd_bus_process()

8 years agoupdate TODO
Lennart Poettering [Thu, 4 Apr 2013 22:24:00 +0000 (00:24 +0200)]
update TODO

8 years agolocalectl: add support for listing X11 keymap information
Lennart Poettering [Thu, 4 Apr 2013 22:23:23 +0000 (00:23 +0200)]
localectl: add support for listing X11 keymap information

8 years agojournal: add sd_journal_get_timeout() call to public API
Lennart Poettering [Thu, 4 Apr 2013 18:07:48 +0000 (20:07 +0200)]
journal: add sd_journal_get_timeout() call to public API

Let's do the wake-up logic on NFS internally, making things simpler for

8 years agologin: add sd_login_monitor_get_timeout() public api call
Lennart Poettering [Thu, 4 Apr 2013 16:31:22 +0000 (18:31 +0200)]
login: add sd_login_monitor_get_timeout() public api call

We don't need this right now, but we should keep our options open, in
case we need more than just an fd for waking up.

8 years agoupdate TODO
Lennart Poettering [Thu, 4 Apr 2013 15:49:33 +0000 (17:49 +0200)]
update TODO

8 years agotest-bus-marshal.c: do not call g_type_init() for modern glib versions
Harald Hoyer [Thu, 4 Apr 2013 07:02:28 +0000 (09:02 +0200)]
test-bus-marshal.c: do not call g_type_init() for modern glib versions

8 years agocryptsetup-generator: add JobTimeoutSec=0 for the decrypted crypt devices
Harald Hoyer [Fri, 1 Mar 2013 14:13:43 +0000 (15:13 +0100)]
cryptsetup-generator: add JobTimeoutSec=0 for the decrypted crypt devices

The password query for a crypto device currently times out after 90s,
which is too short to grab a cup of coffee when a machine boots up.

The resulting decrypted device /dev/mapper/luks-<uuid> might not
be a mountpoint (but part of a LVM PV or raid array)
and therefore the timeout cannot be controlled by the settings
in /etc/fstab. For this reason this device should not carry its own timeout.

Also the encrypted device /dev/disk/by-*/* already has a timeout and
additionally the timeout for the password query is set in /etc/crypttab.

This patch disables the timeout of the resulting decrypted devices by creating
<device-unit>.d/50-job-timeout-sec-0.conf files with "JobTimeoutSec=0".

8 years agologin: add new public API call sd_login_monitor_get_events() to get poll() flags...
Lennart Poettering [Thu, 4 Apr 2013 15:38:08 +0000 (17:38 +0200)]
login: add new public API call sd_login_monitor_get_events() to get poll() flags to wait for

We should keep our options open, so that we can watch for POLLOUT later
on if we wish to. CUrrently this call will always return POLLIN however.

8 years agojournal: add public API call sd_journal_get_events()
Lennart Poettering [Thu, 4 Apr 2013 15:22:28 +0000 (17:22 +0200)]
journal: add public API call sd_journal_get_events()

This function should be used when filling in "struct pollfd"'s .events
field for watching the journal. It will always return POLLIN for now,
but we should keep our options open to change this later on.

This mimics libsystemd-bus' sd_bus_get_events() call with the same

8 years agoutil: tweak format_timespan() a bit
Lennart Poettering [Thu, 4 Apr 2013 15:06:00 +0000 (17:06 +0200)]
util: tweak format_timespan() a bit

Make sure to always print out at least one valid component instead of
falling back early to 0.

8 years agoutil: add a bit of syntactic sugar to run short code fragments with a different umask
Lennart Poettering [Thu, 4 Apr 2013 01:39:39 +0000 (03:39 +0200)]
util: add a bit of syntactic sugar to run short code fragments with a different umask

8 years agoutil: make time formatting a bit smarter
Lennart Poettering [Thu, 4 Apr 2013 00:56:56 +0000 (02:56 +0200)]
util: make time formatting a bit smarter

Instead of outputting "5h 55s 50ms 3us" we'll now output "5h
55.050003s". Also, while outputting the accuracy is configurable.

Basically we now try use "dot notation" for all time values > 1min. For
>= 1s we use 's' as unit, otherwise for >= 1ms we use 'ms' as unit, and
finally 'us'.

This should give reasonably values in most cases.

8 years agoupdate TODO
Lennart Poettering [Wed, 3 Apr 2013 20:59:57 +0000 (22:59 +0200)]
update TODO

8 years agotime: add suppot for fractional time specifications
Lennart Poettering [Wed, 3 Apr 2013 20:58:41 +0000 (22:58 +0200)]
time: add suppot for fractional time specifications

We can now parse "0.5s" as the same as "500ms". In fact, we can parse
"3.45years" correctly, too, and any other unit and fraction length.

8 years agobuild-sys: "link" libsystemd-id128 against libsd-daemon-internal
Zbigniew Jędrzejewski-Szmek [Wed, 3 Apr 2013 20:08:28 +0000 (16:08 -0400)]
build-sys: "link" libsystemd-id128 against libsd-daemon-internal

georgem> undefined reference to `sd_listen_fds'

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

This results in no change in when the unused
symbols are properly stripped.

8 years agohostnamectl: if somebody invokes 'hostnamectl set-hostname' with a valid internet...
Lennart Poettering [Wed, 3 Apr 2013 20:06:16 +0000 (22:06 +0200)]
hostnamectl: if somebody invokes 'hostnamectl set-hostname' with a valid internet hostname unset the pretty name

If people are unaware or uninterested in the concept of pretty host
names, and simply invoke "hostnamectl set-hostname" for a valid internet
host name, then use this as indication to unset the pretty host name and
only set the static/dynamic one.

This also allows fqdn, hence "hostnamectl set-hostname"
will just work if people really insist on using fqdns as hostnames.

8 years agofileio: don't check for errors more often than really necessary
Lennart Poettering [Wed, 3 Apr 2013 18:04:57 +0000 (20:04 +0200)]
fileio: don't check for errors more often than really necessary

8 years agofileio: write proper env var write-out code
Lennart Poettering [Wed, 3 Apr 2013 17:56:39 +0000 (19:56 +0200)]
fileio: write proper env var write-out code

This will properly escape all weird chars when writing env var files.
With this in place we can now read and write environment files where the
values contain arbitrary weird chars.

This enables hostnamed and suchlike to finally properly save pretty host
names with backlashes or quotes in them.

8 years agoshared: rework env file reader
Lennart Poettering [Wed, 3 Apr 2013 17:04:03 +0000 (19:04 +0200)]
shared: rework env file reader

Implement this with a proper state machine, so that newlines and
escaped chars can appear in string assignments. This should bring the
parser much closer to shell.

8 years agoutil: rename parse_usec() to parse_sec() sinds the default unit is seconds
Lennart Poettering [Tue, 2 Apr 2013 18:38:16 +0000 (20:38 +0200)]
util: rename parse_usec() to parse_sec() sinds the default unit is seconds

Internally we store all time values in usec_t, however parse_usec()
actually was used mostly to parse values in seconds (unless explicit
units were specified to define a different unit). Hence, be clear about
this and name the function about what we pass into it, not what we get
out of it.

8 years agoutil: rename write_one_line_file() to write_string_file()
Lennart Poettering [Tue, 2 Apr 2013 18:31:42 +0000 (20:31 +0200)]
util: rename write_one_line_file() to write_string_file()

You can write much more than just one line with this call (and we
frequently do), so let's correct the naming.

8 years agocore/killall.c: prevent segfault and initialize pids
Harald Hoyer [Wed, 3 Apr 2013 13:16:06 +0000 (15:16 +0200)]
core/killall.c: prevent segfault and initialize pids

8 years agocgtop: add % as key to toggle time/percentage
Zbigniew Jędrzejewski-Szmek [Tue, 2 Apr 2013 18:55:36 +0000 (14:55 -0400)]
cgtop: add % as key to toggle time/percentage

8 years agocgtop: optionally show CPU usage as time and become stdout sensitive
Umut Tezduyar [Tue, 2 Apr 2013 16:52:16 +0000 (18:52 +0200)]
cgtop: optionally show CPU usage as time and become stdout sensitive

8 years agonss-myhostname: do not use _cleanup_
Zbigniew Jędrzejewski-Szmek [Tue, 2 Apr 2013 17:52:51 +0000 (13:52 -0400)]
nss-myhostname: do not use _cleanup_

mss-myhostname wasn't working because of underlinking. Instead of
fixing the underlinking, just remove the use of _cleanup_ macros.

It is impolite to use our utility functions in modules designed to be
loaded by others. So cleanup macros which (at some point) call assert
which calls log_assert_failed, should not be used. Revert this part of
commit d73c3269c.

8 years agoupdate TODO
Lennart Poettering [Tue, 2 Apr 2013 15:33:31 +0000 (17:33 +0200)]
update TODO

8 years agomacro: add macro for precisely determining length of decimal string formatting of...
Lennart Poettering [Tue, 2 Apr 2013 15:33:19 +0000 (17:33 +0200)]
macro: add macro for precisely determining length of decimal string formatting of a numeric type

8 years agoutil: add a bit of syntactic sugar for saving/restoring errno
Lennart Poettering [Tue, 2 Apr 2013 14:31:55 +0000 (16:31 +0200)]
util: add a bit of syntactic sugar for saving/restoring errno

8 years agoReplace s/Dropin/DropIn/
Zbigniew Jędrzejewski-Szmek [Tue, 2 Apr 2013 14:24:45 +0000 (10:24 -0400)]
Replace s/Dropin/DropIn/

8 years agoIntrospect and monitor dropin configuration
Oleksii Shevchuk [Mon, 1 Apr 2013 10:32:35 +0000 (13:32 +0300)]
Introspect and monitor dropin configuration

8 years agoshared/cgroup-show: fix leak of "pid"
Zbigniew Jędrzejewski-Szmek [Tue, 2 Apr 2013 03:11:54 +0000 (23:11 -0400)]
shared/cgroup-show: fix leak of "pid"

8 years agosystemctl: align all status fields to common column
Zbigniew Jędrzejewski-Szmek [Tue, 2 Apr 2013 03:09:35 +0000 (23:09 -0400)]
systemctl: align all status fields to common column

avahi-daemon.socket - Avahi mDNS/DNS-SD Stack Activation Socket
       Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.socket; enabled)
       Active: active (listening) since Mon 2013-04-01 09:02:44 EDT; 14h ago
 ListenStream: /var/run/avahi-daemon/socket

8 years agoAdd Listen* to dbus properties
Oleksii Shevchuk [Mon, 1 Apr 2013 20:09:45 +0000 (23:09 +0300)]
Add Listen* to dbus properties

sockets.socket - Test
  Loaded: loaded (/home/alxchk/.config/systemd/user/sockets.socket; static)
  Active: inactive (dead)
  Listen: Stream: /tmp/stream1
          Stream: @stream4
          Stream: [::]:9999
          Stream: [::1]:9996
          Datagram: /tmp/stream2
          Datagram: @stream5
          Datagram: [::]:9998
          Datagram: [::1]:9995
          SequentialPacket: @stream6
          SequentialPacket: /tmp/stream3
          FIFO: /tmp/fifo1
          Special: /dev/input/event9
          Netlink: kobject-uevent 0
          MessageQueue: /msgqueue1

[zj: - minor cleanups,
     - free i.listen,
     - remove sorting, because the order or sockets matters.]

8 years agoDo no isolate in case of emergency or severe problems
Dr. Tilmann Bubeck [Fri, 4 May 2012 08:32:47 +0000 (10:32 +0200)]
Do no isolate in case of emergency or severe problems

This patch changes and systemd-fsck to not use
"isolate" when going into emergency.
This fixes

The motivation is, that when something wents wrong, we should
keep everything as it is, to let the user fix the problem. When
isolating we stop a lot of services and therefore change the
system heavily so that it gets harder for the user to fix.

An example is a crypted partition. When the fsck in a crypted
partition fails, it previously used "emergency/start/isolate"
which stops cryptsetup. Therefore if the user tries to fsck
e.g. /dev/mapper/luks-356c20ae-c7a2-4f1c-ae1d-1d290a91b691
as printed by the failing fsck, then it will not find this
device (because it got closed).

So please apply this patch to let the user see the failing


[zj: removed dead isolate param from start_target().]

8 years agoAlways use our own MAX/MIN definitions
Cristian Rodríguez [Mon, 1 Apr 2013 06:08:05 +0000 (03:08 -0300)]
Always use our own MAX/MIN definitions

code in src/shared/macro.h only defined MAX/MIN in case
they were not defined previously. however the MAX/MIN
macros implemented in glibc are not of the "safe" kind but defined

define MIN(a,b) (((a)<(b))?(a):(b))
define MAX(a,b) (((a)>(b))?(a):(b))

Avoid nasty side effects by using our own versions instead.

Also fix the warnings derived from this change.

[zj: - modify MAX3 macro to fix warning about _a shadowing _a,
     - do bootchart/svg.c too,
     - remove unused MIN3.]

8 years agoupdate TODO
Lennart Poettering [Mon, 1 Apr 2013 21:04:11 +0000 (23:04 +0200)]
update TODO

8 years agoshutdown: correctly wait for processes we killed in the killall spree
Lennart Poettering [Mon, 1 Apr 2013 20:48:40 +0000 (22:48 +0200)]
shutdown: correctly wait for processes we killed in the killall spree

Previously we simply counted how many processes we killed and expected
as many waitpid() calls to succeed. That however is incorrect to do.

As we might kill processes that are not our immediate children, and as
there might be left-over processes in the waitpid() queue from earlier
the we might get more ore less waitpid() events that we expect.

Hence: keep precise track of the processes we kill, remove the ones we
get waitpid() for, and after each time we get SIGCHLD check if all
others still exist. We use getpgid() to check if a PID still exists.

This should fix issues with journald not setting journal files offline
correctly on shutdown, because we'd too quickly proceed from SIGTERM to
SIGKILL because some left-over process was in our waitpid() queue.

8 years agocryptsetup: add RequiresMountsFor for keyfile
Thomas Weißschuh [Fri, 29 Mar 2013 22:01:12 +0000 (22:01 +0000)]
cryptsetup: add RequiresMountsFor for keyfile

This ensures that the keyfile is available during the opening of the encrypted

Also dropped the explicit ordering, as the containers
are ordered implicitly by their content.

8 years agocryptsetup: RequiresMountsFor if source is a file
Thomas Weißschuh [Fri, 29 Mar 2013 22:01:11 +0000 (22:01 +0000)]
cryptsetup: RequiresMountsFor if source is a file


8 years agocore/socket: log errors when starting socket for this socket
Zbigniew Jędrzejewski-Szmek [Mon, 1 Apr 2013 02:44:45 +0000 (22:44 -0400)]
core/socket: log errors when starting socket for this socket

When showing an error like 'Socket service not loaded', the
error won't show up in the status for the socket, unless it is
marked as SYSTEMD_UNIT=*.socket. Marking it as SYSTEMD_UNIT=*.service,
when the service is non-existent, is not useful.

8 years agoAdd AllowIsolate=yes to snapshots
Oleksii Shevchuk [Sun, 31 Mar 2013 11:40:04 +0000 (14:40 +0300)]
Add AllowIsolate=yes to snapshots

8 years agostdio-bridge: rework stdio bridge to use libsystemd-bus
Lennart Poettering [Mon, 1 Apr 2013 01:28:42 +0000 (03:28 +0200)]
stdio-bridge: rework stdio bridge to use libsystemd-bus

8 years agobus: always return something in sd_bus_get_timeout()
Lennart Poettering [Mon, 1 Apr 2013 01:26:38 +0000 (03:26 +0200)]
bus: always return something in sd_bus_get_timeout()

8 years agobus: be more careful when determining credential data
Lennart Poettering [Mon, 1 Apr 2013 01:25:31 +0000 (03:25 +0200)]
bus: be more careful when determining credential data

As it turns out SCM_CREDENTIALS is not always supported on socketpair(),
so let's also try SO_PEERCRED then.

8 years agobus: when the first char a server receives isn't the NUL byte immediately fail
Lennart Poettering [Mon, 1 Apr 2013 01:24:43 +0000 (03:24 +0200)]
bus: when the first char a server receives isn't the NUL byte immediately fail

8 years agobus: ignore the passed UID on EXTERNAL auth if ANONYMOUS is allowed
Lennart Poettering [Mon, 1 Apr 2013 01:24:03 +0000 (03:24 +0200)]
bus: ignore the passed UID on EXTERNAL auth if ANONYMOUS is allowed

8 years agobus: when reading a message from the socket, make sure to note down the size
Lennart Poettering [Mon, 1 Apr 2013 01:23:27 +0000 (03:23 +0200)]
bus: when reading a message from the socket, make sure to note down the size

8 years agobus: reuse sd_is_socket() call
Lennart Poettering [Sun, 31 Mar 2013 18:19:44 +0000 (20:19 +0200)]
bus: reuse sd_is_socket() call

8 years agobus: fall back to readv/writev if recvmsg/sendmsg don't work
Lennart Poettering [Sun, 31 Mar 2013 18:19:18 +0000 (20:19 +0200)]
bus: fall back to readv/writev if recvmsg/sendmsg don't work

8 years agobus: allow two different fds for input/output in sd_bus_set_fd()
Lennart Poettering [Sun, 31 Mar 2013 17:10:49 +0000 (19:10 +0200)]
bus: allow two different fds for input/output in sd_bus_set_fd()

This is useful so that we can speak D-Bus over a FIFO pair such as

8 years agoPartially revert e62d8c394474
Zbigniew Jędrzejewski-Szmek [Sun, 31 Mar 2013 23:50:30 +0000 (19:50 -0400)]
Partially revert e62d8c394474

The ~80 chars per line part wasn't well received.

8 years agounits/user: must be isolatable
Zbigniew Jędrzejewski-Szmek [Sun, 31 Mar 2013 23:27:49 +0000 (19:27 -0400)]
units/user: must be isolatable

Activating default unit:
Default target could not be isolated, starting instead: Operation refused, unit may not be isolated.

8 years agoactivate: do not leak envp on error
Zbigniew Jędrzejewski-Szmek [Sun, 31 Mar 2013 22:18:10 +0000 (18:18 -0400)]
activate: do not leak envp on error

8 years agojournalctl: reword error message
Zbigniew Jędrzejewski-Szmek [Mon, 25 Mar 2013 00:16:00 +0000 (20:16 -0400)]
journalctl: reword error message

Sentence seemed to suggest that all three conditions must be true.

8 years agotmpfiles: fix obscure leak in error path
Zbigniew Jędrzejewski-Szmek [Sun, 31 Mar 2013 20:29:46 +0000 (16:29 -0400)]
tmpfiles: fix obscure leak in error path

The leak was because of the single return in midst of all
'goto finish'es. Using automatic cleanup simplifies things.

8 years agoModernization
Zbigniew Jędrzejewski-Szmek [Sun, 24 Mar 2013 23:45:16 +0000 (19:45 -0400)]

Use _cleanup_ and wrap lines to ~80 chars and such.

8 years agostrbuf: replace quick sort with bubble sort
Zbigniew Jędrzejewski-Szmek [Sun, 31 Mar 2013 02:12:56 +0000 (22:12 -0400)]
strbuf: replace quick sort with bubble sort

No need to call the heavy artillery, when the original array
is sorted. Reduces complexity from n² log n to n log n, where
n is the number of items in the array, not very large, but

8 years agostrbuf: fix leak on memory error
Zbigniew Jędrzejewski-Szmek [Sun, 31 Mar 2013 00:32:56 +0000 (20:32 -0400)]
strbuf: fix leak on memory error

Not very likely, but let's fix it for the matter of

8 years agobootchart: fix a potential buffer overrun
Zbigniew Jędrzejewski-Szmek [Sat, 30 Mar 2013 23:34:23 +0000 (19:34 -0400)]
bootchart: fix a potential buffer overrun

If the configured number of samples was close to MAXSAMPLES,
the samples buffer could be overrun:

- by 1, because of off-by-one in the condition (samples > arg_samples_len),
- by many in case of an overrun, because the number of samples to
  capture was increased, instead of being decreased.

Simplify things by converting to a normal for-loop.

In store.c: change buffer size from 4095 to 4096. 4095 is a strange

8 years agobootchart: split out option parsing from main()
Zbigniew Jędrzejewski-Szmek [Sat, 30 Mar 2013 22:43:34 +0000 (18:43 -0400)]
bootchart: split out option parsing from main()

8 years agojournald: check return value of strappend
Zbigniew Jędrzejewski-Szmek [Sat, 30 Mar 2013 21:47:48 +0000 (17:47 -0400)]
journald: check return value of strappend

8 years agobus: check return value from bus_type_get_alignment/size
Zbigniew Jędrzejewski-Szmek [Sat, 30 Mar 2013 21:34:15 +0000 (17:34 -0400)]
bus: check return value from bus_type_get_alignment/size

8 years agonspawn, machine-id-setup: warn if read-only mount call fails
Zbigniew Jędrzejewski-Szmek [Sat, 30 Mar 2013 20:33:55 +0000 (16:33 -0400)]
nspawn, machine-id-setup: warn if read-only mount call fails

They are not crucial, but they shouldn't fail.

8 years agonss-myhostname: use _cleanup_ and split function into two
Zbigniew Jędrzejewski-Szmek [Sat, 30 Mar 2013 14:46:04 +0000 (10:46 -0400)]
nss-myhostname: use _cleanup_ and split function into two

The triply nested loop is just too much. Let's split out the
middle loop's body, so the whole thing is easier to read. Also
modernize the style a bit, using structure initialization to
avoid memset and such.

8 years agoaccelerometer: remove dead if and modernize
Zbigniew Jędrzejewski-Szmek [Sat, 30 Mar 2013 06:22:15 +0000 (02:22 -0400)]
accelerometer: remove dead if and modernize

Based on a coverity warning.

8 years agoexecute: convert secure bits into mask properly
Zbigniew Jędrzejewski-Szmek [Sat, 30 Mar 2013 05:40:11 +0000 (01:40 -0400)]
execute: convert secure bits into mask properly


8 years agoRemove some dead code
Zbigniew Jędrzejewski-Szmek [Sat, 30 Mar 2013 05:38:36 +0000 (01:38 -0400)]
Remove some dead code

Based on coverity report.

8 years agojournal-gatewayd: query PID 1 for virtalization
Lennart Poettering [Sun, 31 Mar 2013 16:15:59 +0000 (18:15 +0200)]
journal-gatewayd: query PID 1 for virtalization

Since journal-gatewayd is now running unprivileged, and detecting
virtalization requires privileges, query PID1 via D-Bus for the used

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

8 years agobus: rename sd_bus_get_peer() to sd_bus_get_server_id()
Lennart Poettering [Sun, 31 Mar 2013 14:46:21 +0000 (16:46 +0200)]
bus: rename sd_bus_get_peer() to sd_bus_get_server_id()

This function always returns the server side ID. The name suggested it
was actually always the peer's ID, but that's not correct if the call is
called on a server bus context. Hence, let's correct the name a bit.

8 years agobus: s/sd_message_handler_t/sd_bus_message_handler_t/g
Lennart Poettering [Sun, 31 Mar 2013 14:26:14 +0000 (16:26 +0200)]
bus: s/sd_message_handler_t/sd_bus_message_handler_t/g

8 years agobus: parse matches locally and allow registration of callbacks for them
Lennart Poettering [Sun, 31 Mar 2013 14:16:37 +0000 (16:16 +0200)]
bus: parse matches locally and allow registration of callbacks for them

This includes code to parse and split up match strings which will also
be useful to calculate bloom filter masks when the time comes.

8 years agobus: add missing test-bus-server.c
Lennart Poettering [Sat, 30 Mar 2013 14:30:23 +0000 (15:30 +0100)]
bus: add missing test-bus-server.c

8 years agobus: implement server mode, and anonymous authentication
Lennart Poettering [Sat, 30 Mar 2013 14:21:06 +0000 (15:21 +0100)]
bus: implement server mode, and anonymous authentication

8 years agoprioq: consider a NULL prioq empty
Lennart Poettering [Sat, 30 Mar 2013 14:19:53 +0000 (15:19 +0100)]
prioq: consider a NULL prioq empty