1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-28 11:55:23 +03:00
Commit Graph

32908 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
5008da1ec1 systemd: do not require absolute paths in ExecStart
Absolute paths make everything simple and quick, but sometimes this requirement
can be annoying. A good example is calling 'test', which will be located in
/usr/bin/ or /bin depending on the distro. The need the provide the full path
makes it harder a portable unit file in such cases.

This patch uses a fixed search path (DEFAULT_PATH which was already used as the
default value of $PATH), and if a non-absolute file name is found, it is
immediately resolved to a full path using this search path when the unit is
loaded. After that, everything behaves as if an absolute path was specified. In
particular, the executable must exist when the unit is loaded.
2018-04-16 16:09:46 +02:00
Zbigniew Jędrzejewski-Szmek
f79cd1a9b2 verify: use manager_load_startable_unit_or_warn() to load units for verification
This doesn't change the outcome:
(before)
/home/zbyszek/src/systemd/test/test-execute/exec-basic.service:6: Executable path specifies a directory: /usr/bin/test/
exec-basic.service: Failed to create exec-basic.service/start: Unit exec-basic.service is not loaded properly: Exec format error.
(after)
/home/zbyszek/src/systemd/test/test-execute/exec-basic.service:6: Executable path specifies a directory: /usr/bin/test/
Failed to load file /home/zbyszek/src/systemd/test/test-execute/exec-basic.service: Exec format error

(before)
masked.service: Failed to create masked.service/start: Unit masked.service is masked.
(after)
File /home/zbyszek/src/systemd/test/test-execute/masked.service is masked.

