1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 06:52:22 +03:00
Commit Graph

11022 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
245802dd89 Use _cleanup_ when reading config files 2013-04-05 20:00:55 -04:00
Zbigniew Jędrzejewski-Szmek
c84a948831 Add _cleanup_globfree_
Fixes a memleak in error path in exec_context_load_environment.
2013-04-05 19:58:53 -04:00
Zbigniew Jędrzejewski-Szmek
b92bea5d2a Use initalization instead of explicit zeroing
Before, we would initialize many fields twice: first
by filling the structure with zeros, and then a second
time with the real values. We can let the compiler do
the job for us, avoiding one copy.

A downside of this patch is that text gets slightly
bigger. This is because all zero() calls are effectively
inlined:

$ size build/.libs/systemd
         text    data     bss     dec     hex filename
before 897737  107300    2560 1007597   f5fed build/.libs/systemd
after  897873  107300    2560 1007733   f6075 build/.libs/systemd

… actually less than 1‰.

A few asserts that the parameter is not null had to be removed. I
don't think this changes much, because first, it is quite unlikely
for the assert to fail, and second, an immediate SEGV is almost as
good as an assert.
2013-04-05 19:50:57 -04:00
Zbigniew Jędrzejewski-Szmek
8c62ecf1a9 udevadm: do not free node on success
A fix for ff03aed06a.
2013-04-05 17:39:13 -04:00
Zbigniew Jędrzejewski-Szmek
bad490b051 udev-builtin-usb_id: avoid comparison of unsigned and ssize_t
For some reason this shows up on i686 only:
src/udev/udev-builtin-usb_id.c:192:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
2013-04-05 17:39:02 -04:00
Lennart Poettering
5a8e9427a6 systemctl: tweak drop-in display
So far we didn't place spaces between the box drawing chars and the
values next to them. Let's be consistent here.

(Or to turn this around: if we really want to place a space there we
probably should do that in all our tree outputs, not just here...)
2013-04-05 20:19:54 +02:00
Lennart Poettering
45a4f72337 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)
                 man:journald.conf(5)
                 man:systemd-journald.service(8)
                 man:journald.conf(5)
         Listen: /run/systemd/journal/stdout (Stream)
                 /run/systemd/journal/socket (Datagram)
                 /dev/log (Datagram)
2013-04-05 20:12:39 +02:00
Oleksii Shevchuk
76d14b876a systemctl: Add DropIn paths to status message
$ systemctl status null.target
null.target - NYAN
   Loaded: loaded (/home/alxchk/.config/systemd/user/null.target; disabled)
  Drop-In: /home/alxchk/.config/systemd/user/null.target.d
           └─ descr.conf, install-1.conf, install.conf
           /etc/systemd/user/null.target.d
           └─ test.conf
   Active: active since Пт 2013-04-05 20:42:13 EEST; 1min 58s ago
2013-04-05 20:01:42 +02:00
Lennart Poettering
0c20f88d55 build-sys: libsystemd-daemon.so is no longer required for pam_systemd 2013-04-05 19:27:00 +02:00
Lennart Poettering
6f62868b56 build-sys: add new man pages to makefile 2013-04-05 19:26:20 +02:00
Lennart Poettering
2c4f86c129 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.
2013-04-05 18:57:58 +02:00
Martin Pitt
79d860fe78 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
/run/systemd/seats/.

For details, see:
<https://mail.gnome.org/archives/desktop-devel-list/2013-March/msg00092.html>

https://bugs.freedesktop.org/show_bug.cgi?id=62754
2013-04-05 18:16:58 +02:00
Zbigniew Jędrzejewski-Szmek
9e542e0b3a shell-completion: work on session shell is --user is used
https://bugs.freedesktop.org/show_bug.cgi?id=61695
2013-04-05 11:44:01 -04:00
Zbigniew Jędrzejewski-Szmek
ac2b34e155 build-sys: use LN_S in Makefile.am
For consistency only. We're Linux only, so it really makes no
difference.

https://bugs.freedesktop.org/show_bug.cgi?id=63036
2013-04-05 11:43:46 -04:00
Lennart Poettering
b7f247e0be bus: various improvements for test-bus-chat 2013-04-05 14:56:48 +02:00
Lennart Poettering
d4100e2444 bus: convert a couple of calls over to new convenience functions 2013-04-05 14:56:48 +02:00
Lennart Poettering
f10dda3b82 bus: add convenience calls for method replies, too 2013-04-05 14:56:48 +02:00
Lennart Poettering
88d331d537 bus: when parsing signature strings, accept NULL as empty signature 2013-04-05 14:56:48 +02:00
Lennart Poettering
eba8617efc bus: make sure callback structs are always properly initialized 2013-04-05 14:56:48 +02:00
Michal Schmidt
2034ec42ec 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
vconsole.conf(5).

