]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agoenv-util: rework strv_env_merge()
Lennart Poettering [Wed, 17 Oct 2018 18:10:09 +0000 (20:10 +0200)] 
env-util: rework strv_env_merge()

Let's clean up the failure codepaths, by using _cleanup_.

This relies on the new behaviour of env_append() introduced in the
previous commit that guarantess the list always remains properly NULL
terminated

5 years agoenv-util: rework env_append()
Lennart Poettering [Wed, 17 Oct 2018 18:08:42 +0000 (20:08 +0200)] 
env-util: rework env_append()

Let's make sure the strv we are putting together always remains valid
(i.e. is NULL terminated). Also document the parameters to pass in
correctly.

5 years agoenv-util: use strv_contains() where appropriate
Lennart Poettering [Wed, 17 Oct 2018 12:41:14 +0000 (14:41 +0200)] 
env-util: use strv_contains() where appropriate

5 years agoman: mention µs
Lennart Poettering [Wed, 17 Oct 2018 13:58:25 +0000 (15:58 +0200)] 
man: mention µs

5 years agosulogin-shell: Use force if SYSTEMD_SULOGIN_FORCE set
Andreas Henriksson [Sun, 14 Oct 2018 12:53:09 +0000 (14:53 +0200)] 
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

5 years agocore: do not "warn" about mundane emergency actions 10428/head
Zbigniew Jędrzejewski-Szmek [Wed, 17 Oct 2018 15:27:20 +0000 (17:27 +0200)] 
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.

5 years agounits: allow and use SuccessAction=exit-force in system systemd-exit.service
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 14:34:45 +0000 (16:34 +0200)] 
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'

5 years agounits: use SuccessAction=poweroff-force in systemd-poweroff.service
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 13:34:57 +0000 (15:34 +0200)] 
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.

5 years agounits: use SuccessAction=reboot-force in systemd-reboot.service
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 13:30:53 +0000 (15:30 +0200)] 
units: use SuccessAction=reboot-force in systemd-reboot.service

5 years agounits: use SuccessAction=exit-force in systemd-exit.service
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 13:09:11 +0000 (15:09 +0200)] 
units: use SuccessAction=exit-force in systemd-exit.service

Fixes #10414.

v2:
- rename .service.in to .service
- rename 'exit' to 'exit-force'

5 years agocore: limit service-watchdogs=no to actual "watchdog" commands
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 13:24:44 +0000 (15:24 +0200)] 
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

5 years agocore: allow services with no commands but SuccessAction set
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 13:07:42 +0000 (15:07 +0200)] 
core: allow services with no commands but SuccessAction set

5 years agocore: accept system mode emergency action specifiers with a warning
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 12:49:36 +0000 (14:49 +0200)] 
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

5 years agocore: define "exit" and "exit-force" actions for user units and only accept that
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 11:28:39 +0000 (13:28 +0200)] 
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

5 years agoman: move description of *Action= modes to FailureAction=/SuccessAction=
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 13:56:35 +0000 (15:56 +0200)] 
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.

5 years agocore: consider service with no start command immediately started
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 20:45:34 +0000 (22:45 +0200)] 
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.

5 years agoudev: make sd_device_get_devname() failure non-fatal
Yu Watanabe [Tue, 16 Oct 2018 19:04:35 +0000 (04:04 +0900)] 
udev: make sd_device_get_devname() failure non-fatal

As it is just for logging.

Follow-up for eb276e98419af59d4a587f2dd37e0b923e4c6fd2.

5 years agoMerge pull request #10244 from poettering/nofile-bump
Lennart Poettering [Wed, 17 Oct 2018 15:59:36 +0000 (17:59 +0200)] 
Merge pull request #10244 from poettering/nofile-bump

bump RLIMIT_NOFILE

5 years agocore: return true from cg_is_empty* on ENOENT
Zbigniew Jędrzejewski-Szmek [Wed, 17 Oct 2018 15:48:35 +0000 (17:48 +0200)] 
core: return true from cg_is_empty* on ENOENT

5 years agomeson: simplify definition of MEMORY_ACCOUNTING_DEFAULT 10244/head
Zbigniew Jędrzejewski-Szmek [Wed, 17 Oct 2018 12:36:09 +0000 (14:36 +0200)] 
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.

5 years agomeson: define @HIGH_RLIMIT_NOFILE@ and use it everywhere
Zbigniew Jędrzejewski-Szmek [Wed, 17 Oct 2018 08:21:48 +0000 (10:21 +0200)] 
meson: define @HIGH_RLIMIT_NOFILE@ and use it everywhere

