platform/upstream/systemd.git
9 years agocore: simplify fd collection code, return number of fds as return value
Lennart Poettering [Sat, 3 Oct 2015 14:41:36 +0000 (16:41 +0200)]
core: simplify fd collection code, return number of fds as return value

Let's simplify the fd collection code a bit, and return the number of
collected fds as positive integer, the way it's customary in our usual
code.

9 years agosocket: don't double close the same fd for FIFOs
Lennart Poettering [Sat, 3 Oct 2015 14:39:57 +0000 (16:39 +0200)]
socket: don't double close the same fd for FIFOs

9 years agogpt-auto-generator: fix duplicate backing partition check
Lennart Poettering [Sat, 3 Oct 2015 14:38:52 +0000 (16:38 +0200)]
gpt-auto-generator: fix duplicate backing partition check

We shouldn't exit the loop early, otherwise our duplicate backing
partition check won't work.

9 years agoMerge pull request #1462 from lnykryn/analyze-manpage
Tom Gundersen [Mon, 5 Oct 2015 21:25:06 +0000 (23:25 +0200)]
Merge pull request #1462 from lnykryn/analyze-manpage

man: LEVEL in systemd-analyze set-log level is not optional

9 years agoMerge pull request #1406 from blaskovic/journal-remote-typo
Tom Gundersen [Mon, 5 Oct 2015 21:24:09 +0000 (23:24 +0200)]
Merge pull request #1406 from blaskovic/journal-remote-typo

journal-remote: typo in log_error when no sources are specified

