Commit Graph

35810 Commits

Author SHA1 Message Date
Lennart Poettering 68ac147e8d env-util: use strv_contains() where appropriate 2018-10-17 20:51:14 +02:00
Lennart Poettering ee01882f82 man: mention µs 2018-10-17 20:51:14 +02:00
Andreas Henriksson 33eb44fe4a sulogin-shell: Use force if SYSTEMD_SULOGIN_FORCE set
When the root account is locked sulogin will either inform you of
this and not allow you in or if --force is used it will hand
you passwordless root (if using a recent enough version of util-linux).

Not being allowed a shell is ofcourse inconvenient, but at the same
time handing out passwordless root unconditionally is probably not
a good idea everywhere.

This patch thus allows to control which behaviour you want by
setting the SYSTEMD_SULOGIN_FORCE environment variable to true
or false to control the behaviour, eg. via adding this to
'systemctl edit rescue.service' (or emergency.service):

[Service]
Environment=SYSTEMD_SULOGIN_FORCE=1

Distributions who used locked root accounts and want the passwordless
behaviour could thus simply drop in the override file in
/etc/systemd/system/rescue.service.d/override.conf

Fixes: #7115
Addresses: https://bugs.debian.org/802211
2018-10-17 20:30:10 +02:00
Zbigniew Jędrzejewski-Szmek c7adcb1af9 core: do not "warn" about mundane emergency actions
For example in a container we'd log:
Oct 17 17:01:10 rawhide systemd[1]: Started Power-Off.
Oct 17 17:01:10 rawhide systemd[1]: Forcibly powering off: unit succeeded
Oct 17 17:01:10 rawhide systemd[1]: Reached target Power-Off.
Oct 17 17:01:10 rawhide systemd[1]: Shutting down.
and on the console we'd write (in red)
[  !!  ] Forcibly powering off: unit succeeded

This is not useful in any way, and the fact that we're calling an "emergency action"
is an internal implementation detail. Let's log about c-a-d and the watchdog actions
only.
2018-10-17 19:32:09 +02:00
Zbigniew Jędrzejewski-Szmek a400bd8c2a units: allow and use SuccessAction=exit-force in system systemd-exit.service
C.f. 287419c119ef961db487a281162ab037eba70c61: 'systemctl exit 42' can be
used to set an exit value and pulls in exit.target, which pulls in systemd-exit.service,
which calls org.fdo.Manager.Exit, which calls method_exit(), which sets the objective
to MANAGER_EXIT. Allow the same to happen through SuccessAction=exit.

v2: update for 'exit' and 'exit-force'
2018-10-17 19:32:07 +02:00
Zbigniew Jędrzejewski-Szmek afa6206583 units: use SuccessAction=poweroff-force in systemd-poweroff.service
Explicit systemctl calls remain in systemd-halt.service and the system
systemd-exit.service. To convert systemd-halt, we'd need to add
SuccessAction=halt-force. Halting doesn't make much sense, so let's just
leave that is. systemd-exit.service will be converted in the next commit.
2018-10-17 19:31:50 +02:00
Zbigniew Jędrzejewski-Szmek d85515edcf units: use SuccessAction=reboot-force in systemd-reboot.service 2018-10-17 19:31:50 +02:00
Zbigniew Jędrzejewski-Szmek 631c9b7bf2 units: use SuccessAction=exit-force in systemd-exit.service
Fixes #10414.

v2:
- rename .service.in to .service
- rename 'exit' to 'exit-force'
2018-10-17 19:31:50 +02:00
Zbigniew Jędrzejewski-Szmek 1710d4beff core: limit service-watchdogs=no to actual "watchdog" commands
The setting is now only looked at when considering an action for a job timeout
or unit start limit. It is ignored for ctrl-alt-del, SuccessAction, SuccessFailure.