https://bugzilla.redhat.com/show_bug.cgi?id=948750
2013-04-05 13:46:47 +02:00
Lennart Poettering
c784c5ce77 bus: use C99 struct construction for error initializers
That way we can allocate an error struct on-the-fly while calling a
function. Nice!
2013-04-05 13:12:11 +02:00
Zbigniew Jędrzejewski-Szmek
1e64bbc156 test-strv: do not declare table to be sorted const
Segmentation fault under clang.
2013-04-05 00:31:59 -04:00
Zbigniew Jędrzejewski-Szmek
737563e4bb test-catalog,core/load-dropin: remove unused variables 2013-04-05 00:17:35 -04:00
Cristian Rodríguez
144e51eca2 journal: u64log2 can be expressed just as __builtin_clzll(n) ^ 63U 2013-04-05 00:17:35 -04:00
Zbigniew Jędrzejewski-Szmek
e8853816bf systemctl: align cgroups to 'n' in 'name='
Also drop ':' in repeated Docs lines.
2013-04-05 00:17:35 -04:00
Zbigniew Jędrzejewski-Szmek
54c7d1f454 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.
2013-04-05 00:17:35 -04:00
Zbigniew Jędrzejewski-Szmek
ff03aed06a udevadm-hwdb: avoid leak in error path 2013-04-04 22:46:19 -04:00
Zbigniew Jędrzejewski-Szmek
5483a18693 efivars: un-leak a few strings 2013-04-04 22:46:19 -04:00
Zbigniew Jędrzejewski-Szmek
d257f05a5f timedated: fix a few memory leaks
Contents of /etc/adjtime and more.
2013-04-04 22:46:19 -04:00
Lennart Poettering
917b5dc707 bus: add convenience functions for constructing and sending method calls/signals in one call 2013-04-05 04:15:39 +02:00
Lennart Poettering
7286037fd4 bus: properly detect and handle if a callback is installed/removed from within a callback 2013-04-05 03:55:58 +02:00
Lennart Poettering
6807947e56 bus: don't allow recursive invocation of sd_bus_process() 2013-04-05 03:15:10 +02:00
Lennart Poettering
4b9c52209b update TODO 2013-04-05 00:24:00 +02:00
Lennart Poettering
50cfc57928 localectl: add support for listing X11 keymap information 2013-04-05 00:23:23 +02:00
Lennart Poettering
39c155ea0d journal: add sd_journal_get_timeout() call to public API
Let's do the wake-up logic on NFS internally, making things simpler for
users.
2013-04-04 20:07:48 +02:00
Lennart Poettering
667c24a6a8 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.
2013-04-04 18:31:22 +02:00
Lennart Poettering
60491a2869 update TODO 2013-04-04 17:50:13 +02:00
Harald Hoyer
34f856cbd0 test-bus-marshal.c: do not call g_type_init() for modern glib versions 2013-04-04 17:43:21 +02:00
Harald Hoyer
68395007f3 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".
2013-04-04 17:40:09 +02:00
Lennart Poettering
dace83cbd0 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.
2013-04-04 17:38:08 +02:00
Lennart Poettering
ee531d949c 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
purpose.
2013-04-04 17:22:28 +02:00
Lennart Poettering
7c537b2e28 util: tweak format_timespan() a bit
Make sure to always print out at least one valid component instead of
falling back early to 0.
2013-04-04 17:06:00 +02:00
Lennart Poettering
5c0d398dfc util: add a bit of syntactic sugar to run short code fragments with a different umask 2013-04-04 03:39:39 +02:00
Lennart Poettering
2fa4092c28 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.
2013-04-04 02:56:56 +02:00
Lennart Poettering
911963f1a2 update TODO 2013-04-03 23:00:08 +02:00
Lennart Poettering
cb0dac0548 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.
2013-04-03 23:00:08 +02:00
Zbigniew Jędrzejewski-Szmek
d3b9e0ff4e build-sys: "link" libsystemd-id128 against libsd-daemon-internal
georgem> libsystemd-id128.so: 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
sd-id128.so is linked against sd-shared.la, and some functions therein
use libsystemd-daemon, but libsd-id128 doesn't use any of those
functions.

This results in no change in libsystemd-id128.so when the unused
symbols are properly stripped.
2013-04-03 16:14:29 -04:00
Lennart Poettering
fda2c5d28b 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 www.foobar.com"
will just work if people really insist on using fqdns as hostnames.
2013-04-03 22:06:16 +02:00
Lennart Poettering
fec6fc6bae fileio: don't check for errors more often than really necessary 2013-04-03 20:12:57 +02:00
Lennart Poettering
768100efd5 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.
2013-04-03 20:12:57 +02:00