[tomegun: this was a pun, but let's not do that]

9 years agoMerge pull request #1448 from bengal/lldp-export-v5
Tom Gundersen [Mon, 5 Oct 2015 21:16:43 +0000 (23:16 +0200)]
Merge pull request #1448 from bengal/lldp-export-v5

LLDP: add API to export neighbors list (v5)

9 years agoMerge pull request #1459 from ssahani/bridge1
Tom Gundersen [Mon, 5 Oct 2015 20:44:38 +0000 (22:44 +0200)]
Merge pull request #1459 from ssahani/bridge1

networkd: add bridge properties

9 years agoMerge pull request #1372 from jemk/prefsrc
Tom Gundersen [Mon, 5 Oct 2015 20:42:44 +0000 (22:42 +0200)]
Merge pull request #1372 from jemk/prefsrc

networkd: add support to configure preferred source of static routes

9 years agoman: LEVEL in systemd-analyze set-log level is not optional
Lukas Nykryn [Mon, 5 Oct 2015 10:19:13 +0000 (12:19 +0200)]
man: LEVEL in systemd-analyze set-log level is not optional

rhbz#1268336

9 years agoMerge pull request #1461 from Danielmachon/patch-1
Daniel Mack [Mon, 5 Oct 2015 09:31:21 +0000 (11:31 +0200)]
Merge pull request #1461 from Danielmachon/patch-1

Update NEWS

9 years agoUpdate NEWS
Daniel Machon [Mon, 5 Oct 2015 09:15:16 +0000 (11:15 +0200)]
Update NEWS

Fixed spelling error: seriban -> serbian

9 years agoNEWS update
Daniel Mack [Mon, 5 Oct 2015 07:47:58 +0000 (09:47 +0200)]
NEWS update

9 years agoman: add man for bridge params
Susant Sahani [Mon, 5 Oct 2015 04:08:32 +0000 (09:38 +0530)]
man: add man for bridge params

9 years agonetworkd: add bridge properties
Susant Sahani [Mon, 5 Oct 2015 04:08:00 +0000 (09:38 +0530)]
networkd: add bridge properties

ForwardDelaySec:   forward delay
HelloTimeSec:      hello time
MaxAgeSec:         maximum message age

for more information see
http://www.tldp.org/HOWTO/BRIDGE-STP-HOWTO/set-up-the-bridge.html

In kernel
br_dev_newlink: does not have the this functionality to set while
creation.
br_changelink: after creation we can change the parameters.

we need to first create then set it the parameters.

Introduce new callback post_create .This should
set the properties after the creation.

9 years agosd-rtnl: introduce new API to set the NL header flags
Susant Sahani [Mon, 5 Oct 2015 04:06:57 +0000 (09:36 +0530)]
sd-rtnl: introduce new API to set the NL header flags

By default we set as NLM_F_CREATE | NLM_F_EXCL in
sd_rtnl_message_new_link
But incase of bridge we need to set NLM_F_REQUEST | NLM_F_ACK.

If NLM_F_EXCL is set then we are unable to set the parameters. As bridge
supports setting properties after creation not during creation.

9 years agosd-rtnl: sd-netlink: add support for bridge NL parametrs
Susant Sahani [Mon, 5 Oct 2015 04:06:05 +0000 (09:36 +0530)]
sd-rtnl: sd-netlink: add support for bridge NL parametrs

Rename rtnl_link_info_data_bridge_types to
rtnl_link_bridge_management_types
as they are of nested types of IFLA_AF_SPEC.

9 years agomissing.h : add bridge params
Susant Sahani [Mon, 5 Oct 2015 04:05:36 +0000 (09:35 +0530)]
missing.h : add bridge params

9 years agoMerge pull request #1457 from martinpitt/master
Kay Sievers [Sun, 4 Oct 2015 18:25:44 +0000 (20:25 +0200)]
Merge pull request #1457 from martinpitt/master

keymap: Add Thinkpad Yoga 12 (2015)

9 years agoMerge pull request #1454 from kostich/master
Lennart Poettering [Sun, 4 Oct 2015 15:34:44 +0000 (18:34 +0300)]
Merge pull request #1454 from kostich/master

po, catalog: added Serbian translation.

9 years agokeymap: Add Thinkpad Yoga 12 (2015)
Martin Pitt [Sun, 4 Oct 2015 12:31:00 +0000 (14:31 +0200)]
keymap: Add Thinkpad Yoga 12 (2015)

Fixes #1440

9 years agopo, catalog: added Serbian translation.
Марко М. Костић (Marko M. Kostić) [Sat, 3 Oct 2015 20:07:29 +0000 (22:07 +0200)]
po, catalog: added Serbian translation.

9 years agoMerge pull request #1450 from evverx/man-journal-fields
Lennart Poettering [Sat, 3 Oct 2015 10:04:47 +0000 (12:04 +0200)]
Merge pull request #1450 from evverx/man-journal-fields

man: systemd.journal-fields: add info about _TRANSPORT=audit

9 years agoman: systemd.journal-fields: add info about _TRANSPORT=audit
Evgeny Vereshchagin [Sat, 3 Oct 2015 02:38:06 +0000 (05:38 +0300)]
man: systemd.journal-fields: add info about _TRANSPORT=audit

9 years agolldp: add reception tests
Beniamino Galvani [Thu, 24 Sep 2015 21:44:59 +0000 (23:44 +0200)]
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.

9 years agolldp: fix parsing of TLV length
Beniamino Galvani [Tue, 29 Sep 2015 15:48:37 +0000 (17:48 +0200)]
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).

9 years agolldp: move lldp_receive_packet() to lldp-internal.c
Beniamino Galvani [Thu, 24 Sep 2015 21:08:22 +0000 (23:08 +0200)]
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.

9 years agolldp: check return value of lldp_tlv_packet_exit_container()
Beniamino Galvani [Fri, 7 Aug 2015 09:17:03 +0000 (11:17 +0200)]
lldp: check return value of lldp_tlv_packet_exit_container()

9 years agolldp: add support for organizationally specific TLVs
Beniamino Galvani [Mon, 27 Jul 2015 21:37:07 +0000 (23:37 +0200)]
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.

9 years agolldp: factor out common code in lldp-tlv.c
Beniamino Galvani [Mon, 27 Jul 2015 16:08:14 +0000 (18:08 +0200)]
lldp: factor out common code in lldp-tlv.c

9 years agolldp: add sd_lldp_tlv_packet_get_destination_type()
Beniamino Galvani [Mon, 27 Jul 2015 16:04:46 +0000 (18:04 +0200)]
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.

9 years agolldp: add public function to export LLDP TLV packets
Beniamino Galvani [Tue, 30 Jun 2015 08:46:01 +0000 (10:46 +0200)]
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.

9 years agolldp: move TLV related functions to lldp-tlv.c
Beniamino Galvani [Tue, 29 Sep 2015 11:48:10 +0000 (13:48 +0200)]
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.

