Commit graph

31532 commits

Author SHA1 Message Date
Mike Gilbert 2fa645f1cc meson: don't search PATH for telinit (#7770)
On a typical system running systemd, the telinit in PATH is very likely to be a symlink
to systemctl. Setting TELINIT to this may result in an infinite recursion if telinit is called
and sd_booted() == 0. This may commonly occur in a chroot environment.

Bug: https://bugs.gentoo.org/642724

[zj:
The path was originally hardcoded as "/lib/upstart/telinit", but was made configurable without
changing the default in 4ad61fd180. Then the default was
changed to `/lib/sysvinit/telinit` in abaaabf40a. Then it
started being  autodetected when meson support was added in 
5c23128dab. This patch restores the behaviour that was 
implemented in configure.ac at the time of its removal.]
2018-01-04 13:14:20 +01:00
Lennart Poettering 3046b6db1d
main: don't bother with the return value of invoke_mainloop() (#7802)
We don't use the return value, and we don't have to, as the call already
initializes &ret, which is the one we return as exit code from the
process.

CID#1384230
2018-01-04 12:55:21 +01:00
Lennart Poettering 3282774050
Merge pull request #7801 from keszybz/docs-and-coverity
Docs and coverity
2018-01-04 12:38:27 +01:00
Shawn Landden 7ddc2dc5e6 fix machinectl shell (in machined) (#7785)
4c253ed broke machined
$machinectl shell arch
Failed to get shell PTY: Input/output error

Closes: #7779

v2: do not drop DEATHSIG flag
2018-01-04 12:37:15 +01:00
Zbigniew Jędrzejewski-Szmek 97149f405c core: fix mac_selinux_setup return value check
Introduced in 74da609f0d. CID #1384210.
2018-01-04 11:31:37 +01:00
Zbigniew Jędrzejewski-Szmek 1330648562 core: double free in bus_timer_set_transient_property
Introduced in 3e3c5a4571. CID #1384233.
2018-01-04 11:31:37 +01:00
Zbigniew Jędrzejewski-Szmek 1893972894 run: double free
Introduced in f2b9f2c83e. CID #1384218.
2018-01-04 11:31:30 +01:00
Zbigniew Jędrzejewski-Szmek 85f8fa4dee test-sizeof: also add uid_t
We had gid_t, and pid_t, but not uid_t. Add for completeness.
2018-01-04 11:16:19 +01:00
Zbigniew Jędrzejewski-Szmek 7f8b3d1d32 man: drop --arch from debootstrap invocation
Nowadays people use systemd on many different architectures, so we
shouldn't presuppose that they are using amd64. debootstrap defaults
to the native architecture and this should be good enough.
2018-01-04 11:16:19 +01:00
Patrik Flykt 7ac6c26a22 dhcp6: Fix DHCPv6 client file descriptor and event handling (#7796)
Close DHCPv6 client socket file descriptor when
sd_dhcp6_client_stop() is called and not when client_reset() is
called. If left in client_reset(), any internal temporary stopping
of the DHCPv6 client with client_stop() will call client_reset()
after which the DHCPv6 client will not be able to receive any further
DHCPv6 messages.

Similarly, client_start() needs to enable events for the DHCPv6
socket file descriptor since a call to client_stop() will call
client_reset() which will remove it from the main loop. Events should
be turned off when no DHCPv6 messages are expected.
2018-01-04 11:02:52 +01:00
George G 0ceced3d9a README: EXT4_POSIX_ACL -> EXT4_FS_POSIX_ACL (#7799)
EXT4_POSIX_ACL doesn't exist.
2018-01-04 08:53:44 +01:00
Lennart Poettering 4ab02a0d36
Merge pull request #7793 from rojkov/fix-6456
resolved: fix refcounting DnsScope's conflict_queue
2018-01-03 18:43:14 +01:00
Lennart Poettering fb92330ccc
Merge pull request #7759 from yuwata/dbus-api
DBus-API: add more options in transient units
2018-01-03 18:41:32 +01:00
Lennart Poettering 7f9ac71c76
Merge pull request #7705 from keszybz/redo-linking
Redo linking
2018-01-03 18:37:00 +01:00
Paul Cercueil 04a0ea93cb hwdb: Add accelerometer orientation entry for Teclast X98 Plus II tablet (#7766) 2018-01-03 15:54:06 +01:00
Boucman da933f7dcf fix systemd-analyze time when default.target is not reached (#7764)
Also, better error messages.
2018-01-03 15:52:13 +01:00
Dmitry Rozhkov c1227a1840 resolved: use DNS_ANSWER_FOREACH instead of for 2018-01-03 15:04:20 +02:00
Dmitry Rozhkov cfcc8dcc86 resolved: skip conflict notifications for DNS-SD PTR RRs
Enumerating DNS-SD PTR resource records are a special case and
are supposed to have non-unique keys pointing to services of the
same type running on different hosts. There's no need for them
to be checked for conflicts.

Thus don't check for conflicts such RRs.
2018-01-03 15:04:20 +02:00
Dmitry Rozhkov 432d108c25 resolved: fix refcounting DnsScope's conflict_queue
Refcounting for a RR's key is done separately from refcounting
for the RR itself, but in dns_scope_notify_conflict() we don't
do that. This may lead to a situation when a RR key put in the
conflict_queue hash as a value's key gets freed upon
cache reduction when it's still referenced by the hash.

Thus increase refcount for the key when putting it into the hash
and unreference it upon removing from the hash.

Closes #6456
2018-01-03 15:04:20 +02:00
Zbigniew Jędrzejewski-Szmek 7f1ea2cc94 meson: add a single .h file to shared libs with no sources
Otherwise stuff doesn't build on old Ubuntu with meson-0.42.1-1~xenial.
2018-01-03 12:09:46 +01:00
Zbigniew Jędrzejewski-Szmek 568a4ff8b1 meson: use a convenience lib for shared resolve files
This reduces the man=false meson target count from 1281 to 1253.

--

A fully scientific test:
  git grep _sources, :/*.build|cut -d: -f2|tr -d ' '|sort|uniq -c
reveals that libudev_sources is the only source list now reused twice.  There's
some ugly circular dependency between libudev and libshared, and anyway I'm not
sure if we don't want to use different compilation options (LOG_REALM_…) in
those two cases, so I'm leaving that alone for now.
2018-01-03 12:09:46 +01:00
Zbigniew Jędrzejewski-Szmek 0c06b50662 meson: rename libudev_internal to libudev_static and link into libudev
This reduces the meson man=false target count to 1281.

v2:
- link test-engine with libshared instead of libsystemd_static
Previous version built fine on F27, but fails on F26 with the following error:
/usr/bin/ld: /tmp/ccr8HRGw.ltrans6.ltrans.o: undefined reference to symbol '__start_BUS_ERROR_MAP@@SD_SHARED'
/home/zbyszek/fedora/systemd/systemd-9d5aae75c64f5583a110f03b94816aacc03bbf4d/x86_64-redhat-linux-gnu/src/shared/libsystemd-shared-236.so: error adding symbols: DSO missing from command line

v3:
- add libudev_basic
2018-01-03 12:09:46 +01:00
Zbigniew Jędrzejewski-Szmek 5e3cec87be meson: use a convenience lib for journal user sources
Instead of compiling those files twice, once for libsystemd and once for
libshared, compile once as a static archive and then link into both.
This reduce the meson target for man=no compile to 1291.
2018-01-03 12:09:46 +01:00
Zbigniew Jędrzejewski-Szmek a8e559d4c6 meson: link libsystemd_static in libshared instead of recompiling
This is similar to the great-grandpa commit. This time the number
of meson targets compilation without man is reduced from 1347 to 1302.
2018-01-03 12:09:46 +01:00
Zbigniew Jędrzejewski-Szmek 34e221a58b Move gcrypt-util to basic/
We were including gcrypt-util.[ch] by hand in the few places where it
was used. Create a convenience library to avoid compiling the same
files multiple times.

v2:
- use a separate static library instead of mergin into libbasic
2018-01-03 12:09:45 +01:00
Zbigniew Jędrzejewski-Szmek 2d4ceca8a5 meson: link libbasic and libshared_static into libshared
gcrypt_util_sources had to be moved because otherwise they appeared twice
in libshared.so halfproducts, causing an error.

-fvisibility=default is added to libbasic, libshared_static so that the symbols
appear properly in the exported symbol list in libshared.

The advantage is that files are not compiled twice. When configured with -Dman=false,
the ninja target list is reduced from 1588 to 1347 targets. The difference in compilation
time is small (<10%). I think this is because of -O0 and ccache and multiple cores, and
in different settings the compilation time could be reduced. The main advantage is that
errors and warnings are not reported twice.
2018-01-03 12:09:14 +01:00
Yu Watanabe 681ae88e06 dbus-cgroup: simplify bus_cgroup_set_property() 2018-01-03 02:33:16 +09:00
Yu Watanabe fffbc1dc7f dbus-cgroup: add missing space 2018-01-03 02:33:06 +09:00
Yu Watanabe c0d64e0e3d doc: update TRANSIENT-SETTINGS.md 2018-01-03 02:32:54 +09:00
Yu Watanabe 3d63c7495a bus-unit-util: support more options set to transient unit 2018-01-03 02:32:46 +09:00
Yu Watanabe 0cf6628e54 bus-unit-util: use struct __useless_struct_to_allow_trailing_semicolon__ in DEFINE_BUS_APPEND_PARSE{,_PTR} macro 2018-01-03 02:32:36 +09:00
Yu Watanabe f76e92af1c dbus-path: add Paths= option to set path specs in transient path unit 2018-01-03 02:32:30 +09:00
Yu Watanabe dea700bffd dbus-service: expose *ExitStatus= settings on bus 2018-01-03 02:32:10 +09:00
Mike Gilbert 8481e3e71e basic: detect_vm_cpuid: fix hypervisor detection
The __get_cpuid() function only calls __cpuid() if __get_cpuid_max()
returns a value that is less than or equal to the leaf value.

In QEMU/KVM, I found that the special hypervisor leaf value (0x40000000U)
is always larger than the value retured by __get_cpuid_max().

Avoid this problem by calling the __cpuid() macro directly once we have
checked the hypervisor bit from leaf 1.

Fixes: d31b0033b7
2018-01-02 12:12:57 +01:00
Yu Watanabe d2f056176c dbus-service: support more options in transient service unit 2018-01-02 02:25:13 +09:00
Yu Watanabe 8c3fd5ebdd dbus-socket: simplify bus_socket_set_transient_property() 2018-01-02 02:25:04 +09:00
Yu Watanabe 7e2a3fcc8b dbus-execute: simplify bus_exec_context_set_transient_property() 2018-01-02 02:24:00 +09:00
Yu Watanabe 237f7bcbb7 core: rename bus_exec_command_set_transient_property() to bus_set_transient_exec_command() 2018-01-02 02:23:56 +09:00
Yu Watanabe faa781cfcb dbus-unit: support more options in transient units 2018-01-02 02:23:52 +09:00
Yu Watanabe c075f5fcf8 core: rename dbus property StartLimitIntervalSec= to StartLimitIntervalUSec=
StartLimitIntervalSec= and DefaultStartLimitIntervalSec= are the
last options whose suffix is 'Sec' instead of 'USec'.
All the other option has suffix 'USec'. So, let's rename them.
2018-01-02 02:23:49 +09:00
Yu Watanabe 83606b73f6 nsflags: add namespace_flag_to_string_many_with_check()
The function will be used in later commits.
2018-01-02 02:23:43 +09:00
Yu Watanabe 3e3c5a4571 dbus-timer: add TimersMonotonic= and TimersCalendar= to set timer in transient timer unit
This also obsoletes OnActiveSec= or their friends
2018-01-02 02:23:41 +09:00
Yu Watanabe 0fb0fffa09 dbus-scope: simplify bus_scope_set_transient_property() 2018-01-02 02:23:38 +09:00
Yu Watanabe 886295990b dbus-kill: simplify bus_kill_context_set_transient_property() 2018-01-02 02:23:36 +09:00
Yu Watanabe b3f1d5400b dbus-mount: support more options in transient mount unit 2018-01-02 02:23:32 +09:00
Yu Watanabe 8700fb854d dbus-automount: support more options in transient automount unit 2018-01-02 02:23:30 +09:00
Yu Watanabe d8f37c89a2 condition: introduce condition_takes_path()
The function will be used in later commits.
2018-01-02 02:23:26 +09:00
Yu Watanabe 33d12153da basic: introduce *_to_string_with_check() functions
They are used in later commits.
2018-01-02 02:23:24 +09:00
Yu Watanabe 6f90844fe2 socket-util: introduce parse_socket_address_bind_ipv6_only_or_bool() 2018-01-02 02:23:21 +09:00
Yu Watanabe 8ab3934766 load-fragment: obsolete OnFailureIsolate= 2018-01-02 02:23:17 +09:00