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

18607 Commits

Author SHA1 Message Date
Lennart Poettering
8b169c0fc2 build-sys: move core/build.h → shared/build.h
After all, pretty much all our tools include it, and it should hence be
shared.

Also move sysfs-show.h from core/ to login/, since it has no point to
exist in core.
2014-12-23 21:05:28 +01:00
Lennart Poettering
f6b6892c49 update TODO 2014-12-23 19:15:27 +01:00
Lennart Poettering
bf441e3d93 machinectl: rework 'machinectl login' to use OpenMachineLogin() 2014-12-23 19:15:27 +01:00
Lennart Poettering
5f8cc96a03 machined: add new call OpenMachineLogin() that starts a getty in a container on a pty and returns the pty master fd to the client
This is a one-stop solution for "machinectl login", and should simplify
getting logins in containers.
2014-12-23 19:15:27 +01:00
Lennart Poettering
ee502e0c28 sd-bus: teach x-container-unix: bus protoocol to connect to the namespace of a PID instead of a container name 2014-12-23 19:15:27 +01:00
Lennart Poettering
080bfdbb8e condition: don't include files from src/core 2014-12-23 19:15:27 +01:00
Lennart Poettering
6eeeb84c96 import: fix compiler warning 2014-12-23 19:15:27 +01:00
Lennart Poettering
039f0e70a0 env-util: don't include files from src/core/ 2014-12-23 19:15:27 +01:00
Lennart Poettering
3c70e3bb02 core: rearrange code so that libsystemd/sd-bus/ does not include header files from core
Stuff in src/shared or src/libsystemd should *never* include code from
src/core or any of the tools, so don't do that here either. It's not OK!
2014-12-23 19:15:27 +01:00
Daniel Mack
3e0a204897 bus-proxyd: ignore errors from sd_bus_creds_get_well_known_names()
sd_bus_creds_get_well_known_names() fails with -ENODATA in case the
message has no names attached, which is intended behavior if the
remote connection didn't own any names at the time of sending.

The function already deals with 'sender_names' being an empty strv,
so we can just continue in such cases.
2014-12-23 18:41:26 +01:00
Daniel Mack
259ac5cd7e bus-proxyd: handle -ESRCH and -ENXIO gracefully
Messages to destinations that are not currently owned by any bus connection
will cause kdbus related function to return with either -ENXIO or -ESRCH.

Such conditions should not make the proxyd terminate but send a sane
SD_BUS_ERROR_NAME_HAS_NO_OWNER error reply to the proxied connection.
2014-12-23 13:41:34 +01:00
Lennart Poettering
1d050f9f73 update TODO 2014-12-23 03:26:24 +01:00
Lennart Poettering
9d8c4979c0 util: add allocation loop to gettyname_malloc() 2014-12-23 03:26:24 +01:00
Lennart Poettering
611b312b7d nspawn,pty: port over to new ptsname_malloc() helper 2014-12-23 03:26:24 +01:00
Lennart Poettering
ee451d766a systemd-run: support -t mode when combined with -M
For that, ask machined for a container PTY and use that.
2014-12-23 03:26:24 +01:00
Lennart Poettering
40205d706e machined: add OpenMachinePTY() bus call for allocating a PTY device within a container
Then, port "machinectl" over to make use of it.
2014-12-23 03:26:24 +01:00
Lennart Poettering
095dc59660 systemd-run: add --quiet mode to suppress informational message on TTY usage 2014-12-23 03:26:24 +01:00
Lennart Poettering
c7b7d4493a machinectl,nspawn: don't print extra final newline if pty terminal output was newline-terinated anyway 2014-12-23 03:26:24 +01:00
Lennart Poettering
9b15b7846d run: add a new "-t" mode for invoking a binary on an allocated TTY 2014-12-23 03:26:24 +01:00
Lennart Poettering
91f4347ef7 import: rename 'poll-dck' to 'pull-dkr'
I figure "pull-dck" is not a good name, given that one could certainly
read the verb in a way that might be funny for 16year-olds. ;-)