9 years agolldp: export opaque TLV type and accessor functions
Beniamino Galvani [Fri, 10 Jul 2015 16:43:12 +0000 (18:43 +0200)]
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.

9 years agolldp: change order of arguments of lldp_read_*() functions
Beniamino Galvani [Fri, 10 Jul 2015 16:26:06 +0000 (18:26 +0200)]
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.

9 years agolldp: add reference counter to struct tlv_packet
Beniamino Galvani [Sun, 21 Jun 2015 18:27:04 +0000 (20:27 +0200)]
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.

9 years agoMerge pull request #1439 from poettering/CODING_STYLE
Daniel Mack [Thu, 1 Oct 2015 20:58:02 +0000 (22:58 +0200)]
Merge pull request #1439 from poettering/CODING_STYLE

Coding style

9 years agologind: remove warn_melody() logic
Lennart Poettering [Thu, 1 Oct 2015 19:11:12 +0000 (21:11 +0200)]
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.

9 years agoupdate CODING_STYLE with various additions
Lennart Poettering [Thu, 1 Oct 2015 19:10:55 +0000 (21:10 +0200)]
update CODING_STYLE with various additions

9 years agoMerge pull request #1428 from franciozzy/tagenhance
Kay Sievers [Thu, 1 Oct 2015 17:10:06 +0000 (19:10 +0200)]
Merge pull request #1428 from franciozzy/tagenhance

Enhance matching of TAG keys

9 years agoMerge pull request #1438 from poettering/rfkill-rework
Daniel Mack [Thu, 1 Oct 2015 14:35:43 +0000 (16:35 +0200)]
Merge pull request #1438 from poettering/rfkill-rework

An rfkill rework among other things

9 years agoMerge pull request #1430 from evverx/driver-syslog
Lennart Poettering [Thu, 1 Oct 2015 14:29:13 +0000 (16:29 +0200)]
Merge pull request #1430 from evverx/driver-syslog

journald: add syslog fields for driver messages

9 years agoupdate NEWS
Lennart Poettering [Thu, 1 Oct 2015 14:24:04 +0000 (16:24 +0200)]
update NEWS

9 years agorfkill: rework and make it listen on /dev/rfkill
Lennart Poettering [Thu, 1 Oct 2015 12:32:48 +0000 (14:32 +0200)]
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.

9 years agocore: add new setting Writable= to ListenSpecial= socket units
Lennart Poettering [Thu, 1 Oct 2015 12:28:13 +0000 (14:28 +0200)]
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.

9 years agosystemctl: fix how we decode types and states
Lennart Poettering [Thu, 1 Oct 2015 12:27:20 +0000 (14:27 +0200)]
systemctl: fix how we decode types and states

There was a bad memory access among other smaller issues.

9 years agoman: minor wording improvements to USB FunctionFS documentation
Lennart Poettering [Thu, 1 Oct 2015 12:26:42 +0000 (14:26 +0200)]
man: minor wording improvements to USB FunctionFS documentation

9 years agofix typo in NEWS
Daniel Mack [Thu, 1 Oct 2015 11:28:09 +0000 (13:28 +0200)]
fix typo in NEWS

9 years agoMerge pull request #1434 from reverendhomer/patch-1
Daniel Mack [Thu, 1 Oct 2015 10:16:55 +0000 (12:16 +0200)]
Merge pull request #1434 from reverendhomer/patch-1

systemctl: fix memory leak in systemctl_parse_argv

9 years agoMerge pull request #1433 from michich/log-errno
Daniel Mack [Thu, 1 Oct 2015 10:16:16 +0000 (12:16 +0200)]
Merge pull request #1433 from michich/log-errno

tree-wide: add missing errno arguments to log_*_errno()

9 years agoudev: fix format string after conversion to log_*_errno()
Michal Schmidt [Thu, 1 Oct 2015 09:28:40 +0000 (11:28 +0200)]
udev: fix format string after conversion to log_*_errno()

Use %m where previously %s was used together with strerrno().

Fixes: e53fc357a9b "tree-wide: remove a number of invocations of
       strerror() and replace by %m"