but the failure is immediate and the error messages are more direct.
2018-04-16 16:09:27 +02:00
Zbigniew Jędrzejewski-Szmek
ba412430a9 tests: use manager_load_startable_unit_or_warn() to load units
Doing manager_load_unit() followed by UNIT_VTABLE(unit)->start(unit) would
result in an assertion failure in ->start() if the unit failed to load
properly. Something like this is okey-ish is tests, since the test units are
not expected to fail to load, but the reason for failure is clearer if we
fail immediately.
2018-04-16 16:08:52 +02:00
Zbigniew Jędrzejewski-Szmek
4109ede778 core/manager: split out function to verify that unit is loaded and not masked
No functional change.
2018-04-16 16:07:27 +02:00
Zbigniew Jędrzejewski-Szmek
c0af656c52 test-execute/exec-specifier.service: fix quoting
The lines would cause the whole service to fail to be loaded.
2018-04-12 16:20:02 +02:00
Filipe Brandenburger
edb3ca0d61 test-path: Set umask explicitly (#8616)
Running `test-path` under an umask such as 027 fails with:

  Assertion '(s.st_mode & S_IRWXO) == 0004' failed at ../src/test/test-path.c:247, function test_path_makedirectory_directorymode(). Aborting.

Looking at directory /tmp/test-path_makedirectory, it was indeed created
with mode 0740, applying the umask to the requested 0744.

Set an explicit umask for this test, to ensure reproducible results.
2018-04-04 11:17:19 +02:00
Filipe Brandenburger
add384dd4d units: use systemctl exit to kill the user manager (#8648)
Use `systemctl --user --force exit` to implement the systemd-exit
user service.

This removes our dependence on an external `kill` binary and the
concerns about whether they recognize SIGRTMIN+n by name or what their
interpretation of SIGRTMIN is.

Tested: `systemctl --user start systemd-exit.service` kills the
  `systemd --user` instance for my user.
2018-04-04 11:14:37 +02:00
Feng Sun
709e86f18f fix missed bracket of exec-personality-ppc64le.service (#8650)
Signed-off-by: Neil Sun <neilsun@yunify.com>
2018-04-04 11:10:42 +02:00
Zbigniew Jędrzejewski-Szmek
29ac24d2f4
Merge pull request #8624 from yuwata/fix-8371
bash-completion: fixes for busctl
2018-04-04 09:39:10 +02:00
Filipe Brandenburger
63554ed907 oss-fuzz: Fallback to ninja-build when available (#8641)
The ninja binary is deployed as `ninja-build` in older distros such as
RHEL 7/CentOS 7.  Detect that and use `ninja-build` instead of `ninja`
when it's available.
2018-04-04 09:32:59 +02:00
Evgeny Vereshchagin
68b04721dc
Merge pull request #8643 from poettering/coding-style-fixlets
Trivial CODING_STYLE additions
2018-04-04 02:13:05 +03:00
Lennart Poettering
25ac900ad7 CODING_STYLE: document suggested suffixes to use in documentation 2018-04-03 15:22:26 +02:00
Lennart Poettering
46f8867372 CODING_STYLE: two minor additions 2018-04-03 15:22:26 +02:00
Lennart Poettering
4afbb9004c CODING_STYLE: mention that we ship .editconfig/.vimrc/.dir-locals.el in our repo 2018-04-03 15:22:26 +02:00
Lennart Poettering
53c70a2706 update TODO 2018-04-03 15:22:25 +02:00
Ricardo Salveti de Araujo
2ef5de1bd9 tmpfiles: fix directory removal with force symlink (#8619)
symlink_atomic returns -EISDIR when the target symlink path is a
directory.

Fixes #7447

Signed-off-by: Ricardo Salveti <ricardo@opensourcefoundries.com>
2018-04-03 15:05:11 +02:00
Evgeny Vereshchagin
f6c63f6fc9 core: skip the removal of cgroups in the TEST_RUN_MINIMAL mode (#8622)
When `systemd` is run in the TEST_RUN_MINIMAL mode, it doesn't really
set up cgroups, so it shouldn't try to remove anything.

Closes https://github.com/systemd/systemd/issues/8474.
2018-04-03 15:04:22 +02:00
João Paulo Rechi Vita
cde942f61b dissect: Don't count RPMB and boot partitions (#8609)
Filter-out RPMB partitions and boot partitions from MMC devices when
counting partitions enumerated by the kernel. Also factor out the now
duplicated code into a separate function.

This complement the previous fixes to the problem reported in
https://github.com/systemd/systemd/issues/5806
2018-04-03 14:51:18 +02:00
Lennart Poettering
bd6ae7e6f0
Merge pull request #8628 from jwrdegoede/hwdb-sensors2
Hwdb sensors2
2018-04-03 14:49:39 +02:00
Radostin Stoyanov
fcc7ce4c8e man: machinectl: update fedora exmple URL (#8642) 2018-04-03 12:06:53 +09:00
Alexander Kurtz
61f1196085 coccinelle: fix typo in file name (#8640) 2018-04-02 23:30:26 +09:00
Lennart Poettering
34bfb98ace
Merge pull request #8626 from floppym/initctl
sysvinit-2.89 compatibility fixes
2018-03-31 12:56:58 +02:00
Will Dietz
203690537b generate-af-list.sh: slightly generalize pattern, fix w/musl (#8629)
Accept definitions to other AF_ constants, not just PF_ ones,
such as:

  #define AF_LINUX AF_LOCAL

It may not be necessary to impose any restriction on the
definitions of the macros extracted, but for now
keep most of that requirement but match AF_* as well.
2018-03-31 12:55:45 +02:00
Hans de Goede
86f8fd7141 hwdb: Add accelerometer orientation quirk for the Pipo W4 tablet
Add an accelerometer orientation quirk for the Pipo W4 tablet.
2018-03-30 23:39:29 +02:00
Mike Gilbert
83c76e8c38 systemctl: try opening /run/initctl before /dev/initctl
This ensures compatability with old/new sysvinit.

http://git.savannah.nongnu.org/cgit/sysvinit.git/commit/?id=80dbcf3de3c1b83aeaa713a8fe5b8d35d8649af2
2018-03-30 16:52:14 -04:00
Mike Gilbert
4d8c7c1b3a units: initctl: move the fifo to /run/initctl to match sysvinit
The fifo location was moved in sysvinit-2.89.

http://git.savannah.nongnu.org/cgit/sysvinit.git/commit/?id=80dbcf3de3c1b83aeaa713a8fe5b8d35d8649af2
2018-03-30 16:52:14 -04:00
Hans de Goede
d167ea9886 hwdb: Add accelerometer orientation quirk for the Lenovo Ideapad Miix 310
Add an accelerometer orientation quirk for the Lenovo Ideapad Miix 310.
Note this quirk is limited to the production batches which ship with a
portrait panel, rather then with a landscape panel (recognized by the
different BIOS version these 2 variants use).
2018-03-30 20:00:27 +02:00
Hans de Goede
366b21efed hwdb: Add accelerometer orientation quirk for the MSI S100 2-in-1
Add an accelerometer orientation quirk for the MSI S100 2-in-1.
2018-03-30 17:11:17 +02:00
Hans de Goede
fd2f44a2f9 hwdb: Add accelerometer orientation quirk for the Yours Y8W81 tablet
Add an accelerometer orientation quirk for the Yours Y8W81 8" tablet.

For future reference: this tablet has the same case and mostly the same
internals as the Chuwi Vi8. Both seem to be from an ODM called inet-tek.
Both are labelled: "INET-I86M-REVxx" on the PCB, with the Chuwi Vi8 being
REV03 (and having a ALC5640 audio codec) and the Yours Y8W81 being REV21
(and having a ALC5651 audio codec).
2018-03-30 17:11:17 +02:00
Hans de Goede
03994fa227 hwdb: Add accelerometer orientation entry for the I.T.Works TW701 tablet
Add accelerometer orientation entry for the I.T.Works TW701 7"
windows tablet, note this is the same hardware/PCB as the Trekstor
ST70416-6 for which we already have the same quirk.
2018-03-30 17:11:17 +02:00
Hans de Goede
839e7ac2de hwdb: 60-sensors: Fix alphabetic sorting by vendor name
The Cytrix entry was added at the end instead of sorted alphabetically
by vendor name.
2018-03-30 17:10:51 +02:00
Yu Watanabe
7f9c3ecad8 bash-completion: busctl: make variables local 2018-03-30 17:13:52 +09:00
Yu Watanabe
4cbb7c500a bash-completion: busctl: do not suggest "-" for signature
Fixes #8371.
2018-03-30 17:08:14 +09:00
Yu Watanabe
1e58b1dc40 bash-completion: busctl: suggests only writable properties for set-property 2018-03-30 17:06:50 +09:00
Yu Watanabe
3e85ec0721 timesync: on network event do not establish connection when NTP servers are not changed (#8611)
Fixes #8603.
2018-03-29 16:15:56 +02:00
Zbigniew Jędrzejewski-Szmek
56fbd7187a sd-bus: allow description to be set for system/user busses (#8594)
sd_bus_open/sd_bus_open_system/sd_bus_open_user are convenient, but
don't allow the description to be set. After they return, the bus is
is already started, and sd_bus_set_description() fails with -EBUSY.
It would be possible to allow sd_bus_set_description() to update the
description "live", but messages are already emitted from sd_bus_open
functions, so it's better to allow the description to be set in
sd_bus_open/sd_bus_open_system/sd_bus_open_user.

Fixes message like:
Bus n/a: changing state UNSET → OPENING
2018-03-29 16:14:11 +02:00
Yu Watanabe
c75436067f tree-wide: remove unused variables (#8612) 2018-03-29 12:50:50 +02:00
Zbigniew Jędrzejewski-Szmek
3d5b4aaad3
Merge pull request #8606 from dell/rename-suspend-to-hibernate
Rename suspend-to-hibernate to suspend-then-hibernate
2018-03-29 12:30:18 +02:00
Yu Watanabe
984b9c8cfe
Merge pull request #8607 from poettering/trivialities2
tiny, trivial, unrelated fixes
2018-03-29 13:24:11 +09:00
Evgeny Vereshchagin
053edc5b04 tests: run udevadm settle after sfdisk (#8610)
This makes the script wait for the newly created partition to
show up before trying to put a filesystem on it, which should
prevent the tests from failing with the following error:
```
New situation:
Disklabel type: dos
Disk identifier: 0x3541a0ec

Device       Boot  Start    End Sectors  Size Id Type
/dev/loop6p1        2048 800767  798720  390M 83 Linux
/dev/loop6p2      800768 819199   18432    9M 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
The file /dev/loop6p1 does not exist and no size was specified.
make: *** [setup] Error 1
F: Failed to mkfs -t ext4
Makefile:4: recipe for target 'setup' failed
```
2018-03-29 13:20:57 +09:00
Mario Limonciello
ca037d1e08 Fix description on suspend-then-hibernate units.
Suspend; Idle into hibernate didn't make sense.
2018-03-28 15:26:18 -05:00
Mario Limonciello
e68c79db91 Rename suspend-to-hibernate to suspend-then-hibernate
Per some discussion with Gnome folks, they would prefer this name
as it's more descriptive of what's happening.
2018-03-28 15:11:10 -05:00
Lennart Poettering
771b7ead84 machine-image,mount-setup: minor coding style fixes 2018-03-28 22:04:58 +02:00
Lennart Poettering
39e4f5bc7b man: remove spurious 'system' 2018-03-28 22:04:58 +02:00
Lennart Poettering
4c0e48f9d7 inhibit: make use of EXIT_SUCCESS where appropriate 2018-03-28 22:04:58 +02:00
Lennart Poettering
2901f4b31f util: check for overflows in xbsearch_r() 2018-03-28 22:04:58 +02:00
Lennart Poettering
cf852ff63b journald: make use of fd_get_path() where appropriate 2018-03-28 22:04:58 +02:00
Lennart Poettering
d9b50610e4 update TODO 2018-03-28 22:03:34 +02:00
Lennart Poettering
fda8a89046 CODING_STYLE: document why O_NONBLOCK makes sense when opening regular files, too 2018-03-28 22:03:34 +02:00
Christian Hesse
106f12a08f systemd-inhibit: ignore signal interrupt from keyboard (#8569)
By default both processes, systemd-inhibit and the forked one, receive
the signals. Pressing Ctrl+C on the keyboard results in SIGINT being
sent to the processes, followed by SIGTERM being sent to the forked
process when systemd-inhibit exits. This can cause trouble when the
forked process does not clean up properly but exit immediately.

Instead make systemd-inhibit ignore SIGINT, leaving it to the forked
process to clean up and exit.
2018-03-28 21:58:10 +02:00