]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
8 years agoMerge pull request #3160 from htejun/cgroup-fixes-rev2
Zbigniew Jędrzejewski-Szmek [Sat, 7 May 2016 19:08:57 +0000 (15:08 -0400)] 
Merge pull request #3160 from htejun/cgroup-fixes-rev2

Cgroup fixes.

8 years agoMerge pull request #3215 from keszybz/news-and-other-small-cleanups
Lennart Poettering [Sat, 7 May 2016 16:40:57 +0000 (18:40 +0200)] 
Merge pull request #3215 from keszybz/news-and-other-small-cleanups

News and other small cleanups

8 years agoMerge pull request #3191 from poettering/cgroups-agent-dgram
Evgeny Vereshchagin [Sat, 7 May 2016 16:17:44 +0000 (19:17 +0300)] 
Merge pull request #3191 from poettering/cgroups-agent-dgram

core: use an AF_UNIX/SOCK_DGRAM socket for cgroup agent notification

8 years agoNEWS: machinectl and loginctl also support --value 3215/head
Zbigniew Jędrzejewski-Szmek [Sat, 7 May 2016 15:43:39 +0000 (11:43 -0400)] 
NEWS: machinectl and loginctl also support --value

8 years agosystemctl: do not print header if no units will be listed
Zbigniew Jędrzejewski-Szmek [Mon, 25 Apr 2016 01:54:52 +0000 (21:54 -0400)] 
systemctl: do not print header if no units will be listed

"0 units listed." is still printed.

8 years agosystemctl: rewrite code to explicitly take care of n_units==0 case
Zbigniew Jędrzejewski-Szmek [Mon, 25 Apr 2016 01:50:25 +0000 (21:50 -0400)] 
systemctl: rewrite code to explicitly take care of n_units==0 case