9 years agosd-device: fix format strings after conversion to log_*_errno()
Michal Schmidt [Thu, 1 Oct 2015 09:18:05 +0000 (11:18 +0200)]
sd-device: fix format strings after conversion to log_*_errno()

Use %m where previously %s was used together with strerrno().

Fixes: e53fc357a9b "tree-wide: remove a number of invocations of
       strerror() and replace by %m"

9 years agosystemctl: fix memory leak in systemctl_parse_argv
reverendhomer [Thu, 1 Oct 2015 09:09:00 +0000 (12:09 +0300)]
systemctl: fix memory leak in systemctl_parse_argv

This commit fixes Coverity #1325228

9 years agotree-wide: add missing errno arguments to log_*_errno()
Michal Schmidt [Thu, 1 Oct 2015 09:04:08 +0000 (11:04 +0200)]
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: e53fc357a9b "tree-wide: remove a number of invocations of
       strerror() and replace by %m"

9 years agoMerge pull request #1429 from poettering/dhcp-hostname
Daniel Mack [Thu, 1 Oct 2015 07:53:15 +0000 (09:53 +0200)]
Merge pull request #1429 from poettering/dhcp-hostname

DHCP and journal remoting fix, as well as NEWS update

9 years agoMerge pull request #1427 from dbuch/master
Daniel Mack [Thu, 1 Oct 2015 07:46:40 +0000 (09:46 +0200)]
Merge pull request #1427 from dbuch/master

sd-pppoe: use strna() instead of strempty()

9 years agoMerge pull request #1426 from poettering/log-syntax
Daniel Mack [Thu, 1 Oct 2015 07:46:09 +0000 (09:46 +0200)]
Merge pull request #1426 from poettering/log-syntax

logging fixes and more

9 years agojournald: add syslog fields for driver messages
Evgeny Vereshchagin [Thu, 1 Oct 2015 00:36:11 +0000 (03:36 +0300)]
journald: add syslog fields for driver messages

9 years agojournal: make sure to set MHD_USE_PIPE_FOR_SHUTDOWN for libmicrohttpd servers
Lennart Poettering [Wed, 30 Sep 2015 21:49:26 +0000 (23:49 +0200)]
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

9 years agodhcp: make sure we can deal with a single trailing NUL byte in the hostname
Lennart Poettering [Wed, 30 Sep 2015 21:35:18 +0000 (23:35 +0200)]
dhcp: make sure we can deal with a single trailing NUL byte in the hostname

Fixes #1337

9 years agoupdate NEWS
Lennart Poettering [Wed, 30 Sep 2015 21:35:10 +0000 (23:35 +0200)]
update NEWS

9 years agosd-pppoe: use strna() instead of strempty()
Daniel Buch [Wed, 30 Sep 2015 21:16:13 +0000 (23:16 +0200)]
sd-pppoe: use strna() instead of strempty()

In cases where we use for instance. log_debug() with a statement + string
it is better to output (Service-name: N/A) instead of (Service-name: )

9 years agoSupport OP_NOMATCH for TAG key
Felipe Franciosi [Wed, 30 Sep 2015 21:07:16 +0000 (22:07 +0100)]
Support OP_NOMATCH for TAG key

The TAG key can be used in rules for event matching. At the moment, it
does not support inequality tests. This patch enhances the key test to
validate the rule if it does not contain a given TAG (by TAG!="value").

Signed-off-by: Felipe Franciosi <felipe@paradoxo.org>
9 years agoMerge pull request #1425 from kaysievers/wip
Lennart Poettering [Wed, 30 Sep 2015 20:35:58 +0000 (22:35 +0200)]
Merge pull request #1425 from kaysievers/wip

gpt-auto-generator: check fstab for /boot entries

9 years agoMerge pull request #1422 from keszybz/sd-daemon-mq-badf
Lennart Poettering [Wed, 30 Sep 2015 20:33:50 +0000 (22:33 +0200)]
Merge pull request #1422 from keszybz/sd-daemon-mq-badf

sd-daemon: fix return value for sd_is_mq

9 years agoMerge pull request #1419 from keszybz/shell-completion
Lennart Poettering [Wed, 30 Sep 2015 20:32:09 +0000 (22:32 +0200)]
Merge pull request #1419 from keszybz/shell-completion

Shell completion tweaks

