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

22634 Commits

Author SHA1 Message Date
Lennart Poettering
fd8d05e9b8 man: fix journalctl --syslog-identifier= documentation
We don't actually accept patterns, hence don't claim so. This is a
fix-up for 730836403a.

Fixes #1256.
2015-10-03 11:40:16 +02:00
Lennart Poettering
3225266095 man: document that the automatic journal limits are capped to 4G by default
Fixes #1441.
2015-10-03 11:34:11 +02:00
Lennart Poettering
988a479642 nspawn: fix --image= when nspawn is run as service
nspawn needs access to /dev/loop to implement --image=, hence grant that
in the service file.

Fixes #1446.
2015-10-03 11:23:52 +02:00
Evgeny Vereshchagin
8983e16aac man: systemd.journal-fields: add info about _TRANSPORT=audit 2015-10-03 05:38:06 +03:00
Lennart Poettering
8580d1f73d journal: rework vacuuming logic
Implement a maximum limit on number of journal files to keep around.
Enforcing a limit is useful on this since our performance when viewing
pays a heavy penalty for each journal file to interleve. This setting is
turned on now by default, and set to 100.

Also, actully implement what 348ced9097
promised: use whatever we find on disk at startup as lower bound on how
much disk space we can use. That commit introduced some provisions to
implement this, but actually never did.

This also adds "journalctl --vacuum-files=" to vacuum files on disk by
their number explicitly.
2015-10-02 23:21:59 +02:00
Lennart Poettering
0fb398316c journal: use automatic clenup for ACL types 2015-10-02 23:20:51 +02:00
Lennart Poettering
65089b8240 journal: improve some messages
Indicate that we are ignoring errors, when we ignore them, and log that
at LOG_WARNING level.

Use the right error code for the log message.
2015-10-02 23:19:00 +02:00
Lennart Poettering
070052aba3 journal: simplify things by using the LESS_BY() macro 2015-10-02 22:42:13 +02:00
Lennart Poettering
7b5195e274 journal: don't affect atime of journal files when vacuuming
Let's try to use O_NOATIME if we can when vacuuming old journal files,
if we have the permissions for it, so that vacuuming doesn't count as
proper journal read access.
2015-10-02 22:39:24 +02:00
Lennart Poettering
84267e4043 journal: prefer stack allocation 2015-10-02 22:37:53 +02:00
Lennart Poettering
804ae586d4 journal: make journal_file_close() return NULL
The way it is customary everywhere else in our sources.
2015-10-02 22:36:33 +02:00
Lennart Poettering
2e14c544a9 journal: port over to fd_getcrtime_at()
Let's use fd_getcrtime_at(), since that *at() family of calls is how we
read the rest of the file metadata, too.
2015-10-02 22:31:35 +02:00
Beniamino Galvani
6fd255cfaa lldp: add reception tests
Add some tests to simulate the reception of LLDP frames and to verify
the correctness of the data in the MIB.
2015-10-02 17:39:22 +02:00
Beniamino Galvani
29eca2ff89 lldp: fix parsing of TLV length
tlv_packet_read_bytes() and tlv_packet_read_string() returned the
wrong length when called after other functions which modify the offset
in the container.

In other words, if the TLV data length is X and we do a
tlv_packet_read_u8(), a subsequent tlv_packet_read_bytes() should
return a length of (X - 1).
2015-10-02 17:39:22 +02:00
Beniamino Galvani
0037c2dc54 lldp: move lldp_receive_packet() to lldp-internal.c
In order to implement tests for the LLDP state machine, we need to
mock lldp_network_bind_raw_socket(). Move the other function
lldp_receive_packet() to another file so that we can replace the first
function with a custom one and keep the second one.
2015-10-02 17:39:22 +02:00
Beniamino Galvani
564cabd46c lldp: check return value of lldp_tlv_packet_exit_container() 2015-10-02 17:39:22 +02:00
Beniamino Galvani
d8c89d6198 lldp: add support for organizationally specific TLVs
LLDP TLVs of type 127 are used to carry organizationally specific
information and include additional fields to specify the OUI and
subtype.

