From b9b098e8388d0157588bf1a65e7ddaed296e4b36 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Mon, 10 Sep 2018 08:11:48 +0200 Subject: pwx: Add information about v239-stable --- pwx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwx b/pwx index d50863bb6..f1fc319f4 160000 --- a/pwx +++ b/pwx @@ -1 +1 @@ -Subproject commit d50863bb69d4fd2c59070f2fc931ff113a68c6b6 +Subproject commit f1fc319f469266fabfc3d69036e220cb49de177a -- cgit v1.2.3 From aca0f9571ce7cd205f20c979eba5754a4f1321e1 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Mon, 10 Sep 2018 19:50:04 +0200 Subject: Revert "logind: relax udev rules matching devices logind watches for" This reverts commit 964a6d9fb555cc86528eb1cc1f6d044f85584842. Bug: https://github.com/elogind/elogind/issues/51 elogind doesn't respond to lid events with eudev-3.2.5 --- src/login/70-power-switch.rules | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/login/70-power-switch.rules b/src/login/70-power-switch.rules index d69e65b3d..91ecd1d24 100644 --- a/src/login/70-power-switch.rules +++ b/src/login/70-power-switch.rules @@ -9,7 +9,12 @@ ACTION=="remove", GOTO="power_switch_end" -SUBSYSTEM=="input", KERNEL=="event*", ENV{ID_INPUT_SWITCH}=="1", TAG+="power-switch" -SUBSYSTEM=="input", KERNEL=="event*", ENV{ID_INPUT_KEY}=="1", TAG+="power-switch" +SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="acpi", TAG+="power-switch" +SUBSYSTEM=="input", KERNEL=="event*", KERNELS=="thinkpad_acpi", TAG+="power-switch" +SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="twl4030_pwrbutton", TAG+="power-switch" +SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="tps65217_pwr_but", TAG+="power-switch" +SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="* WMI hotkeys", TAG+="power-switch" +SUBSYSTEM=="input", KERNEL=="event*", \ + SUBSYSTEMS=="platform", DRIVERS=="gpio-keys", ATTRS{keys}=="*,116|116,*|116|*,116,*", TAG+="power-switch" LABEL="power_switch_end" -- cgit v1.2.3 From 0af8158f8d08aab023d6a848a993af19be5d8480 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Mon, 10 Sep 2018 19:54:59 +0200 Subject: Prep v239: Re-Add the new ENV{} mechanism to 70-power-switch.rules, but leave out gpio. --- src/login/70-power-switch.rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/login/70-power-switch.rules b/src/login/70-power-switch.rules index 91ecd1d24..f569ab50c 100644 --- a/src/login/70-power-switch.rules +++ b/src/login/70-power-switch.rules @@ -9,12 +9,12 @@ ACTION=="remove", GOTO="power_switch_end" +SUBSYSTEM=="input", KERNEL=="event*", ENV{ID_INPUT_SWITCH}=="1", TAG+="power-switch" +SUBSYSTEM=="input", KERNEL=="event*", ENV{ID_INPUT_KEY}=="1", TAG+="power-switch" SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="acpi", TAG+="power-switch" SUBSYSTEM=="input", KERNEL=="event*", KERNELS=="thinkpad_acpi", TAG+="power-switch" SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="twl4030_pwrbutton", TAG+="power-switch" SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="tps65217_pwr_but", TAG+="power-switch" SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="* WMI hotkeys", TAG+="power-switch" -SUBSYSTEM=="input", KERNEL=="event*", \ - SUBSYSTEMS=="platform", DRIVERS=="gpio-keys", ATTRS{keys}=="*,116|116,*|116|*,116,*", TAG+="power-switch" LABEL="power_switch_end" -- cgit v1.2.3 From 612bbecd2f2904be8ecb84f03a5bad3fff05a467 Mon Sep 17 00:00:00 2001 From: Christoph Willing Date: Tue, 25 Sep 2018 08:39:53 +1000 Subject: Deal with glibc-2.28 Closes: https://github.com/elogind/elogind/issues/74 Signed-off-by: Christoph Willing Signed-off-by: Sven Eden --- meson.build | 7 +++++++ src/basic/missing.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 3e97f57f3..0d096d847 100644 --- a/meson.build +++ b/meson.build @@ -509,6 +509,13 @@ foreach decl : ['char16_t', conf.set10('HAVE_' + decl.underscorify().to_upper(), have) endforeach +conf.set10('HAVE_STRUCT_STATX_IN_SYS_STAT_H', cc.sizeof('struct statx', prefix : ''' +#include +''', args : '-D_GNU_SOURCE') > 0) +conf.set10('HAVE_STRUCT_STATX_IN_LINUX_STAT_H', cc.sizeof('struct statx', prefix : ''' +#include +''', args : '-D_GNU_SOURCE') > 0) + foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'], ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'], ['IFLA_VRF_TABLE', 'linux/if_link.h'], diff --git a/src/basic/missing.h b/src/basic/missing.h index fb1478548..9be48eef8 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -1371,7 +1371,7 @@ struct fib_rule_uid_range { #define PF_KTHREAD 0x00200000 #endif -#if ! HAVE_STRUCT_STATX +#if !HAVE_STRUCT_STATX_IN_SYS_STAT_H && !HAVE_STRUCT_STATX_IN_LINUX_STAT_H struct statx_timestamp { int64_t tv_sec; uint32_t tv_nsec; -- cgit v1.2.3 From 0fcb473bf4815c1d5fc2ea6051d7272571b9df2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 19 Aug 2018 19:11:30 +0200 Subject: meson: rename -Ddebug to -Ddebug-extra Meson added -Doptimization and -Ddebug options, which obviously causes a conflict with our -Ddebug options. Let's rename it. Fixes #76. --- meson.build | 2 +- meson_options.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 0d096d847..8b62c789e 100644 --- a/meson.build +++ b/meson.build @@ -895,7 +895,7 @@ enable_debug_mmap_cache = false #if 1 /// additional elogind debug mode enable_debug_elogind = false #endif // 1 -foreach name : get_option('debug') +foreach name : get_option('debug-extra') if name == 'hashmap' enable_debug_hashmap = true elif name == 'mmap-cache' diff --git a/meson_options.txt b/meson_options.txt index 3c3b4cb30..05f80ba1a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -72,7 +72,7 @@ option('kexec-path', type : 'string', description : 'path to kexec') # description : 'path to debug shell binary') # option('debug-tty', type : 'string', value : '/dev/tty9', # description : 'specify the tty device for debug shell') -# option('debug', type : 'array', choices : ['hashmap', 'mmap-cache'], value : [], +# option('debug-extra', type : 'array', choices : ['hashmap', 'mmap-cache'], value : [], # description : 'enable extra debugging') # option('memory-accounting-default', type : 'boolean', # description : 'enable MemoryAccounting= by default') @@ -80,7 +80,7 @@ option('kexec-path', type : 'string', description : 'path to kexec') option('valgrind', type : 'boolean', value : false, description : 'do extra operations to avoid valgrind warnings') #if 1 /// Add an extra debugging option for elogind -option('debug', type : 'array', choices : ['elogind', 'hashmap', 'mmap-cache'], value : [], +option('debug-extra', type : 'array', choices : ['elogind', 'hashmap', 'mmap-cache'], value : [], description : 'enable extra debugging') #endif // 1 -- cgit v1.2.3 From e49878a10009b0278121aa0d8a53cb47d73f5145 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Wed, 26 Sep 2018 07:52:28 +0200 Subject: pwx: Revision bump for rebuild_all.sh having the renamed debug -> debug-extra option --- pwx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwx b/pwx index f1fc319f4..a7a0ef894 160000 --- a/pwx +++ b/pwx @@ -1 +1 @@ -Subproject commit f1fc319f469266fabfc3d69036e220cb49de177a +Subproject commit a7a0ef894d5b221eeb675cea4f69a7d669221687 -- cgit v1.2.3 From 938f002d22d44380b2087a43ef1666cb762434cd Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Wed, 26 Sep 2018 17:58:00 +0200 Subject: Enhance the dealing with glibc-2.28 It appears that the necessary bits were already there, but commented out. When meson checked for 'struct statx', the inclusion of both sys/stat.h and linux/stat.h where commented out. Uncommenting them should be enough. --- meson.build | 11 ++--------- src/basic/missing.h | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 8b62c789e..45262dcff 100644 --- a/meson.build +++ b/meson.build @@ -491,8 +491,8 @@ decl_headers = ''' #include #include #include -//#include -//#include +#include +#include ''' # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail @@ -509,13 +509,6 @@ foreach decl : ['char16_t', conf.set10('HAVE_' + decl.underscorify().to_upper(), have) endforeach -conf.set10('HAVE_STRUCT_STATX_IN_SYS_STAT_H', cc.sizeof('struct statx', prefix : ''' -#include -''', args : '-D_GNU_SOURCE') > 0) -conf.set10('HAVE_STRUCT_STATX_IN_LINUX_STAT_H', cc.sizeof('struct statx', prefix : ''' -#include -''', args : '-D_GNU_SOURCE') > 0) - foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'], ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'], ['IFLA_VRF_TABLE', 'linux/if_link.h'], diff --git a/src/basic/missing.h b/src/basic/missing.h index 9be48eef8..fb1478548 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -1371,7 +1371,7 @@ struct fib_rule_uid_range { #define PF_KTHREAD 0x00200000 #endif -#if !HAVE_STRUCT_STATX_IN_SYS_STAT_H && !HAVE_STRUCT_STATX_IN_LINUX_STAT_H +#if ! HAVE_STRUCT_STATX struct statx_timestamp { int64_t tv_sec; uint32_t tv_nsec; -- cgit v1.2.3 From b0c24eee5154ec046725b108fdb3cded008afc00 Mon Sep 17 00:00:00 2001 From: Christoph Willing Date: Wed, 26 Sep 2018 23:14:02 +1000 Subject: Support system_bus_socket to be found in /var/run/dbus as well as /run/dbus. Currently the path to system_bus_socket is hardcoded to /run/dbus/system_bus_socket which works everywhere for systemd. However, distributions which do no symlink /var/run on /run will have it only accessible via /run/dbus/system_bus_socket which should be supported by elogind, too. Closes #77 Signed-off-by: Christoph Willing Sigend-off-by: Sven Eden --- meson.build | 6 ++++++ src/basic/def.h | 9 +++++++++ src/libelogind/sd-bus/test-bus-vtable.c | 8 ++++++++ 3 files changed, 23 insertions(+) diff --git a/meson.build b/meson.build index 45262dcff..550d7a674 100644 --- a/meson.build +++ b/meson.build @@ -204,6 +204,12 @@ if dbussystemservicedir == '' dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services') endif +#if 1 /// Will elogind find system_bus_socket in /run/dbus or /var/run/dbus ? +varrunissymllink = run_command('test', '-L', '/var/run').returncode() == 0 +message('Setting VARRUN_IS_SYMLINK to: @0@'.format(varrunissymllink)) +conf.set10('VARRUN_IS_SYMLINK', varrunissymllink) +#endif // 1 + pamlibdir = get_option('pamlibdir') if pamlibdir == '' pamlibdir = join_paths(rootlibdir, 'security') diff --git a/src/basic/def.h b/src/basic/def.h index 45b53c248..ee4c672ac 100644 --- a/src/basic/def.h +++ b/src/basic/def.h @@ -48,7 +48,16 @@ /* Note that we use the new /run prefix here (instead of /var/run) since we require them to be aliases and that way we * become independent of /var being mounted */ +#if 0 /// elogind should support both /run/dbus & /var/run/dbus (per Linux FHS) #define DEFAULT_SYSTEM_BUS_ADDRESS "unix:path=/run/dbus/system_bus_socket" +#else +/* Not all systems have dbus hierarchy in /run (as preferred by systemd) */ +#if VARRUN_IS_SYMLINK + #define DEFAULT_SYSTEM_BUS_ADDRESS "unix:path=/run/dbus/system_bus_socket" +#else + #define DEFAULT_SYSTEM_BUS_ADDRESS "unix:path=/var/run/dbus/system_bus_socket" +#endif // VARRUN_IS_SYMLINK +#endif // 0 #define DEFAULT_USER_BUS_ADDRESS_FMT "unix:path=%s/bus" #define PLYMOUTH_SOCKET { \ diff --git a/src/libelogind/sd-bus/test-bus-vtable.c b/src/libelogind/sd-bus/test-bus-vtable.c index fd9ad8121..5604aa668 100644 --- a/src/libelogind/sd-bus/test-bus-vtable.c +++ b/src/libelogind/sd-bus/test-bus-vtable.c @@ -8,7 +8,15 @@ #include "sd-bus-vtable.h" +#if 0 /// elogind should support both /run/dbus & /var/run/dbus (per Linux FHS) #define DEFAULT_BUS_PATH "unix:path=/run/dbus/system_bus_socket" +#else +#if VARRUN_IS_SYMLINK + #define DEFAULT_BUS_PATH "unix:path=/run/dbus/system_bus_socket" +#else + #define DEFAULT_BUS_PATH "unix:path=/var/run/dbus/system_bus_socket" +#endif // VARRUN_IS_SYMLINK +#endif // 0 struct context { bool quit; -- cgit v1.2.3 From eee8275c6ac591d293085ee5a4c0242242413403 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Fri, 28 Sep 2018 19:39:43 +0200 Subject: Prep v239: Unmask creation of systemshutdowndir and systemsleepdir. The creation of the system shutdown dir and the system sleep dir had been masked. This was an oversight that is now fixed. systemshutdowndir defaults to [/usr]/lib/elogind/system-shutdown systemsleepdir defaults to [/usr]/lib/elogind/system-sleep Executables in these folders are meant to run prior the system either shuts down or goes to sleep, including all variants. --- src/core/meson.build | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/meson.build b/src/core/meson.build index 22a3c6ba5..5e7b6981d 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -130,7 +130,7 @@ libcore_la_sources = files(''' '''.split()) #endif // 0 -#if 0 /// The rest is not needed by elogind, we use the sources directly in login +#if 0 /// Almost the rest is not needed by elogind, we use the sources directly in login # load_fragment_gperf_gperf = custom_target( # 'load-fragment-gperf.gperf', # input : 'load-fragment-gperf.gperf.m4', @@ -218,8 +218,10 @@ libcore_la_sources = files(''' # install_data('user.conf', # install_dir : pkgsysconfdir) # -# meson.add_install_script('sh', '-c', mkdir_p.format(systemshutdowndir)) -# meson.add_install_script('sh', '-c', mkdir_p.format(systemsleepdir)) +#endif // 0 +meson.add_install_script('sh', '-c', mkdir_p.format(systemshutdowndir)) +meson.add_install_script('sh', '-c', mkdir_p.format(systemsleepdir)) +#if 0 /// UNNEEDED by elogind # meson.add_install_script('sh', '-c', mkdir_p.format(systemgeneratordir)) # meson.add_install_script('sh', '-c', mkdir_p.format(usergeneratordir)) # -- cgit v1.2.3 From 48ed2296c6f7e463d12ff0e0f90e494d27eae239 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Fri, 28 Sep 2018 19:47:20 +0200 Subject: Prep v239: Add execution of executables in systemshutdowndir --- src/login/elogind-dbus.c | 18 +++++++++++++----- src/login/logind-dbus.c | 2 ++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/login/elogind-dbus.c b/src/login/elogind-dbus.c index bed528145..f359e1867 100644 --- a/src/login/elogind-dbus.c +++ b/src/login/elogind-dbus.c @@ -19,6 +19,7 @@ #include "elogind-dbus.h" +#include "exec-util.h" #include "process-util.h" #include "sd-messages.h" #include "sleep.h" @@ -74,9 +75,16 @@ static int bus_manager_log_shutdown( } /* elogind specific helper to make HALT and REBOOT possible. */ -static int run_helper(const char *helper) { +static int run_helper(const char *helper, const char *arg_verb) { + char *arguments[3]; + static const char* const dirs[] = { SYSTEM_SHUTDOWN_PATH, NULL }; int r = 0; + arguments[0] = NULL; + arguments[1] = (char*)arg_verb; + arguments[2] = NULL; + execute_directories(dirs, DEFAULT_TIMEOUT_USEC, NULL, NULL, arguments); + r = safe_fork_full(helper, NULL, 0, FORK_RESET_SIGNALS|FORK_REOPEN_LOG, NULL); if (r < 0) @@ -99,13 +107,13 @@ static int shutdown_or_sleep(Manager *m, HandleAction action) { switch (action) { case HANDLE_POWEROFF: - return run_helper(POWEROFF); + return run_helper(POWEROFF, "poweroff"); case HANDLE_REBOOT: - return run_helper(REBOOT); + return run_helper(REBOOT, "reboot"); case HANDLE_HALT: - return run_helper(HALT); + return run_helper(HALT, "halt"); case HANDLE_KEXEC: - return run_helper(KEXEC); + return run_helper(KEXEC, "kexec"); case HANDLE_SUSPEND: return do_sleep(m, "suspend"); case HANDLE_HIBERNATE: diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 9d7092869..acf50e62e 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -2440,7 +2440,9 @@ static int method_can_shutdown_or_sleep( action, result); } +#if 0 /// UNNEEDED by elogind finish: +#endif // 0 return sd_bus_reply_method_return(message, "s", result); } -- cgit v1.2.3 From a672a8d4083d2c8b0b3f623fe0d341e2b1f58182 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Fri, 28 Sep 2018 20:01:34 +0200 Subject: Prep v239: Touch .keep_dir into systemshutdowndir and systemsleepdir. Package managers like Portage strip empty directories. To ensure that these directories are still installed, we simply touch empty and hidden files into them. --- src/core/meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/meson.build b/src/core/meson.build index 5e7b6981d..10d29d5e6 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -221,6 +221,10 @@ libcore_la_sources = files(''' #endif // 0 meson.add_install_script('sh', '-c', mkdir_p.format(systemshutdowndir)) meson.add_install_script('sh', '-c', mkdir_p.format(systemsleepdir)) +#if 1 /// some package sytems like portage might strip empty directories created for elogind +meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@/.keep_dir'.format(systemshutdowndir)) +meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@/.keep_dir'.format(systemsleepdir)) +#endif // 1 #if 0 /// UNNEEDED by elogind # meson.add_install_script('sh', '-c', mkdir_p.format(systemgeneratordir)) # meson.add_install_script('sh', '-c', mkdir_p.format(usergeneratordir)) -- cgit v1.2.3 From eb70a7b3f2d48bfc7436eee89cf56d0f691c47c8 Mon Sep 17 00:00:00 2001 From: Lorenzo <37938460+DareDeb-User@users.noreply.github.com> Date: Fri, 28 Sep 2018 22:30:11 +0200 Subject: Create elogind-inhibit.xml Elogind is missing the man page for elogind-inhibit: this is just a copy of the systemd-inhibit manpage from systemd upstream, with 'systemd' replaced by 'elogind', where applicable. --- man/elogind-inhibit.xml | 157 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 man/elogind-inhibit.xml diff --git a/man/elogind-inhibit.xml b/man/elogind-inhibit.xml new file mode 100644 index 000000000..d095e1b05 --- /dev/null +++ b/man/elogind-inhibit.xml @@ -0,0 +1,157 @@ + + + + + + + + + elogind-inhibit + elogind + + + + elogind-inhibit + 1 + + + + elogind-inhibit + Execute a program with an inhibition lock taken + + + + + elogind-inhibit OPTIONS COMMAND ARGUMENTS + + + elogind-inhibit OPTIONS --list + + + + + Description + + elogind-inhibit may be used to execute a + program with a shutdown, sleep, or idle inhibitor lock taken. The + lock will be acquired before the specified command line is + executed and released afterwards. + + Inhibitor locks may be used to block or delay system sleep + and shutdown requests from the user, as well as automatic idle + handling of the OS. This is useful to avoid system suspends while + an optical disc is being recorded, or similar operations that + should not be interrupted. + + For more information see the Inhibitor + Lock Developer Documentation. + + + + Options + + The following options are understood: + + + + + + Takes a colon-separated list of one or more + operations to inhibit: + shutdown, + sleep, + idle, + handle-power-key, + handle-suspend-key, + handle-hibernate-key, + handle-lid-switch, + for inhibiting reboot/power-off/halt/kexec, + suspending/hibernating, the automatic idle detection, or the + low-level handling of the power/sleep key and the lid switch, + respectively. If omitted, defaults to + idle:sleep:shutdown. + + + + + + Takes a short, human-readable descriptive + string for the program taking the lock. If not passed, + defaults to the command line string. + + + + + + Takes a short, human-readable descriptive + string for the reason for taking the lock. Defaults to + "Unknown reason". + + + + + + Takes either block or + delay and describes how the lock is + applied. If block is used (the default), + the lock prohibits any of the requested operations without + time limit, and only privileged users may override it. If + delay is used, the lock can only delay the + requested operations for a limited time. If the time elapses, + the lock is ignored and the operation executed. The time limit + may be specified in + logind.conf5. + Note that delay is only available for + sleep and + shutdown. + + + + + + Lists all active inhibition locks instead of + acquiring one. + + + + + + + + + + + + Exit status + + Returns the exit status of the executed program. + + + + Example + + # elogind-inhibit wodim foobar.iso + + This burns the ISO image + foobar.iso on a CD using + wodim1, + and inhibits system sleeping, shutdown and idle while + doing so. + + + + + + See Also + + elogind1, + logind.conf5 + + + + -- cgit v1.2.3 From 863559071356459e9374a91e51c14e27c0a9b156 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Sat, 29 Sep 2018 13:12:05 +0200 Subject: Prep v239: Mask unneeded test in test-strip-ansi The final test use the outcome of the already masked part that utilizes terminal_urlify_path(). That function is masked, because it is nowhere used within elogind. The previously unmasked final test used the outcome of that already masked part and therefore crashed. Bug: https://github.com/elogind/elogind/issues/81 Closes: https://github.com/elogind/elogind/issues/81 Signed-of-by: Sven Eden --- man/rules/meson.build | 3 ++- src/test/test-strip-tab-ansi.c | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/man/rules/meson.build b/man/rules/meson.build index 3a47be9da..74191d00b 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -1,6 +1,7 @@ # Do not edit. Generated by make-man-rules.py. manpages = [ -['elogind', '8', [], ''], +['elogind-inhibit', '1', [], ''], + ['elogind', '8', [], ''], ['elogind.syntax', '7', [], ''], ['loginctl', '1', [], ''], ['logind.conf', '5', [], ''], diff --git a/src/test/test-strip-tab-ansi.c b/src/test/test-strip-tab-ansi.c index 8ee10fd0c..27e2a240e 100644 --- a/src/test/test-strip-tab-ansi.c +++ b/src/test/test-strip-tab-ansi.c @@ -8,12 +8,13 @@ #include "util.h" int main(int argc, char *argv[]) { -#if 0 /// urlified is UNNEEDED by elogind +#if 0 /// urlified and z are UNNEEDED by elogind _cleanup_free_ char *urlified = NULL, *q = NULL, *qq = NULL; + char *p, *z; #else _cleanup_free_ char *q = NULL, *qq = NULL; + char *p; #endif // 0 - char *p, *z; assert_se(p = strdup("\tFoobar\tbar\twaldo\t")); assert_se(strip_tab_ansi(&p, NULL, NULL)); @@ -46,7 +47,6 @@ int main(int argc, char *argv[]) { printf("<%s>\n", p); assert_se(streq(p, "something i am a fabulous link something-else")); p = mfree(p); -#endif // 0 /* Truncate the formatted string in the middle of an ANSI sequence (in which case we shouldn't touch the * incomplete sequence) */ @@ -57,6 +57,7 @@ int main(int argc, char *argv[]) { assert_se(strip_tab_ansi(&q, NULL, NULL)); assert_se(streq(q, qq)); } +#endif // 0 return 0; } -- cgit v1.2.3 From e143b8013b96fca5d5ef4a73fe255daed3aa1ec3 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Mon, 15 Oct 2018 08:48:17 +0200 Subject: 238/239 : Fix session finalization While migrating the v237/v238 commits, a migration error caused session_may_gc() to always return false. This caused closed sessions to stay on state "closing" forever. Bug: https://github.com/elogind/elogind/issues/82 Closes: https://github.com/elogind/elogind/issues/82 Signed-off-by: Sven Eden --- src/login/logind-session.c | 2 +- src/login/logind.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/login/logind-session.c b/src/login/logind-session.c index e0daa4440..fedf58358 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -1068,8 +1068,8 @@ bool session_may_gc(Session *s, bool drop_not_started) { return false; if (s->scope && manager_unit_is_active(s->manager, s->scope)) -#endif // 0 return false; +#endif // 0 return true; } diff --git a/src/login/logind.c b/src/login/logind.c index db26701dd..c7acb05cb 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -784,9 +784,9 @@ static int manager_connect_bus(Manager *m) { "Subscribe", NULL, NULL, NULL); -#endif // 0 if (r < 0) return log_error_errno(r, "Failed to enable subscription: %m"); +#endif // 0 r = sd_bus_request_name_async(m->bus, NULL, "org.freedesktop.login1", 0, NULL, NULL); if (r < 0) @@ -969,8 +969,8 @@ static int manager_connect_udev(Manager *m) { return r; } - /* Don't bother watching VCSA devices, if nobody cares */ #if 0 /// elogind does not support autospawning of vts + /* Don't bother watching VCSA devices, if nobody cares */ if (m->n_autovts > 0 && m->console_active_fd >= 0) { m->udev_vcsa_monitor = udev_monitor_new_from_netlink(m->udev, "udev"); -- cgit v1.2.3 From 7f1e80bff4967f9a7b0d7ff79e02856ab94b6c1d Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Tue, 16 Oct 2018 19:57:45 +0200 Subject: Prep v239: Fix an issue with program_invocation[_short]_name : The old implementation was done assuming that only glibc provides both program_invocation_name and program_invocation_short_name. This worked well for users using musl-libc with the library having been built without -D_GNU_SOURCE. However, alternative libc implementations that actually do provide these variables, could cause elogind to crash. To be on the safe side, we now actually check whether both these variables are present by letting meson check whether a code snippet accessing these compiles and links. --- cb/elogind.cbp | 5 +++++ meson.build | 16 ++++++++++++++++ src/shared/musl_missing.c | 8 ++++---- src/shared/musl_missing.h | 5 ----- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/cb/elogind.cbp b/cb/elogind.cbp index f612e9176..387e057e3 100644 --- a/cb/elogind.cbp +++ b/cb/elogind.cbp @@ -1118,6 +1118,11 @@