5 years agomain: introduce a define HIGH_RLIMIT_MEMLOCK similar to HIGH_RLIMIT_NOFILE
Lennart Poettering [Thu, 11 Oct 2018 16:31:11 +0000 (18:31 +0200)] 
main: introduce a define HIGH_RLIMIT_MEMLOCK similar to HIGH_RLIMIT_NOFILE

5 years agomain: bump fs.nr_open + fs.max-file to their largest possible values
Lennart Poettering [Thu, 11 Oct 2018 16:23:26 +0000 (18:23 +0200)] 
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.

5 years agoMerge pull request #10429 from yuwata/drop-udev-list
Lennart Poettering [Wed, 17 Oct 2018 09:58:02 +0000 (11:58 +0200)] 
Merge pull request #10429 from yuwata/drop-udev-list

udev: replace udev_list by Hashmap

5 years agoudev: use Hashmap for storing global properties 10429/head
Yu Watanabe [Tue, 16 Oct 2018 21:47:16 +0000 (06:47 +0900)] 
udev: use Hashmap for storing global properties

5 years agoudev: use Hashmap for storing PROGRAM or BUILTIN
Yu Watanabe [Tue, 16 Oct 2018 21:11:33 +0000 (06:11 +0900)] 
udev: use Hashmap for storing PROGRAM or BUILTIN

5 years agoudev: use Hashmap for storing SECLABEL
Yu Watanabe [Tue, 16 Oct 2018 20:37:34 +0000 (05:37 +0900)] 
udev: use Hashmap for storing SECLABEL

5 years agosystemctl: fix typo
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 08:38:19 +0000 (10:38 +0200)] 
systemctl: fix typo

5 years agoudevadm-monitor: use sd_event_loop() 10239/head
Yu Watanabe [Tue, 9 Oct 2018 07:02:53 +0000 (16:02 +0900)] 
udevadm-monitor: use sd_event_loop()

5 years agoudevadm-trigger: use sd_event_loop()
Yu Watanabe [Tue, 9 Oct 2018 06:35:56 +0000 (15:35 +0900)] 
udevadm-trigger: use sd_event_loop()

5 years agoudevadm-info: use strdup() instead of strscpy()
Yu Watanabe [Tue, 2 Oct 2018 07:23:50 +0000 (16:23 +0900)] 
udevadm-info: use strdup() instead of strscpy()

5 years agoudevadm-trigger: modernize code a bit
Yu Watanabe [Tue, 2 Oct 2018 07:11:54 +0000 (16:11 +0900)] 
udevadm-trigger: modernize code a bit

5 years agoudevadm-trigger: replace udev_monitor by sd_device_monitor
Yu Watanabe [Tue, 2 Oct 2018 07:10:39 +0000 (16:10 +0900)] 
udevadm-trigger: replace udev_monitor by sd_device_monitor

5 years agoudevadm-info,trigger: replace udev_device by sd_device
Yu Watanabe [Wed, 29 Aug 2018 08:28:05 +0000 (17:28 +0900)] 
udevadm-info,trigger: replace udev_device by sd_device

5 years agoudevadm-monitor: replace udev_monitor by sd_device_monitor
Yu Watanabe [Mon, 8 Oct 2018 13:49:44 +0000 (22:49 +0900)] 
udevadm-monitor: replace udev_monitor by sd_device_monitor

5 years agorfkill: replace udev_monitor by sd_device_monitor
Yu Watanabe [Mon, 8 Oct 2018 13:48:36 +0000 (22:48 +0900)] 
rfkill: replace udev_monitor by sd_device_monitor

5 years agologin: replace udev_monitor by sd_device_monitor
Yu Watanabe [Mon, 8 Oct 2018 13:47:53 +0000 (22:47 +0900)] 
login: replace udev_monitor by sd_device_monitor

5 years agocore: replace udev_monitor by sd_device_monitor
Yu Watanabe [Mon, 8 Oct 2018 13:47:29 +0000 (22:47 +0900)] 
core: replace udev_monitor by sd_device_monitor

5 years agonetwork: replace udev_monitor by sd_device_monitor
Yu Watanabe [Mon, 8 Oct 2018 13:47:10 +0000 (22:47 +0900)] 
network: replace udev_monitor by sd_device_monitor