9 years agocore: make sure we expose the empty string when we detect no virtualization
Lennart Poettering [Wed, 30 Sep 2015 20:22:03 +0000 (22:22 +0200)]
core: make sure we expose the empty string when we detect no virtualization

On the bus, stick to exposing the empty string as "no virtualization",
instead of none.

Fixes #1423

9 years agotree-wide: remove a number of invocations of strerror() and replace by %m
Lennart Poettering [Wed, 30 Sep 2015 20:16:17 +0000 (22:16 +0200)]
tree-wide: remove a number of invocations of strerror() and replace by %m

Let's clean up our tree a bit, and reduce invocations of the
thread-unsafe strerror() by replacing it with printf()'s %m specifier.

9 years agobasic: split out cpu set specific APIs into cpu-set-util.[ch]
Lennart Poettering [Wed, 30 Sep 2015 19:50:22 +0000 (21:50 +0200)]
basic: split out cpu set specific APIs into cpu-set-util.[ch]

9 years agoconf-parser: make use of DEFINE_PARSER macro to parse mode_t
Lennart Poettering [Wed, 30 Sep 2015 18:28:51 +0000 (20:28 +0200)]
conf-parser: make use of DEFINE_PARSER macro to parse mode_t

Let's unify more code.

Also, rework the macro to accept a trailing semicolon, to make the code
prettier.

9 years agoutil: there cannot be trailing garbage when parsing cpu sets
Lennart Poettering [Wed, 30 Sep 2015 18:19:57 +0000 (20:19 +0200)]
util: there cannot be trailing garbage when parsing cpu sets

extract_first() already skips trailing whitespace, hence no reason to
explicitly check for it.

9 years agoutil: rename parse_cpu_set() to parse_cpu_set_and_warn()
Lennart Poettering [Wed, 30 Sep 2015 18:16:51 +0000 (20:16 +0200)]
util: rename parse_cpu_set() to parse_cpu_set_and_warn()

It's pretty untypical for our parsing functions to log on their own.
Clarify in the name that this one does.

9 years agolog: move log_invalid_utf8() to log.h
Lennart Poettering [Wed, 30 Sep 2015 18:07:24 +0000 (20:07 +0200)]
log: move log_invalid_utf8() to log.h

Also, make sure it follows the same scheme as log_syntax() does in its
behaviour.

9 years agotree-wide: clean up log_syntax() usage
Lennart Poettering [Wed, 30 Sep 2015 16:22:42 +0000 (18:22 +0200)]
tree-wide: clean up log_syntax() usage

- Rely everywhere that we use abs() on the error code passed in anyway,
  thus don't need to explicitly negate what we pass in

- Never attach synthetic error number information to log messages. Only
  log about errors we *receive* with the error number we got there,
  don't log any synthetic error, that don#t even propagate, but just eat
  up.

- Be more careful with attaching exactly the error we get, instead of
  errno or unrelated errors randomly.

- Fix one occasion where the error number and line number got swapped.

- Make sure we never tape over OOM issues, or inability to resolve
  specifiers

9 years agoMerge pull request #1424 from evverx/journalctl-rotate
Lennart Poettering [Wed, 30 Sep 2015 20:25:36 +0000 (22:25 +0200)]
Merge pull request #1424 from evverx/journalctl-rotate

journalctl: add --rotate option

9 years agogpt-auto-generator: check fstab for /boot entries
Kay Sievers [Wed, 30 Sep 2015 20:24:52 +0000 (22:24 +0200)]
gpt-auto-generator: check fstab for /boot entries

We need to prevent the creation of the gpt automount unit, which will not
get overridden by the fstab mount unit.

https://github.com/systemd/systemd/issues/1378

9 years agoman: journalctl: add info about --rotate
Evgeny Vereshchagin [Wed, 30 Sep 2015 20:02:58 +0000 (23:02 +0300)]
man: journalctl: add info about --rotate

9 years agoshell-completion: journalctl: add --rotate
Evgeny Vereshchagin [Wed, 30 Sep 2015 19:58:05 +0000 (22:58 +0300)]
shell-completion: journalctl: add --rotate

9 years agojournalctl: add --rotate option
Evgeny Vereshchagin [Wed, 30 Sep 2015 19:54:58 +0000 (22:54 +0300)]
journalctl: add --rotate option

