chiark / gitweb /
elogind.git
6 years agoFix logical error in meson.build (#7658)
Max Harmathy [Fri, 15 Dec 2017 15:05:25 +0000 (16:05 +0100)]
Fix logical error in meson.build (#7658)

sysvinit_path and sysvrcnd_path have to be set both to activate Sysv compatibility.

6 years agoman: Clarify when OnFailure= activates after restarts (#7646)
Ken (Bitsko) MacLeod [Fri, 15 Dec 2017 10:10:41 +0000 (04:10 -0600)]
man: Clarify when OnFailure= activates after restarts (#7646)

6 years agotree-wide: add DEBUG_LOGGING macro that checks whether debug logging is on (#7645)
Lennart Poettering [Fri, 15 Dec 2017 10:09:00 +0000 (11:09 +0100)]
tree-wide: add DEBUG_LOGGING macro that checks whether debug logging is on (#7645)

This makes things a bit easier to read I think, and also makes sure we
always use the _unlikely_ wrapper around it, which so far we used
sometimes and other times we didn't. Let's clean that up.

6 years agoTODO: update
Yu Watanabe [Thu, 14 Dec 2017 13:17:17 +0000 (22:17 +0900)]
TODO: update

6 years agoverbs: Rename VERB_OFFLINE to VERB_ONLINE_ONLY, expand MUSTBEROOT
Colin Walters [Thu, 14 Dec 2017 20:23:02 +0000 (15:23 -0500)]
verbs: Rename VERB_OFFLINE to VERB_ONLINE_ONLY, expand MUSTBEROOT

Followup to previous commit. Suggested by @poettering.
Reindented the `verbs[]` tables to match the apparent previous
whitespace rules (indent to one flag, allow multiple flags to overflow?).

6 years agosystemctl,verbs: Introduce SYSTEMD_OFFLINE environment variable
Colin Walters [Wed, 13 Dec 2017 21:04:41 +0000 (16:04 -0500)]
systemctl,verbs: Introduce SYSTEMD_OFFLINE environment variable

A lot of code references the `running_in_chroot()` function; while
I didn't dig I'm pretty certain this arose to deal with situations
like RPM package builds in `mock` - there we don't want the `%post`s
to `systemctl start` for example.

And actually this exact same use case arises for
[rpm-ostree](https://github.com/projectatomic/rpm-ostree/)
where we implement offline upgrades by default; the `%post`s are
always run in a new chroot using [bwrap](https://github.com/projectatomic/bubblewrap).

And here's the problem: bwrap creates proper mount roots, so it
passes `running_in_chroot()`, and then if a script tries to do
`systemctl start` we get:
`System has not been booted with systemd as init system (PID 1)`
but that's an *error*, unlike the `running_in_chroot()` case where we ignore.

Further complicating things is there are real world RPM packages
like `glusterfs` which end up invoking `systemctl start`.

A while ago, the `SYSTEMD_IGNORE_CHROOT` environment variable was
added for the inverse case of running in a chroot, but still wanting
to use systemd as PID 1 (presumably some broken initramfs setups?).

Let's introduce a `SYSTEMD_OFFLINE` environment variable for cases like
mock/rpm-ostree so we can force on the "ignore everything except preset" logic.
This way we'll still not start services even if mock switches to use nspawn or
bwrap or something else that isn't a chroot.

We also cleanly supercede the `SYSTEMD_IGNORE_CHROOT=1` which is now spelled
`SYSTEMD_OFFLINE=0`.  (Suggested by @poettering)

Also I made things slightly nicer here and we now print the ignored operation.

6 years agoCODING_STYLE: provide better explanation why /* */ over // (#7647)
Lennart Poettering [Fri, 15 Dec 2017 09:26:07 +0000 (10:26 +0100)]
CODING_STYLE: provide better explanation why /* */ over // (#7647)

Let's provide a real reason why /* */ should be used for commenting,
rather than //, beyond mere taste.

(This ultimately simply codifies how I use // vs. /* */ comments, and I
think this is useful as an explanation and reason hence.)

6 years agofinal v236 update (#7649)
Lennart Poettering [Thu, 14 Dec 2017 22:09:57 +0000 (23:09 +0100)]
final v236 update (#7649)

6 years agoNEWS: update NEWS again, and prepare for a release tomorrow
Lennart Poettering [Wed, 13 Dec 2017 17:27:59 +0000 (18:27 +0100)]
NEWS: update NEWS again, and prepare for a release tomorrow

6 years agomeson: increase version numbers
Lennart Poettering [Mon, 11 Dec 2017 15:10:25 +0000 (16:10 +0100)]
meson: increase version numbers

6 years agocore: Implement timeout based umount/remount limit
Kyle Walker [Wed, 13 Dec 2017 17:49:26 +0000 (12:49 -0500)]
core: Implement timeout based umount/remount limit

Remount, and subsequent umount, attempts can hang for inaccessible network
based mount points. This can leave a system in a hard hang state that
requires a hard reset in order to recover. This change moves the remount,
and umount attempts into separate child processes. The remount and umount
operations will block for up to 90 seconds (DEFAULT_TIMEOUT_USEC). Should
those waits fail, the parent will issue a SIGKILL to the child and continue
with the shutdown efforts.

In addition, instead of only reporting some additional errors on the final
attempt, failures are reported as they occur.

6 years agotree-wide: make use of new STRLEN() macro everywhere (#7639)
Lennart Poettering [Thu, 14 Dec 2017 18:02:29 +0000 (19:02 +0100)]
tree-wide: make use of new STRLEN() macro everywhere (#7639)

Let's employ coccinelle to do this for us.

Follow-up for #7625.

6 years agobasic: turn off stdio locking for a couple of helper calls
Lennart Poettering [Mon, 11 Dec 2017 19:01:55 +0000 (20:01 +0100)]
basic: turn off stdio locking for a couple of helper calls

These helper calls are potentially called often, and allocate FILE*
objects internally for a very short period of time, let's turn off
locking for them too.

6 years agocore: add EXTEND_TIMEOUT_USEC={usec} - prevent timeouts in startup/runtime/shutdown...
Daniel Black [Thu, 14 Dec 2017 11:17:43 +0000 (22:17 +1100)]
core: add EXTEND_TIMEOUT_USEC={usec} - prevent timeouts in startup/runtime/shutdown (#7214)

With Type=notify services, EXTEND_TIMEOUT_USEC= messages will delay any startup/
runtime/shutdown timeouts.

A service that hasn't timed out, i.e, start time < TimeStartSec,
runtime < RuntimeMaxSec and stop time < TimeoutStopSec, may by sending
EXTEND_TIMEOUT_USEC=, allow the service to continue beyond the limit for
the execution phase (i.e TimeStartSec, RunTimeMaxSec and TimeoutStopSec).

EXTEND_TIMEOUT_USEC= must continue to be sent (in the same way as
WATCHDOG=1) within the time interval specified to continue to reprevent
the timeout from occuring.

Watchdog timeouts are also extended if a EXTEND_TIMEOUT_USEC is greater
than the remaining time on the watchdog counter.

Fixes #5868.

6 years agocheck_tree.pl: Do not allow diff to move name reverts into a mask
Sven Eden [Wed, 30 May 2018 05:47:36 +0000 (07:47 +0200)]
check_tree.pl: Do not allow diff to move name reverts into a mask
block.

Do not replace double dashes in XML comments, that are either the
comment start or end.

6 years agocheck_tree.pl: Move move upstream appends from after our mask blocks
Sven Eden [Tue, 29 May 2018 17:45:35 +0000 (19:45 +0200)]
check_tree.pl: Move move upstream appends from after our mask blocks
up before found #else switches.

6 years agocheck_tree.pl: Added missing detection of mask else switches in prune_hunk().
Sven Eden [Tue, 29 May 2018 16:58:39 +0000 (18:58 +0200)]
check_tree.pl: Added missing detection of mask else switches in prune_hunk().

6 years agoCleanup now obsolete pwx tools.
Sven Eden [Tue, 29 May 2018 06:07:21 +0000 (08:07 +0200)]
Cleanup now obsolete pwx tools.

6 years agocheck_tree.pl: The word "systemd" is no longer changed to "elogind",
Sven Eden [Tue, 29 May 2018 06:04:43 +0000 (08:04 +0200)]
check_tree.pl: The word "systemd" is no longer changed to "elogind",
if it was found in a comment block that is added by the patch.

6 years agocheck_tree.pl: Fixed a bug that caused #else to not be unremoved in __GLIBC__ blocks.
Sven Eden [Tue, 29 May 2018 05:53:05 +0000 (07:53 +0200)]
check_tree.pl: Fixed a bug that caused #else to not be unremoved in __GLIBC__ blocks.

6 years agocheck_tree.pl: Made check_musl() and check_name_reverts() safer.
Sven Eden [Fri, 25 May 2018 17:24:58 +0000 (19:24 +0200)]
check_tree.pl: Made check_musl() and check_name_reverts() safer.
Further policy.in consist of XML code, and are now handled by
(un)prepare_xml().

6 years agocheck_tree.pl: Fixed check_musl(), it must track mask state changes itself.
Sven Eden [Fri, 25 May 2018 05:51:27 +0000 (07:51 +0200)]
check_tree.pl: Fixed check_musl(), it must track mask state changes itself.

6 years agocheck_tree.pl: Enhance the final processing of shell and xml files
Sven Eden [Thu, 24 May 2018 16:46:24 +0000 (18:46 +0200)]
check_tree.pl: Enhance the final processing of shell and xml files
and their patches by remembering mask changes that get pruned from
the hunks.

6 years agocheck_tree.pl: Remove the [e]logind [m]ask [i]nfo code, this was not sufficient.
Sven Eden [Wed, 23 May 2018 05:46:33 +0000 (07:46 +0200)]
check_tree.pl: Remove the [e]logind [m]ask [i]nfo code, this was not sufficient.

6 years agocheck_tree.pl: Keep track of elogind masks although the changing lines get pruned.
Sven Eden [Wed, 23 May 2018 05:43:11 +0000 (07:43 +0200)]
check_tree.pl: Keep track of elogind masks although the changing lines get pruned.

6 years agocheck_tree.pl: Fixed unprepare_xml()
Sven Eden [Thu, 17 May 2018 18:01:49 +0000 (20:01 +0200)]
check_tree.pl: Fixed unprepare_xml()

6 years agomigrate_tree.pl: Only write a new commits file, if the old was finished reading or...
Sven Eden [Thu, 17 May 2018 17:30:11 +0000 (19:30 +0200)]
migrate_tree.pl: Only write a new commits file, if the old was finished reading or none existed.

6 years agocheck_tree.pl : Fix transportation of elogind mask info
Sven Eden [Thu, 17 May 2018 06:19:47 +0000 (08:19 +0200)]
check_tree.pl : Fix transportation of elogind mask info

6 years agocheck_tree.pl : Do not skip mask info with useless hunks.
Sven Eden [Thu, 17 May 2018 06:13:21 +0000 (08:13 +0200)]
check_tree.pl : Do not skip mask info with useless hunks.

6 years agocheck_tree.pl: Remember mask starts and elses in hunks, so the
Sven Eden [Thu, 17 May 2018 06:08:37 +0000 (08:08 +0200)]
check_tree.pl: Remember mask starts and elses in hunks, so the
resulting patches can be reworked without ignoring changes in useless
hunks.

6 years agomigrate_tree.pl : Check target first when creating new files.
Sven Eden [Thu, 17 May 2018 05:44:41 +0000 (07:44 +0200)]
migrate_tree.pl : Check target first when creating new files.

6 years agocheck_tree.pl: Replace the source in creation patches with /dev/null.
Sven Eden [Thu, 17 May 2018 05:38:55 +0000 (07:38 +0200)]
check_tree.pl: Replace the source in creation patches with /dev/null.

6 years agomigrate_tree.pl: Ensure that the commit file is always written on exit.
Sven Eden [Wed, 16 May 2018 16:14:01 +0000 (18:14 +0200)]
migrate_tree.pl: Ensure that the commit file is always written on exit.

6 years agomigrate_tree.pl: Add a signal handler, so the commit file is updated even on SIGINT.
Sven Eden [Wed, 16 May 2018 06:06:32 +0000 (08:06 +0200)]
migrate_tree.pl: Add a signal handler, so the commit file is updated even on SIGINT.

6 years agomigrate_tree.pl: Make the last commit csv location agnostic.
Sven Eden [Wed, 16 May 2018 05:47:58 +0000 (07:47 +0200)]
migrate_tree.pl: Make the last commit csv location agnostic.

6 years agocheck_tree.pl migrate_tree.pl: Move necessary eop stuff into END blocks.
Sven Eden [Wed, 16 May 2018 05:01:59 +0000 (07:01 +0200)]
check_tree.pl migrate_tree.pl: Move necessary eop stuff into END blocks.

6 years agomigrate_tree.pl: Use git rev-parse to get the shortest possible version of each refid...
Sven Eden [Tue, 15 May 2018 16:01:23 +0000 (18:01 +0200)]
migrate_tree.pl: Use git rev-parse to get the shortest possible version of each refid we work with.

6 years agocheck_tree.pl: While unpreparing shell: comment comment lines and do
Sven Eden [Tue, 15 May 2018 15:49:48 +0000 (17:49 +0200)]
check_tree.pl: While unpreparing shell: comment comment lines and do
not add '# ' prefixes to mask blocks in xml patch hunks.

6 years agomeson.build: Clean up, so check_tree.pl does not find a difference to upstream.
Sven Eden [Tue, 15 May 2018 15:47:18 +0000 (17:47 +0200)]
meson.build: Clean up, so check_tree.pl does not find a difference to upstream.

6 years agomigrate_tree.pl: Call 'git am --abort' if it failed to apply.
Sven Eden [Tue, 15 May 2018 06:22:08 +0000 (08:22 +0200)]
migrate_tree.pl: Call 'git am --abort' if it failed to apply.

6 years agomigrate_tree.pl: Fixed Usage of Try::Tiny
Sven Eden [Tue, 15 May 2018 06:16:00 +0000 (08:16 +0200)]
migrate_tree.pl: Fixed Usage of Try::Tiny

6 years agomigrate_tree.pl: Finished the first working version for testing.
Sven Eden [Tue, 15 May 2018 05:55:42 +0000 (07:55 +0200)]
migrate_tree.pl: Finished the first working version for testing.

6 years agomigrate_tree.pl: Application of the reworked patches added.
Sven Eden [Mon, 14 May 2018 16:50:18 +0000 (18:50 +0200)]
migrate_tree.pl: Application of the reworked patches added.

6 years agomigrate_tree.pl: Reworking of the formatted patches added.
Sven Eden [Mon, 14 May 2018 16:34:03 +0000 (18:34 +0200)]
migrate_tree.pl: Reworking of the formatted patches added.

6 years agocheck_tree.pl: Add --create to allow creation of files, and --stay to not reset the...
Sven Eden [Mon, 14 May 2018 05:31:02 +0000 (07:31 +0200)]
check_tree.pl: Add --create to allow creation of files, and --stay to not reset the upstream tree on program end.

6 years agopwx/check_tree.pl: Switch to use Git::Wrapper for checking out the wanted refid on...
Sven Eden [Wed, 9 May 2018 05:19:24 +0000 (07:19 +0200)]
pwx/check_tree.pl: Switch to use Git::Wrapper for checking out the wanted refid on the upstream tree.

6 years agopwx/migrate_tree.pl: New program to consolidate the pwx git bash helpers.
Sven Eden [Mon, 7 May 2018 17:34:57 +0000 (19:34 +0200)]
pwx/migrate_tree.pl: New program to consolidate the pwx git bash helpers.

6 years agomusl_missing.h: add FTW_* macros missing from musl libc.
maxice8 [Fri, 27 Apr 2018 13:05:25 +0000 (10:05 -0300)]
musl_missing.h: add FTW_* macros missing from musl libc.

6 years agoFix double-hyphen error in man/logind.conf.xml and man/user-system-options.xml
Sven Eden [Thu, 26 Apr 2018 17:51:19 +0000 (19:51 +0200)]
Fix double-hyphen error in man/logind.conf.xml and man/user-system-options.xml

6 years agoUpdated man/loginctl.xml to fit elogind a bit better.
Sven Eden [Thu, 26 Apr 2018 17:41:40 +0000 (19:41 +0200)]
Updated man/loginctl.xml to fit elogind a bit better.

6 years agoRemove man/standard-conf.xml, as this does not apply for elogind.
Sven Eden [Thu, 26 Apr 2018 17:41:14 +0000 (19:41 +0200)]
Remove man/standard-conf.xml, as this does not apply for elogind.

6 years agoMove /var/lib/systemd/linger to /var/lib/elogind/.
Sven Eden [Mon, 23 Apr 2018 16:40:49 +0000 (18:40 +0200)]
Move /var/lib/systemd/linger to /var/lib/elogind/.

6 years agoReverted accidential renaming of /run/systemd to /run/elogind. Applications using...
Sven Eden [Mon, 23 Apr 2018 16:38:53 +0000 (18:38 +0200)]
Reverted accidential renaming of /run/systemd to /run/elogind. Applications using elogind as a drop-in replacement expect the first.

6 years agocheck_tree.pl: Do not change /run/systemd
Sven Eden [Mon, 23 Apr 2018 09:03:46 +0000 (11:03 +0200)]
check_tree.pl: Do not change /run/systemd

6 years agoFix 'double dash in comment' error.
Sven Eden [Fri, 20 Apr 2018 15:24:07 +0000 (17:24 +0200)]
Fix 'double dash in comment' error.

6 years agocheck_tree.pl: Add preparation for XML files.
Sven Eden [Fri, 20 Apr 2018 15:12:17 +0000 (17:12 +0200)]
check_tree.pl: Add preparation for XML files.

6 years agoUpdate man page sources to upstream tag v236 variants.
Sven Eden [Thu, 19 Apr 2018 16:37:32 +0000 (18:37 +0200)]
Update man page sources to upstream tag v236 variants.

6 years agoman/sd_id128_randomize.xml: Added check_tree.pl compatible elogind masking.
Sven Eden [Thu, 19 Apr 2018 16:15:56 +0000 (18:15 +0200)]
man/sd_id128_randomize.xml: Added check_tree.pl compatible elogind masking.

6 years agoman/logind.conf.xml: Added check_tree.pl compatible elogind masking.
Sven Eden [Thu, 19 Apr 2018 16:15:56 +0000 (18:15 +0200)]
man/logind.conf.xml: Added check_tree.pl compatible elogind masking.

6 years agoman/loginctl.xml: Added check_tree.pl compatible elogind masking.
Sven Eden [Thu, 19 Apr 2018 16:15:56 +0000 (18:15 +0200)]
man/loginctl.xml: Added check_tree.pl compatible elogind masking.

6 years agoman/elogind.xml: Added check_tree.pl compatible elogind masking.
Sven Eden [Thu, 19 Apr 2018 16:15:56 +0000 (18:15 +0200)]
man/elogind.xml: Added check_tree.pl compatible elogind masking.

6 years agocheck_tree.pl : Enhance XML handling.
Sven Eden [Thu, 19 Apr 2018 16:14:50 +0000 (18:14 +0200)]
check_tree.pl : Enhance XML handling.

6 years agoManpages: update elogind refentry for better handling through check_tree.pl
Sven Eden [Wed, 18 Apr 2018 15:09:23 +0000 (17:09 +0200)]
Manpages: update elogind refentry for better handling through check_tree.pl

6 years agoPrepare src/libelogind/libelogind.pc.in for better handling through check_tree.pl
Sven Eden [Wed, 18 Apr 2018 15:08:42 +0000 (17:08 +0200)]
Prepare src/libelogind/libelogind.pc.in for better handling through check_tree.pl

6 years agomissing_syscall: when adding syscall replacements, use different names (#8229)
Zbigniew Jędrzejewski-Szmek [Wed, 21 Feb 2018 13:04:50 +0000 (14:04 +0100)]
missing_syscall: when adding syscall replacements, use different names (#8229)

In meson.build we check that functions are available using:
    meson.get_compiler('c').has_function('foo')
which checks the following:
- if __stub_foo or __stub___foo are defined, return false
- if foo is declared (a pointer to the function can be taken), return true
- otherwise check for __builtin_memfd_create

_stub is documented by glibc as
   It defines a symbol '__stub_FUNCTION' for each function
   in the C library which is a stub, meaning it will fail
   every time called, usually setting errno to ENOSYS.

So if __stub is defined, we know we don't want to use the glibc version, but
this doesn't tell us if the name itself is defined or not. If it _is_ defined,
and we define our replacement as an inline static function, we get an error:

In file included from ../src/basic/missing.h:1358:0,
                 from ../src/basic/util.h:47,
                 from ../src/basic/calendarspec.h:29,
                 from ../src/basic/calendarspec.c:34:
../src/basic/missing_syscall.h:65:19: error: static declaration of 'memfd_create' follows non-static declaration
 static inline int memfd_create(const char *name, unsigned int flags) {
                   ^~~~~~~~~~~~
.../usr/include/bits/mman-shared.h:46:5: note: previous declaration of 'memfd_create' was here
 int memfd_create (const char *__name, unsigned int __flags) __THROW;
     ^~~~~~~~~~~~

To avoid this problem, call our inline functions different than glibc,
and use a #define to map the official name to our replacement.

Fixes #8099.

v2:
- use "missing_" as the prefix instead of "_"

v3:
- rebase and update for statx()

  Unfortunately "statx" is also present in "struct statx", so the define
  causes issues. Work around this by using a typedef.

I checked that systemd compiles with current glibc
(glibc-devel-2.26-24.fc27.x86_64) if HAVE_MEMFD_CREATE, HAVE_GETTID,
HAVE_PIVOT_ROOT, HAVE_SETNS, HAVE_RENAMEAT2, HAVE_KCMP, HAVE_KEYCTL,
HAVE_COPY_FILE_RANGE, HAVE_BPF, HAVE_STATX are forced to 0.

Setting HAVE_NAME_TO_HANDLE_AT to 0 causes an issue, but it's not because of
the define, but because of struct file_handle.

6 years agoPrep v236.1: To catch up with upstream, already branch out v236-stable.
Sven Eden [Thu, 29 Mar 2018 05:53:20 +0000 (07:53 +0200)]
Prep v236.1: To catch up with upstream, already branch out v236-stable.

6 years agoPrep v236: Adapt elogind parts in the build system to upstream changes.
Sven Eden [Mon, 26 Mar 2018 16:22:06 +0000 (18:22 +0200)]
Prep v236: Adapt elogind parts in the build system to upstream changes.

6 years agocheck_tree.pl: Added *.sym and *.in file handling.
Sven Eden [Fri, 16 Mar 2018 06:59:32 +0000 (07:59 +0100)]
check_tree.pl: Added *.sym and *.in file handling.

6 years agocheck_tree.pl: Do not remove empty lines prior masks/inserts. Do not rename 'systemd...
Sven Eden [Fri, 16 Mar 2018 05:56:25 +0000 (06:56 +0100)]
check_tree.pl: Do not remove empty lines prior masks/inserts. Do not rename 'systemd' in mask blocks.

6 years agocheck_tree.pl: chomp git rev-parse results.
Sven Eden [Thu, 15 Mar 2018 05:12:03 +0000 (06:12 +0100)]
check_tree.pl: chomp git rev-parse results.

6 years agoPrep v236: Update root build files.
Sven Eden [Thu, 15 Mar 2018 05:03:12 +0000 (06:03 +0100)]
Prep v236: Update root build files.

6 years agoPrep v236 : Add missing SPDX-License-Identifier (9/9) tools
Sven Eden [Tue, 13 Mar 2018 18:20:00 +0000 (19:20 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (9/9) tools

6 years agoPrep v236 : Add missing SPDX-License-Identifier (8/9) src/test
Sven Eden [Tue, 13 Mar 2018 18:19:10 +0000 (19:19 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (8/9) src/test

6 years agoPrep v236 : Add missing SPDX-License-Identifier (7/9) src/systemd
Sven Eden [Tue, 13 Mar 2018 18:18:29 +0000 (19:18 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (7/9) src/systemd

6 years agoPrep v236 : Add missing SPDX-License-Identifier (6/9) src/shared
Sven Eden [Tue, 13 Mar 2018 18:17:48 +0000 (19:17 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (6/9) src/shared

6 years agoPrep v236 : Add missing SPDX-License-Identifier (5/9) src/login
Sven Eden [Tue, 13 Mar 2018 18:14:05 +0000 (19:14 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (5/9) src/login

6 years agoPrep v236 : Add missing SPDX-License-Identifier (4/9) src/libelogind
Sven Eden [Tue, 13 Mar 2018 18:12:55 +0000 (19:12 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (4/9) src/libelogind

6 years agoPrep v236 : Add missing SPDX-License-Identifier (3/9) src/core
Sven Eden [Tue, 13 Mar 2018 18:12:26 +0000 (19:12 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (3/9) src/core

6 years agoPrep v236 : Add missing SPDX-License-Identifier (2/9) src/basic
Sven Eden [Tue, 13 Mar 2018 18:11:43 +0000 (19:11 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (2/9) src/basic

6 years agoPrep v236 : Add missing SPDX-License-Identifier (1/9) shell-completion
Sven Eden [Tue, 13 Mar 2018 18:10:50 +0000 (19:10 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (1/9) shell-completion

6 years agoPrep v236: Remove obsolete files that have slithered in.
Sven Eden [Tue, 13 Mar 2018 18:16:48 +0000 (19:16 +0100)]
Prep v236: Remove obsolete files that have slithered in.

6 years agoPrep v236: Update build system and adapt to eloginds needs.
Sven Eden [Tue, 13 Mar 2018 18:05:56 +0000 (19:05 +0100)]
Prep v236: Update build system and adapt to eloginds needs.

6 years agoPrep v236: Apply missing upstream updates to the build system
Sven Eden [Tue, 13 Mar 2018 07:17:29 +0000 (08:17 +0100)]
Prep v236: Apply missing upstream updates to the build system

6 years agoNew: pwx/update_po_files.pl : Coment out all translations to non-existent files.
Sven Eden [Tue, 13 Mar 2018 07:16:23 +0000 (08:16 +0100)]
New: pwx/update_po_files.pl : Coment out all translations to non-existent files.

 => Update po translation files

6 years agocheck_tree.pl: Added the possibility to (manualy) check root files and enhanced shell...
Sven Eden [Tue, 13 Mar 2018 06:55:12 +0000 (07:55 +0100)]
check_tree.pl: Added the possibility to (manualy) check root files and enhanced shell mask handling.

6 years agoPrep v236: Update root level files
Sven Eden [Mon, 12 Mar 2018 05:59:45 +0000 (06:59 +0100)]
Prep v236: Update root level files

6 years agoUpdate TODO
Zbigniew Jędrzejewski-Szmek [Thu, 14 Dec 2017 13:12:39 +0000 (14:12 +0100)]
Update TODO

6 years agoMake taint message structured and add catalog entry
Zbigniew Jędrzejewski-Szmek [Thu, 14 Dec 2017 09:15:41 +0000 (10:15 +0100)]
Make taint message structured and add catalog entry

Dec 14 14:10:54 krowka elogind[1]: System is tainted: overflowgid-not-65534
-- Subject: The system is configured in a way that might cause problems
-- Defined-By: elogind
-- Support: https://lists.freedesktop.org/mailman/listinfo/elogind-devel
--
-- The following "tags" are possible:
-- - "split-usr" — /usr is a separate file system and was not mounted when elogind
--   was booted
-- - "cgroups-missing" — the kernel was compiled without cgroup support or access
--   to expected interface files is resticted
-- - "var-run-bad" — /var/run is not a symlink to /run
-- - "overflowuid-not-65534" — the kernel user ID used for "unknown" users (with
--   NFS or user namespaces) is not 65534
-- - "overflowgid-not-65534" — the kernel group ID used for "unknown" users (with
--   NFS or user namespaces) is not 65534
-- Current system is tagged as overflowgid-not-65534.

6 years agomeson: increase version numbers
Lennart Poettering [Mon, 11 Dec 2017 15:10:25 +0000 (16:10 +0100)]
meson: increase version numbers

6 years agocore: add EXTEND_TIMEOUT_USEC={usec} - prevent timeouts in startup/runtime/shutdown...
Daniel Black [Thu, 14 Dec 2017 11:17:43 +0000 (22:17 +1100)]
core: add EXTEND_TIMEOUT_USEC={usec} - prevent timeouts in startup/runtime/shutdown (#7214)

With Type=notify services, EXTEND_TIMEOUT_USEC= messages will delay any startup/
runtime/shutdown timeouts.

A service that hasn't timed out, i.e, start time < TimeStartSec,
runtime < RuntimeMaxSec and stop time < TimeoutStopSec, may by sending
EXTEND_TIMEOUT_USEC=, allow the service to continue beyond the limit for
the execution phase (i.e TimeStartSec, RunTimeMaxSec and TimeoutStopSec).

EXTEND_TIMEOUT_USEC= must continue to be sent (in the same way as
WATCHDOG=1) within the time interval specified to continue to reprevent
the timeout from occuring.

Watchdog timeouts are also extended if a EXTEND_TIMEOUT_USEC is greater
than the remaining time on the watchdog counter.

Fixes #5868.

6 years agoman: elogind.unit: move note about clearing lists (#7621)
Daniel Black [Thu, 14 Dec 2017 04:51:23 +0000 (15:51 +1100)]
man: elogind.unit: move note about clearing lists (#7621)

This is mainly for drop-in files.

6 years agosysctl: disable buffer while writing to /proc
Tiago Salem Herrmann [Tue, 12 Dec 2017 15:52:45 +0000 (13:52 -0200)]
sysctl: disable buffer while writing to /proc

fputs() writes only first 2048 bytes and fails
to write to /proc when values are larger than that.
This patch adds a new flag to WriteStringFileFlags
that make it possible to disable the buffer under
specific cases.

6 years agotree-wide: use STRLEN() to allocate buffer of constant size
Thomas Haller [Wed, 13 Dec 2017 07:41:11 +0000 (08:41 +0100)]
tree-wide: use STRLEN() to allocate buffer of constant size

Using strlen() to declare a buffer results in a variable-length array,
even if the compiler likely optimizes it to be a compile time constant.

When building with -Wvla, certain versions of gcc complain about such
buffers. Compiling with -Wvla has the advantage of preventing variably
length array, which defeat static asserts that are implemented by
declaring an array of negative length.

6 years agobasic/macros: add STRLEN() to get length of string literal as constant expression
Thomas Haller [Wed, 13 Dec 2017 07:17:07 +0000 (08:17 +0100)]
basic/macros: add STRLEN() to get length of string literal as constant expression

While the compiler likely optimizes strlen(x) for string literals,
it is not a constant expression.

Hence,

  char buffer[strlen("OPTION_000") + 1];

declares a variable-length array. STRLEN() can be used instead
when a constant espression is needed.

It's not entirely identical to strlen(), as STRLEN("a\0") counts 2.
Also, it only works with string literals and the macro enforces
that the argument is a literal.

6 years agomeson: link NSS modules with -z nodelete (#7607)
Lennart Poettering [Tue, 12 Dec 2017 19:13:16 +0000 (20:13 +0100)]
meson: link NSS modules with -z nodelete (#7607)

We might end up allocating mempools, and when we are unloaded we might
orphan them, thus leaking them. Hence, let's just stick around for good,
so the mempools remain referenced continously and for good, and thus no
memory is leaked (though the memory isn't cleaned up either).

Fixes: #7596
6 years agoverbs: add a new VERB_MUSTBEROOT flag
Lennart Poettering [Mon, 11 Dec 2017 22:10:11 +0000 (23:10 +0100)]
verbs: add a new VERB_MUSTBEROOT flag

Given that we regularly have verbs that require privileges, let's just
make this a flag of the verb.

6 years agotree-wide: drop a few == NULL and != NULL comparison
Lennart Poettering [Fri, 8 Dec 2017 19:52:38 +0000 (20:52 +0100)]
tree-wide: drop a few == NULL and != NULL comparison

Our CODING_STYLE suggests not comparing with NULL, but relying on C's
downgrade-to-bool feature for that. Fix up some code to match these
guidelines. (This is not comprehensive, the coccinelle output for this
is unfortunately kinda borked)

6 years agovirt: use XENFEAT_dom0 to detect the hardware domain (#6442, #6662) (#7581)
Olaf Hering [Fri, 8 Dec 2017 21:21:42 +0000 (22:21 +0100)]
virt: use XENFEAT_dom0 to detect the hardware domain (#6442, #6662) (#7581)

The detection of ConditionVirtualisation= relies on the presence of
/proc/xen/capabilities. If the file exists and contains the string
"control_d", the running system is a dom0 and VIRTUALIZATION_NONE should
be set. In case /proc/xen exists, or some sysfs files indicate "xen",
VIRTUALIZATION_XEN should be set to indicate the system is a domU.

With an (old) xenlinux based kernel, /proc/xen/capabilities is always
available and the detection described above works always. But with a
pvops based kernel, xenfs must be mounted on /proc/xen to get
"capabilities". This is done by a proc-xen.mount unit, which is part of
xen.git. Since the mounting happens "late", other units may be scheduled
before "proc-xen.mount". If these other units make use of
"ConditionVirtualisation=", the virtualization detection returns
incorect results. detect_vm() will set VIRTUALIZATION_XEN because "xen"
is found in sysfs. This value will be cached. Once xenfs is mounted, the
next process that runs detect_vm() will get VIRTUALIZATION_NONE.

This misdetection can be fixed by using
/sys/hypervisor/properties/features, which exports the value returned by
the "XENVER_get_features" hypercall. If the bit XENFEAT_dom0 is set, the
domain is the "hardware domain". It is supposed to have permissions to
access all hardware. The used sysfs file is available since v2.6.31.

The commonly used term "dom0" refers to the control domain which runs
the toolstack and has access to all hardware. But the virtualization
host may be configured such that one dedicated domain becomes the
"hardware domain", and another one the "toolstack domain".

6 years agoacl: fix typo in comment (#7580)
Yu Watanabe [Fri, 8 Dec 2017 12:34:25 +0000 (21:34 +0900)]
acl: fix typo in comment (#7580)

6 years agoresolved: implement D-Bus API for DNS-SD
Dmitry Rozhkov [Mon, 23 Oct 2017 11:46:13 +0000 (14:46 +0300)]
resolved: implement D-Bus API for DNS-SD