Also, don't hardcode the index URL to use, make it runtime and configure
time configurable instead.
2014-12-23 03:25:36 +01:00
Tom Gundersen
9bae67d49b shared: json - support escaping utf16 surrogate pairs
We originally only supported escaping ucs2 encoded characters (as \uxxxx). This
only covers the BMP. Support escaping also utf16 surrogate pairs (on the form
\uxxxx\uyyyy) to cover all of unicode.
2014-12-22 20:27:20 +01:00
Tom Gundersen
04166cb7dd shared: utf8 - support decoding the full utf16
We originally only supported the BMP (i.e., we treated UTF-16 as UCS-2).
2014-12-22 20:26:53 +01:00
Tom Gundersen
2bb4c7e384 shared: utf8 - support ucs4 -> utf8
Originally we only supported ucs2, so move the ucs4 version from libsystemd-terminal to shared
and use that everywhere.
2014-12-22 20:26:53 +01:00
Daniel Mack
856d6e0988 sd-bus: ignore KDBUS_ITEM_TIMESTAMP in kernel messages
Kernel notifications carry a timestamp now, so make sure
bus_kernel_translate_message() doesn't complain when it stumbles across
them.
2014-12-22 19:59:53 +01:00
Daniel Mack
e24e415e5f busname: fix CMD_FREE ioctl
The KDBUS_CMD_FREE ioctl struct has a size field now, which needs to be set.
2014-12-22 16:51:15 +01:00
Dave Reisner
540d858183 verbs: fix typo in error message 2014-12-22 08:21:50 -05:00
Frank Theile
c470b44ff0 hwdb: Lenovo USB mouse MO28UOL DPI data
https://bugs.freedesktop.org/show_bug.cgi?id=87504
2014-12-22 08:19:49 +10:00
Daniel Mack
6ad9bb71c2 sd-bus: sync kdbus.h (ABI break)
Sync kdbus.h with upstream changes:

  * Two optional cancellation points where added for synchronously
    blocking KDBUS_CMD_SEND commands: A sigmask to change the mask
    of accepted signals before the task is put to sleep, and a
    generic file descriptor that can be written to, in order to cancel
    the command. Both methods are currently unused.

  * The KDBUS_CMD_CANCEL ioctl was removed. sd-bus was never using
    that command, so there's no change needed.

  * Some kerneldoc fixes
2014-12-20 19:23:49 +01:00
Umut Tezduyar Lindskog
fe659612e4 build: add option to disable hwdb
[tomegun: fix Makefile-man.am, based on fix from Michael Biebl]
2014-12-20 00:23:37 +01:00
Tom Gundersen
7a6f145746 sd-lldp: minor header cleanup
* (potentially) public headers must reside in src/systemd/ (not in
   src/libsystemd*)
 * some private (not prefixed with sd_) functions moved from sd-lldp.h to
   lldp-internal.h
 * introduce lldp-util.h for the cleanup macro, as these should not be public
 * rename the cleanup macro, we always name them _cleanup_foo_, never
   _cleanup_sd_foo_
 * mark some function arguments as 'const'
2014-12-19 22:42:03 +01:00
Lennart Poettering
2cd3aa2482 update TODO 2014-12-19 20:44:49 +01:00
Lennart Poettering
ebeccf9eec machined: add a full bus object for images 2014-12-19 20:43:18 +01:00
Lennart Poettering
c2ce6a3d82 machined: add new GetImage() bus call for retrieving the bus path for an image 2014-12-19 20:07:23 +01:00
Lennart Poettering
821d4b6e06 sysv-generator: properly add Makefile symlink 2014-12-19 20:04:55 +01:00
Lennart Poettering
a34bf9db5d util: rename ignore_file() to hidden_file()
hidden_file() is a bit more precise, since dot files usually shouldn't
be ignored, but certainly be considered hidden.
2014-12-19 20:03:36 +01:00
Lennart Poettering
358ba19e5e update TODO 2014-12-19 19:19:29 +01:00
Lennart Poettering
56159e0d91 machinectl: port machinectl to new verbs logic 2014-12-19 19:19:29 +01:00
Lennart Poettering
7eeeb28e45 import: Verb[] array can be static, too 2014-12-19 19:19:29 +01:00
Lennart Poettering
43343ee7c2 verbs: when invoking the default verb, pass a faked argv array, with just the verb in it
That way the dispatcher calls know how they got called.
2014-12-19 19:19:29 +01:00
Lennart Poettering
cd61c3bfd7 machined/machinectl: add logic to show list of available images
This adds a new bus call to machined that enumerates /var/lib/container
and returns all trees stored in it, distuingishing three types:

        - GPT disk images, which are files suffixed with ".gpt"
        - directory trees
        - btrfs subvolumes