shortcut for `systemctl kill --kill-who main --signal SIGUSR2 systemd-journald`

9 years agosd-daemon: fix sd_is_mq for non-mq fds
Zbigniew Jędrzejewski-Szmek [Sat, 5 Sep 2015 13:20:15 +0000 (15:20 +0200)]
sd-daemon: fix sd_is_mq for non-mq fds

mq_getattr returns -1/EBADF for file descriptors which are not mq.
But we should return 0 in this case.

We first check that fd is a valid fd, so we can assume that if
mq_getattr returns EBADF, it is simply a non-mq fd. There is a slight
race, but there doesn't seem to be a nice way to fix it.

9 years agoMerge pull request #1421 from keszybz/formatting-fixes
Daniel Mack [Wed, 30 Sep 2015 16:40:57 +0000 (18:40 +0200)]
Merge pull request #1421 from keszybz/formatting-fixes

logind: avoid a dot before parenthesis

9 years agoMerge pull request #1420 from keszybz/doc-updates
Daniel Mack [Wed, 30 Sep 2015 16:37:18 +0000 (18:37 +0200)]
Merge pull request #1420 from keszybz/doc-updates

Doc updates

9 years agosystemctl: do not set variable to be immediately overwritten
Zbigniew Jędrzejewski-Szmek [Wed, 30 Sep 2015 16:33:31 +0000 (12:33 -0400)]
systemctl: do not set variable to be immediately overwritten

9 years agoNEWS: typos
Zbigniew Jędrzejewski-Szmek [Wed, 30 Sep 2015 15:48:33 +0000 (11:48 -0400)]
NEWS: typos

9 years agoman: update description of exit.target
Zbigniew Jędrzejewski-Szmek [Wed, 30 Sep 2015 15:14:32 +0000 (11:14 -0400)]
man: update description of exit.target

exit.target is now used for both system and user sessions,
so remove "on user service manager exit". Also reword that
paragraph: services will be killed before the manager exits,
even if they do not conflict with shutdown target, but we
recommend that they conflict with shutdown target so that
systemd schedules them to be stopped immediately when starting
to exit.

In the first paragraph, containers should be mentioned last,
and the more general systems first.

9 years agologind: avoid a dot before parenthesis
Zbigniew Jędrzejewski-Szmek [Mon, 28 Sep 2015 15:44:28 +0000 (11:44 -0400)]
logind: avoid a dot before parenthesis

systemd-logind[27]: System is rebooting. (Applied kernel updates.)

is changed to

systemd-logind[27]: System is rebooting (Applied kernel updates).

Users should not add a dot in the sentence in --message, i.e. the correct usage is now:
$ systemctl reboot --message "Applied kernel updates"

9 years agoman: add link to kernel docs for net_cls
Zbigniew Jędrzejewski-Szmek [Wed, 30 Sep 2015 14:41:41 +0000 (10:41 -0400)]
man: add link to kernel docs for net_cls

9 years agoman: use "=" when referring to configuration file settings
Zbigniew Jędrzejewski-Szmek [Mon, 28 Sep 2015 15:42:30 +0000 (11:42 -0400)]
man: use "=" when referring to configuration file settings

This convention is almost universal in systemd man pages, and makes
it easier to visually parse the docs.

Also fix some markup along the way.

9 years agoman: add link to functionfs docs
Zbigniew Jędrzejewski-Szmek [Mon, 28 Sep 2015 15:40:25 +0000 (11:40 -0400)]
man: add link to functionfs docs

Also reword some ungainly grammar constructs.

9 years agoMerge pull request #1415 from aakoskin/bootchart-v2
Daniel Mack [Wed, 30 Sep 2015 14:35:49 +0000 (16:35 +0200)]
Merge pull request #1415 from aakoskin/bootchart-v2

[v2] bootchart: don't fail if "model name" is missing from cpuinfo

9 years agoMerge pull request #1418 from poettering/base-fs
Daniel Mack [Wed, 30 Sep 2015 14:01:42 +0000 (16:01 +0200)]
Merge pull request #1418 from poettering/base-fs

base-fs: consider inability to create /root non-fatal