5 years agolibudev: re-implement udev-monitor by sd_device_monitor
Yu Watanabe [Mon, 8 Oct 2018 13:46:31 +0000 (22:46 +0900)] 
libudev: re-implement udev-monitor by sd_device_monitor

5 years agosd-device: introduce sd_device_monitor
Yu Watanabe [Mon, 8 Oct 2018 13:45:52 +0000 (22:45 +0900)] 
sd-device: introduce sd_device_monitor

5 years agoMerge pull request #10419 from yuwata/fix-prioq
Lennart Poettering [Tue, 16 Oct 2018 17:56:04 +0000 (19:56 +0200)] 
Merge pull request #10419 from yuwata/fix-prioq

Fix segfault in prioq_remove() with empty Prioq object

5 years agotree-wide: use CMP() macro where applicable
Yu Watanabe [Tue, 16 Oct 2018 15:55:30 +0000 (00:55 +0900)] 
tree-wide: use CMP() macro where applicable

Follow-up for 6dd91b368298e3b3b264a5f2cb5647b2c5cb692b.

5 years agohwdb: add Aiptek Hyperpen 12000U (#10424)
Ervin Peters [Tue, 16 Oct 2018 17:39:52 +0000 (19:39 +0200)] 
hwdb: add Aiptek Hyperpen 12000U (#10424)

Closes #9834.

5 years agoMerge pull request #10412 from poettering/sockaddr-sun-path
Yu Watanabe [Tue, 16 Oct 2018 16:25:58 +0000 (01:25 +0900)] 
Merge pull request #10412 from poettering/sockaddr-sun-path

various fixes related to struct sockaddr_un handling

5 years agoMerge pull request #10422 from poettering/network-xml-route-fix
Yu Watanabe [Tue, 16 Oct 2018 16:20:12 +0000 (01:20 +0900)] 
Merge pull request #10422 from poettering/network-xml-route-fix

man: systemd.network man page fix

5 years agotest: add one more test for prioq_remove() 10419/head
Yu Watanabe [Tue, 16 Oct 2018 16:18:05 +0000 (01:18 +0900)] 
test: add one more test for prioq_remove()

This adds a testcase for e6e637a11a6c62eff31d36f5fc4b49c2a10c7ea8.

5 years agoprioq: use structrued initializer
Yu Watanabe [Tue, 16 Oct 2018 15:47:50 +0000 (00:47 +0900)] 
prioq: use structrued initializer

5 years agoprioq: fix index range check
Yu Watanabe [Tue, 16 Oct 2018 15:38:52 +0000 (00:38 +0900)] 
prioq: fix index range check

5 years agoprioq: add one more assertion
Yu Watanabe [Tue, 16 Oct 2018 14:35:22 +0000 (23:35 +0900)] 
prioq: add one more assertion

5 years agotree-wide: CMP()ify all the things
Lennart Poettering [Tue, 16 Oct 2018 13:57:40 +0000 (15:57 +0200)] 
tree-wide: CMP()ify all the things

Let's employ coccinelle to fix everything up automatically for us.

5 years agoSet theme jekyll-theme-primer
Michael Biebl [Tue, 16 Oct 2018 15:11:46 +0000 (17:11 +0200)] 
Set theme jekyll-theme-primer

This theme uses anchorjs to provide mouse-over anchor links.

Closes: #10418
5 years agoman: fix spurious uppercasing 10422/head
Lennart Poettering [Tue, 16 Oct 2018 15:19:23 +0000 (17:19 +0200)] 
man: fix spurious uppercasing

5 years agoman: an attempt to reword the [Route] Type= man page
Lennart Poettering [Tue, 16 Oct 2018 15:18:30 +0000 (17:18 +0200)] 
man: an attempt to reword the [Route] Type= man page

A follow-up for #10388.

5 years agonetworkd: type support for "throw" in [Route] section
Hui Yiqun [Sat, 13 Oct 2018 06:01:47 +0000 (14:01 +0800)] 
networkd: type support for "throw" in [Route] section

5 years agosd-boot: factor out searching for loader entry 10174/head
Lennart Poettering [Mon, 25 Jun 2018 16:44:55 +0000 (18:44 +0200)] 
sd-boot: factor out searching for loader entry

5 years agosd-boot: also set an ID for the reboot-into-firmware entry
Lennart Poettering [Mon, 25 Jun 2018 16:36:40 +0000 (18:36 +0200)] 
sd-boot: also set an ID for the reboot-into-firmware entry

5 years agosd-boot: write the IDs of all discovered entries to an EFI variable
Lennart Poettering [Mon, 25 Jun 2018 16:19:09 +0000 (18:19 +0200)] 
sd-boot: write the IDs of all discovered entries to an EFI variable

This is primarily useful for debugging, but can be useful for other
purposes too. For example userspace could check whether "auto-windows"
is included in the list, before triggering a boot-into-windows
operation.

5 years agoefi: make efivar_set_raw() buffer argument VOID*
Lennart Poettering [Mon, 25 Jun 2018 16:18:20 +0000 (18:18 +0200)] 
efi: make efivar_set_raw() buffer argument VOID*

No need to define a type if it is just some arbitrary buffer for us
anyway.

5 years agosd-boot: add boot counting mechanism
Lennart Poettering [Wed, 20 Jun 2018 16:25:01 +0000 (18:25 +0200)] 
sd-boot: add boot counting mechanism

5 years agosd-boot: coding style fix, don't rely on C's downgrade-to-bool feature for numerical...
Lennart Poettering [Thu, 21 Jun 2018 16:51:14 +0000 (18:51 +0200)] 
sd-boot: coding style fix, don't rely on C's downgrade-to-bool feature for numerical values

5 years agosd-boot: remove left-over lgpl blurb
Lennart Poettering [Thu, 21 Jun 2018 09:25:46 +0000 (11:25 +0200)] 
sd-boot: remove left-over lgpl blurb

5 years agosd-boot: simplify memory management in processing of unified kernel image a bit
Lennart Poettering [Wed, 20 Jun 2018 21:32:21 +0000 (23:32 +0200)] 
sd-boot: simplify memory management in processing of unified kernel image a bit

5 years agosd-boot: properly free all config entry fields
Lennart Poettering [Wed, 20 Jun 2018 21:20:47 +0000 (23:20 +0200)] 
sd-boot: properly free all config entry fields

5 years agosd-boot: rename ConfigEntry field 'file' to 'id'
Lennart Poettering [Wed, 20 Jun 2018 16:49:10 +0000 (18:49 +0200)] 
sd-boot: rename ConfigEntry field 'file' to 'id'

The field derives from a file name only in very specific cases, for
many cases it's a fixed string (for example, all "auto-" items are like
this). Also, even when it derives from a file name, it is processed a
bit, as suffixes are removed and the string is converted to lower case.

hence, let's name this field "id" instead, because that's what it is
used for: as general identification token.

5 years agosd-boot: break overly long function argument lists following our usual coding style
Lennart Poettering [Wed, 20 Jun 2018 16:45:58 +0000 (18:45 +0200)] 
sd-boot: break overly long function argument lists following our usual coding style

5 years agosd-boot: drop initialization of 'line' which we override in the next line anyway
Lennart Poettering [Wed, 20 Jun 2018 16:25:19 +0000 (18:25 +0200)] 
sd-boot: drop initialization of 'line' which we override in the next line anyway

5 years agoefi: explicity check for NULL in FreePoolp()
Lennart Poettering [Thu, 21 Jun 2018 16:48:21 +0000 (18:48 +0200)] 
efi: explicity check for NULL in FreePoolp()

Firmware implementations are generally pretty bad, hence let's better
add an explicit check for NULL before invokin FreePool(), in particular
is it doesn't appear to be documented whether FreePool() is supposed to
be happy with NULL.

5 years agoefi: add cleanup handler for closing file descriptors
Lennart Poettering [Thu, 21 Jun 2018 16:50:07 +0000 (18:50 +0200)] 
efi: add cleanup handler for closing file descriptors

5 years agoefi: add poor man's offsetof() implementation
Lennart Poettering [Thu, 21 Jun 2018 16:49:52 +0000 (18:49 +0200)] 
efi: add poor man's offsetof() implementation

5 years agomkosi: update the boot loader from our freshly built one
Lennart Poettering [Thu, 21 Jun 2018 16:47:33 +0000 (18:47 +0200)] 
mkosi: update the boot loader from our freshly built one

5 years agomkosi: make kmsg work in our mkosi builds at least
Lennart Poettering [Thu, 11 Oct 2018 16:22:38 +0000 (18:22 +0200)] 
mkosi: make kmsg work in our mkosi builds at least

5 years agoNEWS: explain the RLIMIT_NOFILE bump
Lennart Poettering [Tue, 2 Oct 2018 07:21:45 +0000 (09:21 +0200)] 
NEWS: explain the RLIMIT_NOFILE bump

5 years agorlimit-util: don't call setrlimit() needlessly if it wouldn't change anything
Lennart Poettering [Tue, 2 Oct 2018 06:41:03 +0000 (08:41 +0200)] 
rlimit-util: don't call setrlimit() needlessly if it wouldn't change anything

Just a tiny tweak to avoid generating an error if there's no need to.

5 years agocore: bump RLIMIT_NOFILE soft+hard limit for systemd itself in all cases
Lennart Poettering [Mon, 1 Oct 2018 16:11:52 +0000 (18:11 +0200)] 
core: bump RLIMIT_NOFILE soft+hard limit for systemd itself in all cases

Previously we'd do this for PID 1 only. Let's do this when running in
user mode too, because we know we can handle it.

5 years agounits: bump the RLIMIT_NOFILE soft limit for all services that access the journal
Lennart Poettering [Mon, 1 Oct 2018 16:08:27 +0000 (18:08 +0200)] 
units: bump the RLIMIT_NOFILE soft limit for all services that access the journal

This updates the unit files of all our serviecs that deal with journal
stuff to use a higher RLIMIT_NOFILE soft limit by default. The new value
is the same as used for the new HIGH_RLIMIT_NOFILE we just added.

With this we ensure all code that access the journal has higher
RLIMIT_NOFILE. The code that runs as daemon via the unit files, the code
that is run from the user's command line via C code internal to the
relevant tools. In some cases this means we'll redundantly bump the
limits as there are tools run both from the command line and as service.

5 years agocore: raise the RLIMIT_NOFILE hard limit for all services by default
Lennart Poettering [Mon, 1 Oct 2018 15:56:52 +0000 (17:56 +0200)] 
core: raise the RLIMIT_NOFILE hard limit for all services by default

Following the discussions with the kernel folks, let's substantially
increase the hard limit (but not the soft limit) of RLIMIT_NOFILE to
256K for all services we start.

Note that PID 1 itself bumps the limit even further, to the max the
kernel allows. We can deal with that after all.

5 years agotree-wide: uniformly bump RLIMIT_NOFILE in all our tools that access the journal
Lennart Poettering [Mon, 1 Oct 2018 15:44:46 +0000 (17:44 +0200)] 
tree-wide: uniformly bump RLIMIT_NOFILE in all our tools that access the journal

This makes use of rlimit_nofile_bump() in all tools that access the
journal. In some cases this replaces older code to achieve this, and
others we add it in where it was missing.

5 years agocore: add a new call for bumping RLIMIT_NOFILE to "high" values
Lennart Poettering [Mon, 1 Oct 2018 15:38:48 +0000 (17:38 +0200)] 
core: add a new call for bumping RLIMIT_NOFILE to "high" values

Following discussions with some kernel folks at All Systems Go! it
appears that file descriptors are not really as expensive as they used
to be (both memory and performance-wise) and it should thus be OK to allow
programs (including unprivileged ones) to have more of them without ill
effects.

Unfortunately we can't just raise the RLIMIT_NOFILE soft limit
globally for all processes, as select() and friends can't handle fds
>= 1024, and thus unexpecting programs might fail if they accidently get
an fd outside of that range. We can however raise the hard limit, so
that programs that need a lot of fds can opt-in into getting fds beyond
the 1024 boundary, simply by bumping the soft limit to the now higher
hard limit.

This is useful for all our client code that accesses the journal, as the
journal merging logic might need a lot of fds. Let's add a unified
function for bumping the limit in a robust way.

5 years agodef: add a "high" limit for RLIMIT_NOFILE
Lennart Poettering [Mon, 1 Oct 2018 15:37:01 +0000 (17:37 +0200)] 
def: add a "high" limit for RLIMIT_NOFILE

This simply adds a new constant we can use for bumping RLIMIT_NOFILE to
a "high" value. It default to 256K for now, which is pretty high, but
smaller than the kernel built-in limit of 1M.

Previously, some tools that needed a higher RLIMIT_NOFILE bumped it to
16K. This new define goes substantially higher than this, following the
discussion with the kernel folks.

5 years agoupdate TODO
Lennart Poettering [Mon, 1 Oct 2018 13:47:50 +0000 (15:47 +0200)] 
update TODO

5 years agosiphash24: add helper for calculating the hash value for a string
Lennart Poettering [Tue, 16 Oct 2018 11:56:14 +0000 (13:56 +0200)] 
siphash24: add helper for calculating the hash value for a string

Let's shorten some code.

5 years agoMerge pull request #10416 from poettering/udev-coverity
Lennart Poettering [Tue, 16 Oct 2018 14:26:44 +0000 (16:26 +0200)] 
Merge pull request #10416 from poettering/udev-coverity

three simple coverity fixes

5 years agoutil: fix segfault in prioq_remove() with empty Prioq object
Yu Watanabe [Tue, 16 Oct 2018 13:27:30 +0000 (22:27 +0900)] 
util: fix segfault in prioq_remove() with empty Prioq object

5 years agoutil,test: introduce cleanup function prioq_freep()
Yu Watanabe [Tue, 16 Oct 2018 13:17:04 +0000 (22:17 +0900)] 
util,test: introduce cleanup function prioq_freep()

This also simplifies test-prioq.c.

5 years agotest: use CMP() macro at one more place
Yu Watanabe [Tue, 16 Oct 2018 12:56:46 +0000 (21:56 +0900)] 
test: use CMP() macro at one more place

5 years agoudev: (void)ify calls to kill() where we knowingly ignore the return values 10416/head
Lennart Poettering [Tue, 16 Oct 2018 11:49:28 +0000 (13:49 +0200)] 
udev: (void)ify calls to kill() where we knowingly ignore the return values

CID 1368231
CID 1368229

5 years agoudev: don't use devname before we acquired it
Lennart Poettering [Tue, 16 Oct 2018 11:48:25 +0000 (13:48 +0200)] 
udev: don't use devname before we acquired it

CID 1396107

5 years agocore: log about unit_watch_pid() failing
Lennart Poettering [Tue, 16 Oct 2018 11:47:23 +0000 (13:47 +0200)] 
core: log about unit_watch_pid() failing

CID 1237509

5 years agoMerge pull request #10327 from yuwata/test-sd-device-enumerator-subsystem
Lennart Poettering [Tue, 16 Oct 2018 10:48:01 +0000 (12:48 +0200)] 
Merge pull request #10327 from yuwata/test-sd-device-enumerator-subsystem

sd-device-enumerator: dedup enumerated devices and add test for subsystem filtering

5 years agoupdate TODO 10407/head
Yu Watanabe [Tue, 16 Oct 2018 10:21:15 +0000 (19:21 +0900)] 
update TODO

5 years agotest: add tests for sd_netlink_slot_set_*()
Yu Watanabe [Tue, 16 Oct 2018 09:49:27 +0000 (18:49 +0900)] 
test: add tests for sd_netlink_slot_set_*()

5 years agotest: add tests for sd_netlink_slot_get_*()
Yu Watanabe [Mon, 15 Oct 2018 08:59:45 +0000 (17:59 +0900)] 
test: add tests for sd_netlink_slot_get_*()

5 years agosd-netlink: make sd_netlink_slot take its description
Yu Watanabe [Mon, 15 Oct 2018 08:49:53 +0000 (17:49 +0900)] 
sd-netlink: make sd_netlink_slot take its description

5 years agoSet theme jekyll-theme-cayman
Lennart Poettering [Tue, 16 Oct 2018 09:32:09 +0000 (11:32 +0200)] 
Set theme jekyll-theme-cayman

5 years agocatalog: fix name of variable
Zbigniew Jędrzejewski-Szmek [Mon, 15 Oct 2018 20:41:49 +0000 (22:41 +0200)] 
catalog: fix name of variable

All the messages would (literally) say "The start-up result is RESULT."
because @RESULT@ was not defined.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1639482
and the first part of #8005.

Fixup for 646cc98dc81c4d0edbc1b57e7bca0f474b47e270.

5 years agorules: Add ID_REVISION environment var for NVMe devices
Harry Mallon [Mon, 15 Oct 2018 16:10:44 +0000 (17:10 +0100)] 
rules: Add ID_REVISION environment var for NVMe devices

5 years agoMerge pull request #9824 from poettering/login-unit-fixes
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 07:34:27 +0000 (09:34 +0200)] 
Merge pull request #9824 from poettering/login-unit-fixes

many logind improvements

5 years agoMerge pull request #10391 from poettering/systemctl-exit-code-fixes
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 06:42:34 +0000 (08:42 +0200)] 
Merge pull request #10391 from poettering/systemctl-exit-code-fixes

systemctl exit code fixes

5 years agonspawn: TAKE_FD() is your friend 10412/head
Lennart Poettering [Mon, 15 Oct 2018 17:45:37 +0000 (19:45 +0200)] 
nspawn: TAKE_FD() is your friend