2014-12-19 19:19:29 +01:00
Lennart Poettering
8eebf6ad55 util: when creating temporary filename for atomic creation of files, add an extra "#" to the name
That way, we have a simple, somewhat reliable way to detect such
temporary files, by simply checking if they start with ".#".
2014-12-19 19:19:29 +01:00
Michal Schmidt
668c965af4 journal: skipping of exhausted journal files is bad if direction changed
EOF is meaningless if the direction of iteration changes.
Move the EOF optimization under the direction check.

This fixes test-journal-interleaving for me.

Thanks to Filipe Brandenburger for telling me about the failure.
2014-12-19 17:14:11 +01:00
Michal Schmidt
b29ddfcb38 journal: make next_with_matches() always use f->current_offset
next_with_matches() is odd in that its "unit64_t *offset" parameter is
both input and output. In other it's purely for output.

The function is called from two places in next_beyond_location(). In
both of them "&cp" is used as the argument and in both cases cp is
guaranteed to equal f->current_offset.

Let's just have next_with_matches() ignore "*offset" on input and
operate with f->current_offset.

I did not investigate why it is, but it makes my usual benchmark run
reproducibly faster:

$ time ./journalctl --since=2014-06-01 --until=2014-07-01 > /dev/null

real    0m4.032s
user    0m3.896s
sys     0m0.135s

(Compare to preceding commit, where real was 4.4s.)
2014-12-19 16:15:21 +01:00
Michal Schmidt
487d37209b journal: fix skipping of duplicate entries in iteration
I accidentally broke the detection of duplicate entries in 7943f42275
"journal: optimize iteration by returning previously found candidate
entry".

When we have a known location of a candidate entry, we must not return
from next_beyond_location() immediately. We must go through the
duplicates detection to make sure the candidate differs from the
already iterated entry.

This fix slows down iteration a bit, but it's still faster than it
was before the rework.

$ time ./journalctl --since=2014-06-01 --until=2014-07-01 > /dev/null

real    0m4.448s
user    0m4.298s
sys     0m0.149s

(Compare with results from commit 7943f42275, where real was 5.3s before
the rework.)
2014-12-19 15:37:10 +01:00
Tom Gundersen
bfcdba8d56 networkd: link - plug leak 2014-12-19 08:34:04 +01:00
Tom Gundersen
19727828d2 networkctl: lldp - respect arg_legend 2014-12-19 08:33:46 +01:00
Susant Sahani
49699bac94 LLDP: Add support for networkctl 2014-12-19 08:15:05 +05:30
Susant Sahani
ce43e48446 networkd: integrate LLDP
This patch integrates LLDP with networkd.

Example conf:
file : lldp.network

[Match]
Name=em1

[Network]
LLDP=yes
2014-12-19 08:02:45 +05:30
Susant Sahani
ad1ad5c8e3 networkd: Introduce Link Layer Discovery Protocol (LLDP)
This patch introduces LLDP support to networkd. it implements the
receiver side of the protocol.

The Link Layer Discovery Protocol (LLDP) is an industry-standard,
vendor-neutral method to allow networked devices to advertise
capabilities, identity, and other information onto a LAN. The Layer 2
protocol, detailed in IEEE 802.1AB-2005.LLDP allows network devices
that operate at the lower layers of a protocol stack (such as
Layer 2 bridges and switches) to learn some of the capabilities
and characteristics of LAN devices available to higher
layer protocols.
2014-12-19 08:02:45 +05:30
Tom Gundersen
266b538958 networkctl: port to verbs helper 2014-12-19 03:16:45 +01:00