9 years agoMerge pull request #1417 from poettering/nspawn-and-more
Daniel Mack [Wed, 30 Sep 2015 13:55:26 +0000 (15:55 +0200)]
Merge pull request #1417 from poettering/nspawn-and-more

Various fixes, primarily for nspawn, but other stuff too

9 years agobase-fs: consider inability to create /root non-fatal
Lennart Poettering [Wed, 30 Sep 2015 13:50:42 +0000 (15:50 +0200)]
base-fs: consider inability to create /root non-fatal

Fixes #1414

9 years agoMerge pull request #1394 from steelman/fsck-force-reboot
Lennart Poettering [Wed, 30 Sep 2015 13:39:29 +0000 (15:39 +0200)]
Merge pull request #1394 from steelman/fsck-force-reboot

fsck: start reboot.target irreversibly

9 years agoanalyze: add new set-log-target subcommand
Lennart Poettering [Wed, 30 Sep 2015 13:01:01 +0000 (15:01 +0200)]
analyze: add new set-log-target subcommand

We already have the property writable, hence let's add a command to set
it.

9 years agolog: properly return -EINVAL from log_set_max_level_from_string()
Lennart Poettering [Wed, 30 Sep 2015 12:16:40 +0000 (14:16 +0200)]
log: properly return -EINVAL from log_set_max_level_from_string()

If we just return the value we got from log_level_from_string() on
failure we'll return -1, which is not a proper error code.

log_set_target_from_string() did get this right already, hence let's fix
this here too.

9 years agonspawn: mount /sys as tmpfs, and then mount only select subdirs of the real sysfs...
Lennart Poettering [Wed, 30 Sep 2015 11:47:28 +0000 (13:47 +0200)]
nspawn: mount /sys as tmpfs, and then mount only select subdirs of the real sysfs below it

This way we can hide things like /sys/firmware or /sys/hypervisor from
the container, while keeping the device tree around.

While this is a security benefit in itself it also allows us to fix
issue #1277.

Previously we'd mount /sys before creating the user namespace, in order
to be able to mount /sys/fs/cgroup/* beneath it (which resides in it),
which we can only mount outside of the user namespace. To ensure that
the user namespace owns the network namespace we'd set up the network
namespace at the same time as the user namespace. Thus, we'd still see
the /sys/class/net/ from the originating network namespace, even though
we are in our own network namespace now. With this patch, /sys is
mounted before transitioning into the user namespace as tmpfs, so that
we can also mount /sys/fs/cgroup/* into it this early. The directories
such as /sys/class/ are then later added in from the real sysfs from
inside the network and user namespace so that they actually show whatis
available in it.

Fixes #1277

9 years agobootchart: use get_proc_field and PROC_CPUINFO_MODEL
Aaro Koskinen [Wed, 30 Sep 2015 12:57:55 +0000 (15:57 +0300)]
bootchart: use get_proc_field and PROC_CPUINFO_MODEL

Use get_proc_field and PROC_CPUINFO_MODEL to get the CPU type. Also don't
fail if it missing, instead restore the old behaviour and print "Unknown".

Fixes the following error seen with v225 on powerpc:

Unable to read module name from cpuinfo.
Error generating svg file: No such file or directory

9 years agoarchitecture.h: define PROC_CPUINFO_MODEL
Aaro Koskinen [Wed, 30 Sep 2015 12:57:55 +0000 (15:57 +0300)]
architecture.h: define PROC_CPUINFO_MODEL

Define PROC_CPUINFO_MODEL to indicate the CPU model field in /proc/cpuinfo.

9 years agofileio: make get_status_field() more generic
Aaro Koskinen [Wed, 30 Sep 2015 12:57:55 +0000 (15:57 +0300)]
fileio: make get_status_field() more generic

All users of get_status_field() expect the field pattern to occur in
the beginning of a line, and the delimiter is ':'.

Hardcode this into the function, and also skip any whitespace before ':'
to support fields in files like /proc/cpuinfo. Add support for returning
the full field value (currently stops on first whitespace).

Rename the function so it's easier to ensure all callers switch to new
semantics.

9 years agofix typos in NEWS
Daniel Mack [Wed, 30 Sep 2015 12:03:14 +0000 (14:03 +0200)]
fix typos in NEWS