v2: turn the parameter into a flag field
v3: rename Options to Flags
2018-10-17 19:31:50 +02:00
Zbigniew Jędrzejewski-Szmek 3f00d379fa core: allow services with no commands but SuccessAction set 2018-10-17 19:31:50 +02:00
Zbigniew Jędrzejewski-Szmek 469f76f170 core: accept system mode emergency action specifiers with a warning
Before we would only accept those "system" values, so there wasn't other
chocie. Let's provide backwards compatiblity in case somebody made use of
this functionality in user mode.

v2: use 'exit-force' not 'exit'
v3: use error value in log_syntax
2018-10-17 19:31:50 +02:00
Zbigniew Jędrzejewski-Szmek 54fcb6192c core: define "exit" and "exit-force" actions for user units and only accept that
We would accept e.g. FailureAction=reboot-force in user units and then do an
exit in the user manager. Let's be stricter, and define "exit"/"exit-force" as
the only supported actions in user units.

v2:
- rename 'exit' to 'exit-force' and add new 'exit'
- add test for the parsing function
2018-10-17 19:31:49 +02:00
Zbigniew Jędrzejewski-Szmek 454dd6ce7a man: move description of *Action= modes to FailureAction=/SuccessAction=
FailureAction=/SuccessAction= were added later then StartLimitAction=, so it
was easiest to refer to the existing description. But those two settings are
somewhat simpler (they just execute the action unconditionally) while
StartLimitAction= has additional timing and burst parameters, and they are
about to take on a more prominent role, so let's move the description of
allowed values.
2018-10-17 19:28:18 +02:00
Zbigniew Jędrzejewski-Szmek ef5ae8e713 core: consider service with no start command immediately started
The service would always be in state == SERVICE_INACTIVE, but it needs to go
through state == SERVICE_START so that SuccessAction/FailureAction are executed.
2018-10-17 19:28:16 +02:00
Yu Watanabe d86c8a6cdb udev: make sd_device_get_devname() failure non-fatal
As it is just for logging.

Follow-up for eb276e9841.
2018-10-17 18:02:23 +02:00
Lennart Poettering 8aeb1d3176
Merge pull request #10244 from poettering/nofile-bump
bump RLIMIT_NOFILE
2018-10-17 17:59:36 +02:00
Zbigniew Jędrzejewski-Szmek 1bcf3fc6c5 core: return true from cg_is_empty* on ENOENT 2018-10-17 17:49:57 +02:00
Zbigniew Jędrzejewski-Szmek 30538ff10b meson: simplify definition of MEMORY_ACCOUNTING_DEFAULT
Let's just use the simplest form, it doesn't really matter how the define
looks after preprocessing.
2018-10-17 14:54:48 +02:00
Zbigniew Jędrzejewski-Szmek c02b6ee496 meson: define @HIGH_RLIMIT_NOFILE@ and use it everywhere 2018-10-17 14:54:48 +02:00
Lennart Poettering c8884aceef main: introduce a define HIGH_RLIMIT_MEMLOCK similar to HIGH_RLIMIT_NOFILE 2018-10-17 14:40:44 +02:00
Lennart Poettering a8b627aaed main: bump fs.nr_open + fs.max-file to their largest possible values
After discussions with kernel folks, a system with memcg really
shouldn't need extra hard limits on file descriptors anymore, as they
are properly accounted for by memcg anyway. Hence, let's bump these
values to their maximums.