Coverity was complaing, but it was a false positive (CID #1354669).
Nevertheless, it's better to rewrite the code so that units is never
null.

8 years agoMerge pull request #3210 from evverx/expose-usec
Evgeny Vereshchagin [Sat, 7 May 2016 14:21:29 +0000 (17:21 +0300)] 
Merge pull request #3210 from evverx/expose-usec

core: expose TriggerLimitIntervalUSec, dump TriggerLimitIntervalSec and TriggerLimitBurst too

8 years agoMerge pull request #3212 from dmedri/master
Lennart Poettering [Sat, 7 May 2016 09:01:36 +0000 (11:01 +0200)] 
Merge pull request #3212 from dmedri/master

Minor fixes and .po updates

8 years agoNEWS: minor fixes 3212/head
Daniele Medri [Sat, 7 May 2016 03:00:12 +0000 (05:00 +0200)] 
NEWS: minor fixes

8 years agoitalian: .po updates
Daniele Medri [Sat, 7 May 2016 02:58:30 +0000 (04:58 +0200)] 
italian: .po updates

8 years agotests: add test for #3171 (#3206)
Evgeny Vereshchagin [Fri, 6 May 2016 21:05:59 +0000 (00:05 +0300)] 
tests: add test for #3171 (#3206)

8 years agocore: dump TriggerLimitIntervalSec and TriggerLimitBurst too 3210/head
Evgeny Vereshchagin [Fri, 6 May 2016 21:03:16 +0000 (21:03 +0000)] 
core: dump TriggerLimitIntervalSec and TriggerLimitBurst too

8 years agocore: expose TriggerLimitIntervalUSec
Evgeny Vereshchagin [Fri, 6 May 2016 20:08:28 +0000 (20:08 +0000)] 
core: expose TriggerLimitIntervalUSec

Before:
$ systemctl show --property TriggerLimitIntervalSec test.socket
TriggerLimitIntervalSec=2000000

After:
$ systemctl show --property TriggerLimitIntervalUSec test.socket
TriggerLimitIntervalUSec=2s

8 years agocore: update the right mtime after finishing writing of transient units (#3203)
Lennart Poettering [Fri, 6 May 2016 16:22:22 +0000 (18:22 +0200)] 
core: update the right mtime after finishing writing of transient units (#3203)

Fixes: #3194
8 years agosystemctl: indentation fix
Lennart Poettering [Fri, 6 May 2016 14:58:01 +0000 (16:58 +0200)] 
systemctl: indentation fix

8 years agoNEWS: bring NEWS a bit up-to-date
Lennart Poettering [Fri, 6 May 2016 14:55:44 +0000 (16:55 +0200)] 
NEWS: bring NEWS a bit up-to-date

8 years agoMerge pull request #3201 from ssahani/net-word
Lennart Poettering [Fri, 6 May 2016 09:57:12 +0000 (11:57 +0200)] 
Merge pull request #3201 from ssahani/net-word

networkd lib: cleanup FOREACH_WORD

8 years agonetworkd: route fix comment 3201/head
Susant Sahani [Fri, 6 May 2016 04:19:49 +0000 (09:49 +0530)] 
networkd: route fix comment

8 years agonetworkd: cleanup FOREACH_WORD
Susant Sahani [Fri, 6 May 2016 04:07:31 +0000 (09:37 +0530)] 
networkd: cleanup FOREACH_WORD

8 years agoMerge pull request #3190 from poettering/logind-fixes
Zbigniew Jędrzejewski-Szmek [Fri, 6 May 2016 00:28:23 +0000 (20:28 -0400)] 
Merge pull request #3190 from poettering/logind-fixes

8 years agoMerge pull request #3198 from poettering/trigger-timeout-defaults
Evgeny Vereshchagin [Thu, 5 May 2016 23:11:11 +0000 (02:11 +0300)] 
Merge pull request #3198 from poettering/trigger-timeout-defaults

change trigger timeout defaults

8 years agologind: drop pointless UINT64_C() macro use 3190/head
Lennart Poettering [Thu, 5 May 2016 20:49:25 +0000 (22:49 +0200)] 
logind: drop pointless UINT64_C() macro use

8 years agologind: enforce a limit on inhibitors we hand out
Lennart Poettering [Wed, 4 May 2016 17:40:05 +0000 (19:40 +0200)] 
logind: enforce a limit on inhibitors we hand out

For similar reasons as the recent addition of a limit on sessions.

Note that we don't enforce a limit on inhibitors per-user currently, but
there's an implicit one, since each inhibitor takes up one fd, and fds are
limited via RLIMIT_NOFILE, and the limit on the number of processes per user.

8 years agologind: expose more configuration settings as bus properties
Lennart Poettering [Wed, 4 May 2016 17:22:30 +0000 (19:22 +0200)] 
logind: expose more configuration settings as bus properties

8 years agologind: don't include session lists in PropertyChanged messages
Lennart Poettering [Wed, 4 May 2016 17:05:18 +0000 (19:05 +0200)] 
logind: don't include session lists in PropertyChanged messages

If we have a lot of simultaneous sessions we really shouldn't send the full
list of active sessions with each PropertyChanged message for user and seat
objects, as that can become quite substantial data, we probably shouldn't dump
on the bus on each login and logout.

Note that the global list of sessions doesn't send out changes like this
either, it only supports requesting the session list with ListSessions().

If cients want to get notified about sessions coming and going they should
subscribe to SessionNew and SessionRemoved signals, and clients generally do
that already.

This is kind of an API break, but then again the fact that this was included
was never documented.

8 years agologind: process session/inhibitor fds at higher priority
Lennart Poettering [Wed, 4 May 2016 17:01:56 +0000 (19:01 +0200)] 
logind: process session/inhibitor fds at higher priority

Let's make sure we process session and inhibitor pipe fds (that signal
sessions/inhibtors going away) at a higher priority
than new bus calls that might create new sessions or inhibitors. This helps
ensuring that the number of open sessions stays minimal.

8 years agoupdate TODO
Lennart Poettering [Wed, 4 May 2016 17:01:46 +0000 (19:01 +0200)] 
update TODO

8 years agologind: enforce a limit on current user sessions
Lennart Poettering [Wed, 4 May 2016 16:57:15 +0000 (18:57 +0200)] 
logind: enforce a limit on current user sessions

We really should put limits on all resources we manage, hence add one to the
number of concurrent sessions, too. This was previously unbounded, hence set a
relatively high limit of 8K by default.

Note that most PAM setups will actually invoke pam_systemd prefixed with "-",
so that the return code of pam_systemd is ignored, and the login attempt
succeeds anyway. On systems like this the session will be created but is not
tracked by systemd.

8 years agoupdate TODO 3198/head
Lennart Poettering [Thu, 5 May 2016 18:51:52 +0000 (20:51 +0200)] 
update TODO

8 years agocore: fix owner user/group output in socket dump
Lennart Poettering [Thu, 5 May 2016 11:45:18 +0000 (13:45 +0200)] 
core: fix owner user/group output in socket dump

The unit file settings are called SocketUser= and SocketGroup= hence name these
fields that way in the "systemd-analyze dump" output too.

https://github.com/systemd/systemd/issues/3171#issuecomment-216216995

8 years agocore: change default trigger limits for socket units
Lennart Poettering [Thu, 5 May 2016 11:39:31 +0000 (13:39 +0200)] 
core: change default trigger limits for socket units

Let's lower the default values a bit, and pick different defaults for
Accept=yes and Accept=no sockets.

Fixes: #3167
8 years agojournald: stack allocation cannot fail 3191/head
Lennart Poettering [Thu, 5 May 2016 20:26:09 +0000 (22:26 +0200)] 
journald: stack allocation cannot fail

No need to check whether alloca() failed...

8 years agotree-wide: introduce new SOCKADDR_UN_LEN() macro, and use it everywhere
Lennart Poettering [Thu, 5 May 2016 20:24:36 +0000 (22:24 +0200)] 
tree-wide: introduce new SOCKADDR_UN_LEN() macro, and use it everywhere

The macro determines the right length of a AF_UNIX "struct sockaddr_un" to pass to
connect() or bind(). It automatically figures out if the socket refers to an
abstract namespace socket, or a socket in the file system, and properly handles
the full length of the path field.

This macro is not only safer, but also simpler to use, than the usual
offsetof() + strlen() logic.

8 years agoMerge pull request #3197 from phomes/networkd-memleak
Zbigniew Jędrzejewski-Szmek [Thu, 5 May 2016 12:08:16 +0000 (08:08 -0400)] 
Merge pull request #3197 from phomes/networkd-memleak

Fixes for memleaks in networkd and test

8 years agotest-networkd-conf: fix memleak 3197/head
Thomas Hindoe Paaboel Andersen [Thu, 5 May 2016 11:22:35 +0000 (13:22 +0200)] 
test-networkd-conf: fix memleak

8 years agonetworkd: fix memleak in config_parse_duid_rawdata
Thomas Hindoe Paaboel Andersen [Thu, 5 May 2016 11:17:09 +0000 (13:17 +0200)] 
networkd: fix memleak in config_parse_duid_rawdata

8 years agocore: use an AF_UNIX/SOCK_DGRAM socket for cgroup agent notification
Lennart Poettering [Wed, 4 May 2016 18:43:23 +0000 (20:43 +0200)] 
core: use an AF_UNIX/SOCK_DGRAM socket for cgroup agent notification

dbus-daemon currently uses a backlog of 30 on its D-bus system bus socket. On
overloaded systems this means that only 30 connections may be queued without
dbus-daemon processing them before further connection attempts fail. Our
cgroups-agent binary so far used D-Bus for its messaging, and hitting this
limit hence may result in us losing cgroup empty messages.

This patch adds a seperate cgroup agent socket of type AF_UNIX/SOCK_DGRAM.
Since sockets of these types need no connection set up, no listen() backlog
applies. Our cgroup-agent binary will hence simply block as long as it can't
enqueue its datagram message, so that we won't lose cgroup empty messages as
likely anymore.

This also rearranges the ordering of the processing of SIGCHLD signals, service
notification messages (sd_notify()...) and the two types of cgroup
notifications (inotify for the unified hierarchy support, and agent for the
classic hierarchy support). We now always process events for these in the
following order:

  1. service notification messages  (SD_EVENT_PRIORITY_NORMAL-7)
  2. SIGCHLD signals (SD_EVENT_PRIORITY_NORMAL-6)
  3. cgroup inotify and cgroup agent (SD_EVENT_PRIORITY_NORMAL-5)

This is because when receiving SIGCHLD we invalidate PID information, which we
need to process the service notification messages which are bound to PIDs.
Hence the order between the first two items. And we want to process SIGCHLD
metadata to detect whether a service is gone, before using cgroup
notifications, to decide when a service is gone, since the former carries more
useful metadata.

Related to this:
https://bugs.freedesktop.org/show_bug.cgi?id=95264
https://github.com/systemd/systemd/issues/1961

8 years agoTrivial network cleanup (#3196)
Thomas H. P. Andersen [Thu, 5 May 2016 09:15:46 +0000 (11:15 +0200)] 
Trivial network cleanup (#3196)

* gitignore: typo fix for test-networkd-conf

* networkd: fix double include

8 years agocore: fix segfault on "systemctl --set-property UNIT BlockIODeviceWeight=WEIGHT" 3160/head
Tejun Heo [Wed, 4 May 2016 21:43:13 +0000 (17:43 -0400)] 
core: fix segfault on "systemctl --set-property UNIT BlockIODeviceWeight=WEIGHT"

bus_append_unit_property_assignment() was missing an argument for
sd_bus_message_append() when processing BlockIODeviceWeight leading to
segfault.  Fix it.

Signed-off-by: Tejun Heo <htejun@fb.com>
8 years agoMerge pull request #3156 from keszybz/duid-settings
Lennart Poettering [Wed, 4 May 2016 09:31:59 +0000 (11:31 +0200)] 
Merge pull request #3156 from keszybz/duid-settings

Rework DUID setting

8 years agotreewide: fix typos (#3187)
Torstein Husebø [Wed, 4 May 2016 09:26:17 +0000 (11:26 +0200)] 
treewide: fix typos (#3187)

8 years agoMerge pull request #3170 from poettering/v230-preparation-fixes
Lennart Poettering [Wed, 4 May 2016 08:46:13 +0000 (10:46 +0200)] 
Merge pull request #3170 from poettering/v230-preparation-fixes

make virtualization detection quieter, rework unit start limit logic, detect unit file drop-in changes correctly, fix autofs state propagation

8 years agotmpfiles: don't set the x bit for volatile system journal when ACL support is enabled...
Franck Bui [Tue, 3 May 2016 23:29:11 +0000 (01:29 +0200)] 
tmpfiles: don't set the x bit for volatile system journal when ACL support is enabled (#3079)

When ACL support is enabled, systemd-tmpfiles-setup service sets the following
ACL entries to the volatile system journal:

   $ getfacl /run/log/journal/*/system.journal
   getfacl: Removing leading '/' from absolute path names
   # file: run/log/journal/xxx/system.journal
   # owner: root
   # group: systemd-journal
   user::rwx
   group::r--
   group:wheel:r-x
   group:adm:r-x
   mask::r-x
   other::---

This patch makes sure that the exec bit is not set anymore for the volatile
system journals.

8 years agoMerge pull request #3185 from NetworkManager/lr/unhappy-trie
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 23:22:22 +0000 (19:22 -0400)] 
Merge pull request #3185 from NetworkManager/lr/unhappy-trie

Fix incorrect string deduplication in udev

8 years agostrbuf: set the proper character when creating new nodes 3185/head
Lubomir Rintel [Tue, 3 May 2016 20:15:49 +0000 (22:15 +0200)] 
strbuf: set the proper character when creating new nodes

Commit 82501b3fc added an early break when a terminal node is found to
incorrect place -- before setting c. This caused trie to be built that
does not correspond to what it points to in buffer, causing incorrect
deduplications:

  # cat /etc/udev/rules.d/99-bug.rules
  ENV{FOO}=="0"
  ENV{xx0}=="BAR"
  ENV{BAZ}=="00"

  # udevadm test
  * RULE /etc/udev/rules.d/99-bug.rules:1, token: 0, count: 2, label: ''
  M ENV match 'FOO' '0'(plain)
  * RULE /etc/udev/rules.d/99-bug.rules:2, token: 2, count: 2, label: ''
  M ENV match 'xx0' 'BAR'(plain)
  * RULE /etc/udev/rules.d/99-bug.rules:3, token: 4, count: 2, label: ''
  M ENV match 'BAZ' 'x0'(plain)
  * END

The addition of "xx0" following "0" will cause a trie like this to be
created:

  c=\0
    c=0 "0"
      c=0 "xx0"  <-- note the c is incorrect here, causing "00" to be
    c=O "FOO"        deduplicated to it
    c=R "BAR"

This in effect caused the usb_modeswitch rule for Huawei modems to never
match and this never be switched to serial mode from mass storage.

8 years agoudev: fix build with DEBUG=1
Lubomir Rintel [Tue, 3 May 2016 20:29:03 +0000 (22:29 +0200)] 
udev: fix build with DEBUG=1

Alternatively, this could perhaps be removed since it was broken for a
long time and noone seemed to care.

But it was helpful for me today.

8 years agoMerge pull request #3183 from crawford/preset-array
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 20:24:09 +0000 (16:24 -0400)] 
Merge pull request #3183 from crawford/preset-array

install: cache the presets before evaluating

8 years agonetworkd: Add support to configure IPv6 preferred lifetime (#3102)
Susant Sahani [Tue, 3 May 2016 19:54:26 +0000 (01:24 +0530)] 
networkd: Add support to configure IPv6 preferred lifetime (#3102)

Closes #2166.

We only allow 0, infinity and forever.
infinity and forever is same.

8 years agoMerge pull request #3132 from ssahani/route-table
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 19:50:21 +0000 (15:50 -0400)] 
Merge pull request #3132 from ssahani/route-table

networkd: add support to set route table

8 years agoMerge pull request #3173 from poettering/dnssec-incapdns-fix
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 18:50:43 +0000 (14:50 -0400)] 
Merge pull request #3173 from poettering/dnssec-incapdns-fix

Dnssec incapdns fix

8 years agoinstall: cache the presets before evaluating 3183/head
Alex Crawford [Thu, 28 Apr 2016 06:59:20 +0000 (23:59 -0700)] 
install: cache the presets before evaluating

The previous implementation traversed the various config directories,
walking the preset files and parsing each line to determine if a service
should be enabled or disabled. It did this for every service which
resulted in many more file operations than neccessary.

This approach parses each of the preset entries into an array which is
then used to check if each service should be enabled or disabled.

8 years agotest-dnssec: drop unused variable
Lennart Poettering [Tue, 12 Apr 2016 11:51:28 +0000 (13:51 +0200)] 
test-dnssec: drop unused variable

(zjs: the tree is now back to 0b2abe0f034f7f2d8654adb11b516d1090ec9a9c.)

8 years agoMerge pull request #2921 from keszybz/do-not-report-masked-units-as-changed
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 18:08:39 +0000 (14:08 -0400)] 
Merge pull request #2921 from keszybz/do-not-report-masked-units-as-changed

8 years agoRevert "Do not report masked units as changed (#2921)"
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 18:08:23 +0000 (14:08 -0400)] 
Revert "Do not report masked units as changed (#2921)"

This reverts commit 6d10d308c6cd16528ef58fa4f5822aef936862d3.

It got squashed by mistake.

8 years agoRevert "test-dnssec: drop unused variable"
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 18:08:16 +0000 (14:08 -0400)] 
Revert "test-dnssec: drop unused variable"

This reverts commit 0bed31c1038c439cc5956fb44017ba28e503095b.

8 years agoMerge pull request #3111 from poettering/nspawn-remove-veth
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 17:49:20 +0000 (13:49 -0400)] 
Merge pull request #3111 from poettering/nspawn-remove-veth

8 years agoRevert "nspawn: explicitly remove veth links after use (#3111)"
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 17:46:40 +0000 (13:46 -0400)] 
Revert "nspawn: explicitly remove veth links after use (#3111)"

This reverts commit d2773e59de3dd970d861e9f996bc48de20ef4314.

Merge got squashed by mistake.

8 years agonetworkd: add support to set route table 3132/head
Susant Sahani [Tue, 3 May 2016 17:48:21 +0000 (23:18 +0530)] 
networkd: add support to set route table

networkd: add support to set route table
1. add support to configure the table id.
   if id is less than 256 we can fit this in the header of route as
   netlink property is a char. But in kernel this proepty is a
   unsigned 32. Hence if greater that 256 add this as RTA_TABLE
attribute.

2. we are not setting the address family now. Now set this property.

8 years agosd-netlink: introduce route attribute set API
Susant Sahani [Tue, 3 May 2016 17:17:48 +0000 (22:47 +0530)] 
sd-netlink: introduce route attribute set API

Introduce
1. sd_rtnl_message_route_set_table to set table ID
2. sd_rtnl_message_route_set_family to set family

Both required to configure route properties.

8 years agosd-netlink: fix sd_netlink_message_append_data
Susant Sahani [Tue, 3 May 2016 17:16:50 +0000 (22:46 +0530)] 
sd-netlink: fix sd_netlink_message_append_data

Also remove the braces add_rtattr not required.

8 years agonetwork: get rid of DUID_TYPE_RAW 3156/head
Zbigniew Jędrzejewski-Szmek [Sun, 1 May 2016 04:59:49 +0000 (00:59 -0400)] 
network: get rid of DUID_TYPE_RAW

It wasn't used for anything after the recent changes.

8 years agoman: add a description of DUIDType and DUIDRawData
Zbigniew Jędrzejewski-Szmek [Sat, 30 Apr 2016 00:16:55 +0000 (20:16 -0400)] 
man: add a description of DUIDType and DUIDRawData

This is essentially a revert of f38e0cce75ff2ffbd99f7e382ed39c160bb7d799 (which
removed the documentation of DUIDType on purpose). The description is heavily
updated for the new semantics.

This addresses #3127 § 4.

8 years agoman: s/similar/similarly/
Zbigniew Jędrzejewski-Szmek [Fri, 29 Apr 2016 23:08:37 +0000 (19:08 -0400)] 
man: s/similar/similarly/

8 years agotest-networkd-conf: add tests for the parsing functions
Zbigniew Jędrzejewski-Szmek [Fri, 29 Apr 2016 22:46:53 +0000 (18:46 -0400)] 
test-networkd-conf: add tests for the parsing functions

8 years agonetworkd: rework duid_{type,duid_type,duid,duid_len} setting
Zbigniew Jędrzejewski-Szmek [Fri, 29 Apr 2016 03:23:45 +0000 (23:23 -0400)] 
networkd: rework duid_{type,duid_type,duid,duid_len} setting

Separate fields are replaced  with a struct.

Second second duid type field is removed. The first field was used to carry
the result of DUIDType= configuration, and the second was either a copy of
this, or contained the type extracted from DuidRawData. The semantics are changed
so that the type specified in DUIDType is always used. DUIDRawData= no longer
overrides the type setting.

The networkd code is now more constrained than the sd-dhcp code:
DUIDRawData cannot have 0 length, length 0 is treated the same as unsetting.
Likewise, it is not possible to set a DUIDType=0. If it ever becomes necessary
to set type=0 or a zero-length duid, the code can be changed to support that.
Nevertheless, I think that's unlikely.

This addresses #3127 § 1 and 3.

v2:
- rename DUID.duid, DUID.duid_len to DUID.raw_data, DUID.raw_data_len

8 years agodh-dhcp{,6}-client: change the semantics of DUID setting
Zbigniew Jędrzejewski-Szmek [Sat, 30 Apr 2016 01:18:11 +0000 (21:18 -0400)] 
dh-dhcp{,6}-client: change the semantics of DUID setting

Both versions of the code are changed to allow the caller to override
DUID using simple rules: duid type and value may be specified, in
which case the caller is responsible to providing the contents,
or just duid type may be specified as DUID_TYPE_EN, in which case we
we fill in the values. In the future more support for other types may
be added, e.g. DUID_TYPE_LLT.

There still remains and ugly discrepancy between dhcp4 and dhcp6 code:
dhcp6 has sd_dhcp6_client_set_duid and sd_dhcp6_client_set_iaid and
requires client->state to be DHCP6_STATE_STOPPED, while dhcp4 has
sd_dhcp_client_set_iaid_duid and will reconfigure the client if it
is not stopped. This commit doesn't touch that part.

This addresses #3127 § 2.

8 years agodhcp-identifier: un-inline dhcp_validate_duid_len
Zbigniew Jędrzejewski-Szmek [Sat, 30 Apr 2016 01:18:02 +0000 (21:18 -0400)] 
dhcp-identifier: un-inline dhcp_validate_duid_len

After all it is used in more than one place and is not that short.
Also tweak the test a bit:
- do not check that duid_len > 0, because we want to allow unknown
  duid types, and there might be some which are fine with 0 length data,
  (also assert should not be called from library code),
- always check that duid_len <= MAX_DUID_LEN, because we could overwrite
  available buffer space otherwise.

8 years agosd-dhcp: change uint8_t *duid to const void*
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 16:08:56 +0000 (12:08 -0400)] 
sd-dhcp: change uint8_t *duid to const void*

8 years agosd-dhcp{,6}-client: use standard indentation for functions args
Zbigniew Jędrzejewski-Szmek [Tue, 3 May 2016 15:52:44 +0000 (11:52 -0400)] 
sd-dhcp{,6}-client: use standard indentation for functions args

8 years agotests: add test for #3166 (#3180)
Evgeny Vereshchagin [Tue, 3 May 2016 09:43:22 +0000 (12:43 +0300)] 
tests: add test for #3166 (#3180)

8 years agoman: rename TriggerLimitIntervalBurst to TriggerLimitBurst (#3181)
Evgeny Vereshchagin [Tue, 3 May 2016 09:33:38 +0000 (12:33 +0300)] 
man: rename TriggerLimitIntervalBurst to TriggerLimitBurst (#3181)

[/etc/systemd/system/test.socket:2] Unknown lvalue 'TriggerLimitIntervalBurst' in section 'Socket'

Follow-up for 8b26cdbd2a94

8 years agolocale: Language fallbacks for fr_(BE|CA|CH|LU) to fr_FR (#3178)
Sylvain Plantefève [Mon, 2 May 2016 23:43:37 +0000 (01:43 +0200)] 
locale: Language fallbacks for fr_(BE|CA|CH|LU) to fr_FR (#3178)

8 years agoMerge pull request #3162 from keszybz/alias-refusal
Lennart Poettering [Mon, 2 May 2016 18:40:54 +0000 (20:40 +0200)] 
Merge pull request #3162 from keszybz/alias-refusal

Refuse Alias, DefaultInstance, templated units in install (as appropriate)

8 years agoMerge pull request #3153 from poettering/async-clone
Zbigniew Jędrzejewski-Szmek [Mon, 2 May 2016 17:56:07 +0000 (13:56 -0400)] 
Merge pull request #3153 from poettering/async-clone

machined: make "clone" asynchronous, and support copy-based fall-back

8 years agoupdate TODO 3173/head
Lennart Poettering [Mon, 2 May 2016 16:35:09 +0000 (18:35 +0200)] 
update TODO

8 years agoresolved: work around broken DNS zones set up by incapdns.net
Lennart Poettering [Mon, 2 May 2016 16:29:28 +0000 (18:29 +0200)] 
resolved: work around broken DNS zones set up by incapdns.net

incapdns.net returns NXDOMAIN for the SOA of the zone itself but is not a
terminal. This is against the specs, but we really should be able to deal with
this.

Previously, when verifying whether an NXDOMAIN response for a SOA/NS lookup is
rightfully unsigned we'd issue a SOA lookup for the parent's domain, to derive
the state from that. If the parent SOA would get an NXDOMAIN, we'd continue
upwards, until we hit a signed top-level domain, which suggests that the domain
actually exists.

With this change whenver we need to authenticate an NXDOMAIN SOA reply, we'll
request the DS RR for the zone first, and use for validation, since that this
must be from the parent's zone, not the incorrect lower zone.

Fixes: #2894
8 years agoautomount: move resetting of expiry timeout to automount_set_state() 3170/head
Lennart Poettering [Mon, 2 May 2016 15:12:35 +0000 (17:12 +0200)] 
automount: move resetting of expiry timeout to automount_set_state()

that way we can be sure that there's no expiry timeout in place at any time
when we aren't in the RUNNING state.

8 years agoautomount: rework propagation between automount and mount units
Lennart Poettering [Mon, 2 May 2016 14:51:45 +0000 (16:51 +0200)] 
automount: rework propagation between automount and mount units

Port the progagation logic to the generic Unit->trigger_notify() callback logic
in the unit vtable, that is called for a unit not only when the triggered unit
of it changes state but also when a job for that unit finishes. This, firstly
allows us to make the code a bit cleaner and more generic, but more
importantly, allows us to notice correctly when a mount job fails, and
propagate that back to autofs client processes.

Fixes: #2181
8 years agocore: don't propagate service state to sockets as long as there's still a job for...
Lennart Poettering [Mon, 2 May 2016 14:41:41 +0000 (16:41 +0200)] 
core: don't propagate service state to sockets as long as there's still a job for the service queued

8 years agofstab-generator: add newline before we start a new unit file section
Lennart Poettering [Mon, 2 May 2016 14:02:02 +0000 (16:02 +0200)] 
fstab-generator: add newline before we start a new unit file section

We already did this for the [Mount] section, let's do the same for [Automount].

8 years agoautomount: add debug message when we get notified about mount state changes
Lennart Poettering [Mon, 2 May 2016 14:01:39 +0000 (16:01 +0200)] 
automount: add debug message when we get notified about mount state changes

8 years agocore: remove duplicate code in automount_update_mount()
Lennart Poettering [Mon, 2 May 2016 14:01:16 +0000 (16:01 +0200)] 
core: remove duplicate code in automount_update_mount()

Also, fix indentation.

8 years agocore: simplify unit_need_daemon_reload() a bit
Lennart Poettering [Mon, 2 May 2016 13:07:40 +0000 (15:07 +0200)] 
core: simplify unit_need_daemon_reload() a bit

And let's make it more accurate: if we have acquire the list of unit drop-ins,
then let's do a full comparison against the old list we already have, and if
things differ in any way, we know we have to reload.

This makes sure we detect changes to drop-in directories in more cases.

8 years agocore: fix detection whether per-unit drop-ins changed
Lennart Poettering [Mon, 2 May 2016 12:50:27 +0000 (14:50 +0200)] 
core: fix detection whether per-unit drop-ins changed

This fixes fall-out from 6d10d308c6cd16528ef58fa4f5822aef936862d3.

Until that commit, do determine whether a daemon reload was required we compare
the mtime of the main unit file we loaded with the mtime of it on disk for
equality, but for drop-ins we only stored the newest mtime of all of them and
then did a "newer-than" comparison. This was brokeni with the above commit,
when all checks where changed to be for equality.

With this change all checks are now done as "newer-than", fixing the drop-in
mtime case. Strictly speaking this will not detect a number of changes that the
code before above commit detected, but given that the mtime is unlikely to go
backwards, and this is just intended to be a helpful hint anyway, this looks OK
in order to keep things simple.

Fixes: #3123
8 years agocore: move enforcement of the start limit into per-unit-type code again
Lennart Poettering [Mon, 2 May 2016 11:01:26 +0000 (13:01 +0200)] 
core: move enforcement of the start limit into per-unit-type code again

Let's move the enforcement of the per-unit start limit from unit.c into the
type-specific files again. For unit types that know a concept of "result" codes
this allows us to hook up the start limit condition to it with an explicit
result code. Also, this makes sure that the state checks in clal like
service_start() may be done before the start limit is checked, as the start
limit really should be checked last, right before everything has been verified
to be in order.

The generic start limit logic is left in unit.c, but the invocation of it is
moved into the per-type files, in the various xyz_start() functions, so that
they may place the check at the right location.

Note that this change drops the enforcement entirely from device, slice, target
and scope units, since these unit types generally may not fail activation, or
may only be activated a single time. This is also documented now.

Note that restores the "start-limit-hit" result code that existed before
6bf0f408e4833152197fb38fb10a9989c89f3a59 already in the service code. However,
it's not introduced for all units that have a result code concept.

Fixes #3166.

8 years agoutil: don't dump /proc/cpuinfo contents in debug info
Lennart Poettering [Mon, 2 May 2016 09:26:40 +0000 (11:26 +0200)] 
util: don't dump /proc/cpuinfo contents in debug info

This is hardly useful, it's trivial for developers to get that info by running
cat /proc/cpuinfo.

Fixes #3155

8 years agoman: slightly extend the machinectl clone documentation 3153/head
Lennart Poettering [Mon, 2 May 2016 09:14:46 +0000 (11:14 +0200)] 
man: slightly extend the machinectl clone documentation

8 years agominor CODING_STYLE clarification
Lennart Poettering [Mon, 2 May 2016 09:14:13 +0000 (11:14 +0200)] 
minor CODING_STYLE clarification

8 years agoupdate TODO
Lennart Poettering [Fri, 29 Apr 2016 18:35:14 +0000 (20:35 +0200)] 
update TODO

8 years agomachinectl: since clone/remove/copy verbs are possibly slow, turn off bus call timeout
Lennart Poettering [Fri, 29 Apr 2016 18:57:39 +0000 (20:57 +0200)] 
machinectl: since clone/remove/copy verbs are possibly slow, turn off bus call timeout

By default we timeout all bus calls, but if we know that these bus calls might
be slow, let's explicitly turn the timeouts off.

8 years agomachined: rework copy-from/copy-to operation to use generic Operation object
Lennart Poettering [Fri, 29 Apr 2016 18:32:56 +0000 (20:32 +0200)] 
machined: rework copy-from/copy-to operation to use generic Operation object

With this all potentially slow operations are done out-of-process,
asynchronously, using the same "Operation" object.

8 years agomachined: also make image removal operation asynchronous
Lennart Poettering [Fri, 29 Apr 2016 18:17:55 +0000 (20:17 +0200)] 
machined: also make image removal operation asynchronous

If we remove a directory image (i.e. not a btrfs snapshot) then things might
get quite expensive, hence run this asynchronous in a forked off process, too.

8 years agomachined: support non-btrfs file systems with "machinectl clone"
Lennart Poettering [Fri, 29 Apr 2016 18:06:20 +0000 (20:06 +0200)] 
machined: support non-btrfs file systems with "machinectl clone"

Fall back to a normal copy operation when the backing file system isn't btrfs,
and hence doesn't support cheap snapshotting. Of course, this will be slow, but
given that the execution is asynchronous now, this should be OK.

Fixes: #1308
8 years agotree-wide: fix invocations of chattr_path()
Lennart Poettering [Fri, 29 Apr 2016 18:05:44 +0000 (20:05 +0200)] 
tree-wide: fix invocations of chattr_path()

chattr_path() takes two bitmasks, and no booleans. Fix the various invocations
to do this properly.

8 years agocopy: adjust directory times after writing to the directory
Lennart Poettering [Fri, 29 Apr 2016 17:44:59 +0000 (19:44 +0200)] 
copy: adjust directory times after writing to the directory

When recursively copying a directory tree, fix up the file times after having
created all contents in it, so that our changes don't end up altering any of
the directory times.

8 years agocopy: return the right error when we can't open a file
Lennart Poettering [Fri, 29 Apr 2016 17:42:07 +0000 (19:42 +0200)] 
copy: return the right error when we can't open a file

8 years agoimage: enable btrfs quotas on the clone destination, not the source
Lennart Poettering [Fri, 29 Apr 2016 17:26:54 +0000 (19:26 +0200)] 
image: enable btrfs quotas on the clone destination, not the source

8 years agoutil: rework sigkill_wait() to not require pid_t pointer
Lennart Poettering [Fri, 29 Apr 2016 17:23:23 +0000 (19:23 +0200)] 
util: rework sigkill_wait() to not require pid_t pointer

Let's make sigkill_wait() take a normal pid_t, and add sigkill_waitp() that
takes a pointer (which is useful for usage in _cleanup_), following the usual
logic we have for this.

8 years agomachined: run clone operation asynchronously in the background
Lennart Poettering [Fri, 29 Apr 2016 17:14:52 +0000 (19:14 +0200)] 
machined: run clone operation asynchronously in the background

Cloning an image can be slow, if the image is not on a btrfs subvolume, hence
let's make sure we do this asynchronously in a child process, so that machined
isn't blocked as long as we process the client request.

This adds a new, generic "Operation" object to machined, that is used to track
these kind of background processes.

This is inspired by the MachineOperation object that already exists to make
copy operations asynchronous. A later patch will rework the MachineOperation
logic to use the generic Operation instead.

8 years agotests: add test for https://github.com/systemd/systemd/issues/2467 (#3168)
Evgeny Vereshchagin [Mon, 2 May 2016 08:57:19 +0000 (11:57 +0300)] 
tests: add test for https://github.com/systemd/systemd/issues/2467 (#3168)