Add support for parsing such fields and functions to access the most
common IEEE 802.1 specific TLVs.
2015-10-02 17:39:22 +02:00
Beniamino Galvani
11e8357164 lldp: factor out common code in lldp-tlv.c 2015-10-02 17:39:22 +02:00
Beniamino Galvani
4fc6de5df3 lldp: add sd_lldp_tlv_packet_get_destination_type()
It can be useful to know the destination address of a LLDP frame
because it determines the scope of propagation of the frame and thus
this information be used to know whether the neighbor is connected to
the same physical link.

See clause 7.1 of IEEE Std 802.1AB-2009.
2015-10-02 17:39:22 +02:00
Beniamino Galvani
7434883c40 lldp: add public function to export LLDP TLV packets
Add a public function to get a list of current LLDP neighbours' TLV
packets. The function populates an array of pointers to the opaque
type sd_lldp_packet and returns the number of elements found. Callers
must take care of freeing the array and decreasing the refcount of
elements when done.
2015-10-02 17:39:22 +02:00
Beniamino Galvani
b57003ecc3 lldp: move TLV related functions to lldp-tlv.c
Move some public functions from lldp-internal.c to lldp-tlv.c, as now
they are not internal functions anymore.
2015-10-02 17:39:22 +02:00
Beniamino Galvani
176c355b43 lldp: export opaque TLV type and accessor functions
Export struct tlv_packet as a public opaque sd_lldp_packet type and
make its accessor functions public.
2015-10-02 17:39:12 +02:00
Beniamino Galvani
97030a86f0 lldp: change order of arguments of lldp_read_*() functions
These functions are going to be exported, swap the 'data' and 'length'
arguments so that their signature is consistent with the rest of the
code.
2015-10-02 17:11:41 +02:00
Beniamino Galvani
2212d76d08 lldp: add reference counter to struct tlv_packet
Add a reference counter to the tlv_packet structure so that it can be
shared between multiple users and properly free'd when no longer in
use.
2015-10-02 17:11:40 +02:00
Lennart Poettering
df241a67c0 util: rework fgetxattrat_fake() to use O_PATH
That way, we don't ever open the file, thus leave the atime untouched,
and this works even when unprivileged.
2015-10-02 11:44:05 +02:00
Daniel Mack
3c2f5a543d Merge pull request #1439 from poettering/CODING_STYLE
Coding style
2015-10-01 22:58:02 +02:00
Lennart Poettering
2c6c4ab2f5 logind: remove warn_melody() logic
The internal speaker is usually not available on modern latops that
support suspend, and even if it is available in the hardware, most
distributions turned support for it off in the kernel. And even if it is
enabled, it's probably still a bad idea to make use of it for the
suspend-failures. If anything a proper sound should be played.

Long story short, let's remove support of this anachronism.
2015-10-01 21:11:12 +02:00
Lennart Poettering
8ac5aaa9fa update CODING_STYLE with various additions 2015-10-01 21:10:55 +02:00
Kay Sievers
5a6d44ed77 Merge pull request #1428 from franciozzy/tagenhance
Enhance matching of TAG keys
2015-10-01 19:10:06 +02:00
Daniel Mack
e46831f0f1 Merge pull request #1438 from poettering/rfkill-rework
An rfkill rework among other things
2015-10-01 16:35:43 +02:00
Lennart Poettering
8f4cc91472 Merge pull request #1430 from evverx/driver-syslog
journald: add syslog fields for driver messages
2015-10-01 16:29:13 +02:00
Lennart Poettering
91d0d69912 update NEWS 2015-10-01 16:24:04 +02:00
Lennart Poettering
d35c1bb1f4 rfkill: rework and make it listen on /dev/rfkill
With this rework we introduce systemd-rfkill.service as singleton that
is activated via systemd-rfkill.socket that listens on /dev/rfkill. That
way, we get notified each time a new rfkill device shows up or changes
state, in which case we restore and save its current setting to disk.

