Browse Source

Revert in-tree changes to upstream src.

tags/debian-devuan_common
Mark Hindley 3 years ago
parent
commit
75c790ef29
7 changed files with 25 additions and 15 deletions
  1. +0
    -2
      src/basic/login-util.h
  2. +9
    -3
      src/core/meson.build
  3. +0
    -3
      src/libelogind/sd-daemon/sd-daemon.c
  4. +13
    -5
      src/login/elogind-dbus.c
  5. +2
    -0
      src/login/logind-dbus.c
  6. +1
    -0
      src/login/logind-user.c
  7. +0
    -2
      src/systemd/sd-daemon.h

+ 0
- 2
src/basic/login-util.h View File

@@ -6,8 +6,6 @@

bool session_id_valid(const char *id);

#if 0 /// UNNEEDED by elogind
static inline bool logind_running(void) {
return access("/run/systemd/seats/", F_OK) >= 0;
}
#endif // 0

+ 9
- 3
src/core/meson.build View File

@@ -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,14 @@ 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 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))
#


+ 0
- 3
src/libelogind/sd-daemon/sd-daemon.c View File

@@ -305,7 +305,6 @@ _public_ int sd_is_socket_inet(int fd, int family, int type, int listening, uint
return 1;
}

#if 0 /// UNNEEDED by elogind
_public_ int sd_is_socket_sockaddr(int fd, int type, const struct sockaddr* addr, unsigned addr_len, int listening) {
union sockaddr_union sockaddr = {};
socklen_t l = sizeof(sockaddr);
@@ -363,7 +362,6 @@ _public_ int sd_is_socket_sockaddr(int fd, int type, const struct sockaddr* addr
sizeof(in->sin6_addr.s6_addr)) == 0;
}
}
#endif // 0

_public_ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) {
union sockaddr_union sockaddr = {};
@@ -622,7 +620,6 @@ _public_ int sd_notifyf(int unset_environment, const char *format, ...) {
}

_public_ int sd_booted(void) {
#if 0 /// With elogind, the system is (should never be) booted by systemd
/* We test whether the runtime unit file directory has been
* created. This takes place in mount-setup.c, so is
* guaranteed to happen very early during boot. */


+ 13
- 5
src/login/elogind-dbus.c View File

@@ -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:


+ 2
- 0
src/login/logind-dbus.c View File

@@ -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);
}



+ 1
- 0
src/login/logind-user.c View File

@@ -483,6 +483,7 @@ int user_stop(User *u, bool force) {
#if 1 /// elogind must queue this user again
user_add_to_gc_queue(u);
#endif // 1

return r;
}



+ 0
- 2
src/systemd/sd-daemon.h View File

@@ -129,7 +129,6 @@ int sd_is_socket(int fd, int family, int type, int listening);
*/
int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port);

#if 0 /// unsupported by elogind
/*
Helper call for identifying a passed file descriptor. Returns 1 if the
file descriptor is an Internet socket of the specified type
@@ -141,7 +140,6 @@ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port
See sd_is_socket_sockaddr(3) for more information.
*/
int sd_is_socket_sockaddr(int fd, int type, const struct sockaddr* addr, unsigned addr_len, int listening);
#endif // 0

/*
Helper call for identifying a passed file descriptor. Returns 1 if


Loading…
Cancel
Save