This also adds a build time option to turn thiss off, to cover those
users who do not want to use memcg.
2018-10-17 14:40:39 +02:00
Lennart Poettering 17fd78cb86
Merge pull request #10429 from yuwata/drop-udev-list
udev: replace udev_list by Hashmap
2018-10-17 11:58:02 +02:00
Yu Watanabe 9b5150b63e udev: use Hashmap for storing global properties 2018-10-17 06:50:12 +09:00
Yu Watanabe 29448498c7 udev: use Hashmap for storing PROGRAM or BUILTIN 2018-10-17 06:49:56 +09:00
Yu Watanabe d838e14515 udev: use Hashmap for storing SECLABEL 2018-10-17 06:48:53 +09:00
Zbigniew Jędrzejewski-Szmek f03ec2b180 systemctl: fix typo 2018-10-16 23:03:52 +02:00
Yu Watanabe 66a948605b udevadm-monitor: use sd_event_loop() 2018-10-17 03:31:20 +09:00
Yu Watanabe fb3d8e9f44 udevadm-trigger: use sd_event_loop() 2018-10-17 03:31:20 +09:00
Yu Watanabe c4abe7191a udevadm-info: use strdup() instead of strscpy() 2018-10-17 03:31:20 +09:00
Yu Watanabe c7d942d6ca udevadm-trigger: modernize code a bit 2018-10-17 03:31:20 +09:00
Yu Watanabe f8d596cdfb udevadm-trigger: replace udev_monitor by sd_device_monitor 2018-10-17 03:31:20 +09:00
Yu Watanabe 13aca84769 udevadm-info,trigger: replace udev_device by sd_device 2018-10-17 03:31:20 +09:00
Yu Watanabe a46556f77d udevadm-monitor: replace udev_monitor by sd_device_monitor 2018-10-17 03:31:20 +09:00
Yu Watanabe 13831507ed rfkill: replace udev_monitor by sd_device_monitor 2018-10-17 03:31:20 +09:00
Yu Watanabe eb968396bb login: replace udev_monitor by sd_device_monitor 2018-10-17 03:31:20 +09:00
Yu Watanabe d0955f0091 core: replace udev_monitor by sd_device_monitor 2018-10-17 03:31:20 +09:00
Yu Watanabe d2ebf9527e network: replace udev_monitor by sd_device_monitor 2018-10-17 03:31:20 +09:00
Yu Watanabe e39b4d254d libudev: re-implement udev-monitor by sd_device_monitor 2018-10-17 03:31:20 +09:00
Yu Watanabe b1c097af8d sd-device: introduce sd_device_monitor 2018-10-17 03:30:54 +09:00
Lennart Poettering 5450a37e3c
Merge pull request #10419 from yuwata/fix-prioq
Fix segfault in prioq_remove() with empty Prioq object
2018-10-16 19:56:04 +02:00
Yu Watanabe 90c88092e6 tree-wide: use CMP() macro where applicable
Follow-up for 6dd91b3682.
2018-10-16 19:55:38 +02:00
Ervin Peters e4b4c4d497 hwdb: add Aiptek Hyperpen 12000U (#10424)
Closes #9834.
2018-10-17 02:39:52 +09:00
Yu Watanabe 8da2f9e807
Merge pull request #10412 from poettering/sockaddr-sun-path
various fixes related to struct sockaddr_un handling
2018-10-17 01:25:58 +09:00
Yu Watanabe ea90471a88
Merge pull request #10422 from poettering/network-xml-route-fix
man: systemd.network man page fix
2018-10-17 01:20:12 +09:00
Yu Watanabe 5023c62efd test: add one more test for prioq_remove()
This adds a testcase for e6e637a11a.
2018-10-17 01:18:10 +09:00
Yu Watanabe 0cb3b295ec prioq: use structrued initializer 2018-10-17 01:09:41 +09:00
Yu Watanabe e6e637a11a prioq: fix index range check 2018-10-17 01:09:41 +09:00
Yu Watanabe 9f934223b2 prioq: add one more assertion 2018-10-17 01:08:51 +09:00
Lennart Poettering 6dd91b3682 tree-wide: CMP()ify all the things
Let's employ coccinelle to fix everything up automatically for us.
2018-10-16 17:45:53 +02:00
Michael Biebl f7eed93f15 Set theme jekyll-theme-primer
This theme uses anchorjs to provide mouse-over anchor links.

Closes: #10418
2018-10-16 17:43:54 +02:00