This is nicer than the previous logic, as this means we save/restore
state even of rfkill devices that are around only intermittently, and
save/restore the state even if the system is shutdown abruptly instead
of cleanly.

This implements what I suggested in #1019 and obsoletes it.
2015-10-01 16:21:09 +02:00
Lennart Poettering
55301ec028 core: add new setting Writable= to ListenSpecial= socket units
Writable= is a new boolean setting. If ture, then ListenSpecial= will
open the specified path in O_RDWR mode, rather than just O_RDONLY.

This is useful for implementing services like rfkill, where /dev/rfkill
is more useful when opened in write mode, if we want to not only save
but also restore its state.
2015-10-01 14:28:13 +02:00
Lennart Poettering
7e9d36e06b systemctl: fix how we decode types and states
There was a bad memory access among other smaller issues.
2015-10-01 14:27:20 +02:00
Lennart Poettering
3d3145100d man: minor wording improvements to USB FunctionFS documentation 2015-10-01 14:26:42 +02:00
Daniel Mack
8b5f9d156c fix typo in NEWS 2015-10-01 13:28:09 +02:00
Daniel Mack
d4e783e44d Merge pull request #1434 from reverendhomer/patch-1
systemctl: fix memory leak in systemctl_parse_argv
2015-10-01 12:16:55 +02:00
Daniel Mack
52dd374765 Merge pull request #1433 from michich/log-errno
tree-wide: add missing errno arguments to log_*_errno()
2015-10-01 12:16:16 +02:00
Michal Schmidt
46b57b6eec udev: fix format string after conversion to log_*_errno()
Use %m where previously %s was used together with strerrno().

Fixes: e53fc357a9 "tree-wide: remove a number of invocations of
       strerror() and replace by %m"
2015-10-01 11:28:40 +02:00
Michal Schmidt
19c2985380 sd-device: fix format strings after conversion to log_*_errno()
Use %m where previously %s was used together with strerrno().

Fixes: e53fc357a9 "tree-wide: remove a number of invocations of
       strerror() and replace by %m"
2015-10-01 11:18:05 +02:00
reverendhomer
bc6c18fef1 systemctl: fix memory leak in systemctl_parse_argv
This commit fixes Coverity #1325228
2015-10-01 12:09:00 +03:00
Michal Schmidt
23446f0148 tree-wide: add missing errno arguments to log_*_errno()
A few of the recent conversions to log_*_errno() were missing the errno
value arguments.

Fixes: e53fc357a9 "tree-wide: remove a number of invocations of
       strerror() and replace by %m"
2015-10-01 11:04:08 +02:00
Daniel Mack
2ce8d6080d Merge pull request #1429 from poettering/dhcp-hostname
DHCP and journal remoting fix, as well as NEWS update
2015-10-01 09:53:15 +02:00
Daniel Mack
e4c46dcede Merge pull request #1427 from dbuch/master
sd-pppoe: use strna() instead of strempty()
2015-10-01 09:46:40 +02:00
Daniel Mack
47c67a5042 Merge pull request #1426 from poettering/log-syntax
logging fixes and more
2015-10-01 09:46:09 +02:00
Evgeny Vereshchagin
b6fa25552e journald: add syslog fields for driver messages 2015-10-01 03:36:11 +03:00
Lennart Poettering
ef08ced6b4 journal: make sure to set MHD_USE_PIPE_FOR_SHUTDOWN for libmicrohttpd servers
This makes sure libmicrohttpd won't call shutdown() on our listening
sockets, which make sure socket activation and re-activation will work
cleanly.

See:

https://github.com/systemd/systemd/pull/1286
https://lists.gnu.org/archive/html/libmicrohttpd/2015-09/msg00014.html

Fixes #1286
2015-09-30 23:59:06 +02:00
Lennart Poettering
e989fd9b67 dhcp: make sure we can deal with a single trailing NUL byte in the hostname
Fixes #1337
2015-09-30 23:35:18 +02:00
Lennart Poettering
fe08a30b58 update NEWS 2015-09-30 23:35:10 +02:00