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

11006 Commits

Author SHA1 Message Date
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
Lennart Poettering
f73141d765 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.
2013-04-03 20:12:57 +02:00
Lennart Poettering
7f602784de 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.
2013-04-03 20:12:57 +02:00
Lennart Poettering
574d5f2dfc 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.
2013-04-03 20:12:56 +02:00
Harald Hoyer
b6e8f1f03d core/killall.c: prevent segfault and initialize pids 2013-04-03 15:17:51 +02:00
Zbigniew Jędrzejewski-Szmek
2bfc1edad8 cgtop: add % as key to toggle time/percentage 2013-04-02 15:01:44 -04:00
Umut Tezduyar
1e913bcba3 cgtop: optionally show CPU usage as time and become stdout sensitive 2013-04-02 14:50:14 -04:00
Zbigniew Jędrzejewski-Szmek
7464b33d80 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.
2013-04-02 13:57:32 -04:00
Lennart Poettering
d1148ed10a update TODO 2013-04-02 17:47:59 +02:00
Lennart Poettering
fa70beaabc macro: add macro for precisely determining length of decimal string formatting of a numeric type 2013-04-02 17:47:59 +02:00
Lennart Poettering
5c0aa72a49 util: add a bit of syntactic sugar for saving/restoring errno 2013-04-02 17:47:59 +02:00
Zbigniew Jędrzejewski-Szmek
2875e22b65 Replace s/Dropin/DropIn/ 2013-04-02 10:24:51 -04:00
Oleksii Shevchuk
ae7a7182da Introspect and monitor dropin configuration 2013-04-01 23:43:49 -04:00
Zbigniew Jędrzejewski-Szmek
050fbdb878 shared/cgroup-show: fix leak of "pid" 2013-04-01 23:43:49 -04:00
Zbigniew Jędrzejewski-Szmek
1316013495 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
2013-04-01 23:43:49 -04:00
Oleksii Shevchuk
6741960087 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: 127.0.0.2:9996
	          Stream: [::1]:9996
	          Datagram: /tmp/stream2
	          Datagram: @stream5
	          Datagram: [::]:9998
	          Datagram: 127.0.0.2:9995
	          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.]
2013-04-01 23:43:48 -04:00
Dr. Tilmann Bubeck
80cfe9e163 Do no isolate in case of emergency or severe problems
This patch changes local-fs.target and systemd-fsck to not use
"isolate" when going into emergency.
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=810722

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
situation.

Thanks!

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

https://bugs.freedesktop.org/show_bug.cgi?id=49463
https://bugzilla.redhat.com/show_bug.cgi?id=810722
2013-04-01 23:43:48 -04:00