build-sys: add --without-kill-user-processes configure option
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 12 Apr 2016 02:51:31 +0000 (22:51 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 21 Apr 2016 04:21:32 +0000 (00:21 -0400)
Makefile.am
NEWS
configure.ac
src/login/.gitignore
src/login/logind.c
src/login/logind.conf.in [moved from src/login/logind.conf with 95% similarity]

index c566b1f..e97d5bd 100644 (file)
@@ -5725,7 +5725,7 @@ dist_dbussystemservice_DATA += \
 dist_dbuspolicy_DATA += \
        src/login/org.freedesktop.login1.conf
 
-dist_pkgsysconf_DATA += \
+nodist_pkgsysconf_DATA += \
        src/login/logind.conf
 
 polkitpolicy_files += \
@@ -5762,7 +5762,8 @@ gperf_gperf_sources += \
 EXTRA_DIST += \
        src/login/71-seat.rules.in \
        src/login/73-seat-late.rules.in \
-       units/systemd-logind.service.in
+       units/systemd-logind.service.in \
+       src/login/logind.conf.in
 
 # ------------------------------------------------------------------------------
 if HAVE_PAM
@@ -5879,6 +5880,7 @@ substitutions = \
        '|NTP_SERVERS=$(NTP_SERVERS)|' \
        '|DNS_SERVERS=$(DNS_SERVERS)|' \
        '|DEFAULT_DNSSEC_MODE=$(DEFAULT_DNSSEC_MODE)|' \
+       '|KILL_USER_PROCESSES=$(KILL_USER_PROCESSES)|' \
        '|systemuidmax=$(SYSTEM_UID_MAX)|' \
        '|systemgidmax=$(SYSTEM_GID_MAX)|' \
        '|TTY_GID=$(TTY_GID)|' \
diff --git a/NEWS b/NEWS
index 99e6b51..7199a67 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -43,6 +43,9 @@ CHANGES WITH 230 in spe:
           logged out, lingering must be enabled for them. See loginctl(1)
           for details.
 
+          Previous defaults can be restored at compile time by the
+          --without-kill-user-processes option.
+
         * The unified cgroup hierarchy added in Linux 4.5 is now supported.
           Use systemd.unified_cgroup_hierarchy=1 on the kernel command line
           to enable.
index 7b9e64a..d4e8ab6 100644 (file)
@@ -1014,6 +1014,16 @@ fi
 AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
 AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
 
+AC_ARG_WITH([kill-user-processes],
+        [AS_HELP_STRING([--without-kill-user-processes], [Set logind's KillUserProcesses=no by default])])
+AS_IF([test "$with_kill_user_processes" != "no"],
+       [kill_user_processes=true
+        KILL_USER_PROCESSES=yes],
+       [kill_user_processes=false
+        KILL_USER_PROCESSES=no])
+AC_DEFINE_UNQUOTED(KILL_USER_PROCESSES, [$kill_user_processes], [Default KillUserProcesses setting])
+AC_SUBST(KILL_USER_PROCESSES)
+
 # ------------------------------------------------------------------------------
 have_machined=no
 AC_ARG_ENABLE(machined, AS_HELP_STRING([--disable-machined], [disable machine daemon]))
@@ -1554,106 +1564,107 @@ AC_OUTPUT
 AC_MSG_RESULT([
         $PACKAGE_NAME $VERSION
 
-        libcryptsetup:           ${have_libcryptsetup}
-        PAM:                     ${have_pam}
-        AUDIT:                   ${have_audit}
-        IMA:                     ${have_ima}
-        AppArmor:                ${have_apparmor}
-        SELinux:                 ${have_selinux}
-        SECCOMP:                 ${have_seccomp}
-        SMACK:                   ${have_smack}
-        ZLIB:                    ${have_zlib}
-        XZ:                      ${have_xz}
-        LZ4:                     ${have_lz4}
-        BZIP2:                   ${have_bzip2}
-        ACL:                     ${have_acl}
-        GCRYPT:                  ${have_gcrypt}
-        QRENCODE:                ${have_qrencode}
-        MICROHTTPD:              ${have_microhttpd}
-        GNUTLS:                  ${have_gnutls}
-        libcurl:                 ${have_libcurl}
-        libidn:                  ${have_libidn}
-        libiptc:                 ${have_libiptc}
-        ELFUTILS:                ${have_elfutils}
-        binfmt:                  ${have_binfmt}
-        vconsole:                ${have_vconsole}
-        quotacheck:              ${have_quotacheck}
-        tmpfiles:                ${have_tmpfiles}
-        sysusers:                ${have_sysusers}
-        firstboot:               ${have_firstboot}
-        randomseed:              ${have_randomseed}
-        backlight:               ${have_backlight}
-        rfkill:                  ${have_rfkill}
-        logind:                  ${have_logind}
-        machined:                ${have_machined}
-        importd:                 ${have_importd}
-        hostnamed:               ${have_hostnamed}
-        timedated:               ${have_timedated}
-        timesyncd:               ${have_timesyncd}
-        Default NTP servers:     ${NTP_SERVERS}
-        time epoch:              ${TIME_EPOCH}
-        localed:                 ${have_localed}
-        networkd:                ${have_networkd}
-        resolved:                ${have_resolved}
-        Default DNS servers:     ${DNS_SERVERS}
-        Default DNSSEC mode:     ${DEFAULT_DNSSEC_MODE}
-        coredump:                ${have_coredump}
-        polkit:                  ${have_polkit}
-        efi:                     ${have_efi}
-        gnuefi:                  ${have_gnuefi}
-        efi arch:                ${EFI_ARCH}
-        EFI machine type:        ${EFI_MACHINE_TYPE_NAME}
-        EFI CC                   ${EFI_CC}
-        EFI libdir:              ${EFI_LIB_DIR}
-        EFI ldsdir:              ${EFI_LDS_DIR}
-        EFI includedir:          ${EFI_INC_DIR}
-        kmod:                    ${have_kmod}
-        xkbcommon:               ${have_xkbcommon}
-        blkid:                   ${have_blkid}
-        libmount:                ${have_libmount}
-        dbus:                    ${have_dbus}
-        nss-myhostname:          ${have_myhostname}
-        hwdb:                    ${enable_hwdb}
-        tpm:                     ${have_tpm}
-        kdbus:                   ${have_kdbus}
-        Python:                  ${have_python}
-        man pages:               ${have_manpages}
-        test coverage:           ${have_coverage}
-        Split /usr:              ${enable_split_usr}
-        SysV compatibility:      ${SYSTEM_SYSV_COMPAT}
-        utmp/wtmp support:       ${have_utmp}
-        ldconfig support:        ${enable_ldconfig}
-        hibernate support:       ${enable_hibernate}
-        extra debugging:         ${enable_debug}
-        tests:                   ${enable_tests}
-
-        prefix:                  ${prefix}
-        rootprefix:              ${with_rootprefix}
-        sysconf dir:             ${sysconfdir}
-        datarootdir:             ${datarootdir}
-        includedir:              ${includedir}
-        lib dir:                 ${libdir}
-        rootlib dir:             ${with_rootlibdir}
-        SysV init scripts:       ${SYSTEM_SYSVINIT_PATH}
-        SysV rc?.d directories:  ${SYSTEM_SYSVRCND_PATH}
-        Build Python:            ${PYTHON}
-        PAM modules dir:         ${with_pamlibdir}
-        PAM configuration dir:   ${with_pamconfdir}
-        D-Bus policy dir:        ${with_dbuspolicydir}
-        D-Bus session dir:       ${with_dbussessionservicedir}
-        D-Bus system dir:        ${with_dbussystemservicedir}
-        Bash completions dir:    ${with_bashcompletiondir}
-        Zsh completions dir:     ${with_zshcompletiondir}
-        Extra start script:      ${RC_LOCAL_SCRIPT_PATH_START}
-        Extra stop script:       ${RC_LOCAL_SCRIPT_PATH_STOP}
-        Wheel group:             ${have_wheel_group}
-        Debug shell:             ${SUSHELL} @ ${DEBUGTTY}
-        TTY GID:                 ${TTY_GID}
-        Maximum System UID:      ${SYSTEM_UID_MAX}
-        Maximum System GID:      ${SYSTEM_GID_MAX}
-        Certificate root:        ${CERTIFICATEROOT}
-
-        CFLAGS:                  ${OUR_CFLAGS} ${CFLAGS}
-        CPPFLAGS:                ${OUR_CPPFLAGS} ${CPPFLAGS}
-        LDFLAGS:                 ${OUR_LDFLAGS} ${LDFLAGS}
+        libcryptsetup:                     ${have_libcryptsetup}
+        PAM:                               ${have_pam}
+        AUDIT:                             ${have_audit}
+        IMA:                               ${have_ima}
+        AppArmor:                          ${have_apparmor}
+        SELinux:                           ${have_selinux}
+        SECCOMP:                           ${have_seccomp}
+        SMACK:                             ${have_smack}
+        ZLIB:                              ${have_zlib}
+        XZ:                                ${have_xz}
+        LZ4:                               ${have_lz4}
+        BZIP2:                             ${have_bzip2}
+        ACL:                               ${have_acl}
+        GCRYPT:                            ${have_gcrypt}
+        QRENCODE:                          ${have_qrencode}
+        MICROHTTPD:                        ${have_microhttpd}
+        GNUTLS:                            ${have_gnutls}
+        libcurl:                           ${have_libcurl}
+        libidn:                            ${have_libidn}
+        libiptc:                           ${have_libiptc}
+        ELFUTILS:                          ${have_elfutils}
+        binfmt:                            ${have_binfmt}
+        vconsole:                          ${have_vconsole}
+        quotacheck:                        ${have_quotacheck}
+        tmpfiles:                          ${have_tmpfiles}
+        sysusers:                          ${have_sysusers}
+        firstboot:                         ${have_firstboot}
+        randomseed:                        ${have_randomseed}
+        backlight:                         ${have_backlight}
+        rfkill:                            ${have_rfkill}
+        logind:                            ${have_logind}
+        Default KillUserProcesses setting: ${KILL_USER_PROCESSES}
+        machined:                          ${have_machined}
+        importd:                           ${have_importd}
+        hostnamed:                         ${have_hostnamed}
+        timedated:                         ${have_timedated}
+        timesyncd:                         ${have_timesyncd}
+        Default NTP servers:               ${NTP_SERVERS}
+        time epoch:                        ${TIME_EPOCH}
+        localed:                           ${have_localed}
+        networkd:                          ${have_networkd}
+        resolved:                          ${have_resolved}
+        Default DNS servers:               ${DNS_SERVERS}
+        Default DNSSEC mode:               ${DEFAULT_DNSSEC_MODE}
+        coredump:                          ${have_coredump}
+        polkit:                            ${have_polkit}
+        efi:                               ${have_efi}
+        gnuefi:                            ${have_gnuefi}
+        efi arch:                          ${EFI_ARCH}
+        EFI machine type:                  ${EFI_MACHINE_TYPE_NAME}
+        EFI CC                             ${EFI_CC}
+        EFI libdir:                        ${EFI_LIB_DIR}
+        EFI ldsdir:                        ${EFI_LDS_DIR}
+        EFI includedir:                    ${EFI_INC_DIR}
+        kmod:                              ${have_kmod}
+        xkbcommon:                         ${have_xkbcommon}
+        blkid:                             ${have_blkid}
+        libmount:                          ${have_libmount}
+        dbus:                              ${have_dbus}
+        nss-myhostname:                    ${have_myhostname}
+        hwdb:                              ${enable_hwdb}
+        tpm:                               ${have_tpm}
+        kdbus:                             ${have_kdbus}
+        Python:                            ${have_python}
+        man pages:                         ${have_manpages}
+        test coverage:                     ${have_coverage}
+        Split /usr:                        ${enable_split_usr}
+        SysV compatibility:                ${SYSTEM_SYSV_COMPAT}
+        utmp/wtmp support:                 ${have_utmp}
+        ldconfig support:                  ${enable_ldconfig}
+        hibernate support:                 ${enable_hibernate}
+        extra debugging:                   ${enable_debug}
+        tests:                             ${enable_tests}
+
+        prefix:                            ${prefix}
+        rootprefix:                        ${with_rootprefix}
+        sysconf dir:                       ${sysconfdir}
+        datarootdir:                       ${datarootdir}
+        includedir:                        ${includedir}
+        lib dir:                           ${libdir}
+        rootlib dir:                       ${with_rootlibdir}
+        SysV init scripts:                 ${SYSTEM_SYSVINIT_PATH}
+        SysV rc?.d directories:            ${SYSTEM_SYSVRCND_PATH}
+        Build Python:                      ${PYTHON}
+        PAM modules dir:                   ${with_pamlibdir}
+        PAM configuration dir:             ${with_pamconfdir}
+        D-Bus policy dir:                  ${with_dbuspolicydir}
+        D-Bus session dir:                 ${with_dbussessionservicedir}
+        D-Bus system dir:                  ${with_dbussystemservicedir}
+        Bash completions dir:              ${with_bashcompletiondir}
+        Zsh completions dir:               ${with_zshcompletiondir}
+        Extra start script:                ${RC_LOCAL_SCRIPT_PATH_START}
+        Extra stop script:                 ${RC_LOCAL_SCRIPT_PATH_STOP}
+        Wheel group:                       ${have_wheel_group}
+        Debug shell:                       ${SUSHELL} @ ${DEBUGTTY}
+        TTY GID:                           ${TTY_GID}
+        Maximum System UID:                ${SYSTEM_UID_MAX}
+        Maximum System GID:                ${SYSTEM_GID_MAX}
+        Certificate root:                  ${CERTIFICATEROOT}
+
+        CFLAGS:   ${OUR_CFLAGS} ${CFLAGS}
+        CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
+        LDFLAGS:  ${OUR_LDFLAGS} ${LDFLAGS}
 ])
index 39088ec..3a8ba49 100644 (file)
@@ -1,4 +1,5 @@
 /logind-gperf.c
+/logind.conf
 /org.freedesktop.login1.policy
 /71-seat.rules
 /73-seat-late.rules
index 6163467..a48e2fc 100644 (file)
@@ -64,7 +64,7 @@ static void manager_reset_config(Manager *m) {
         m->runtime_dir_size = PAGE_ALIGN((size_t) (physical_memory() / 10)); /* 10% */
         m->user_tasks_max = UINT64_C(12288);
 
-        m->kill_user_processes = true;
+        m->kill_user_processes = KILL_USER_PROCESSES;
 
         m->kill_only_users = strv_free(m->kill_only_users);
         m->kill_exclude_users = strv_free(m->kill_exclude_users);
similarity index 95%
rename from src/login/logind.conf
rename to src/login/logind.conf.in
index 8316bb4..3c96def 100644 (file)
@@ -14,7 +14,7 @@
 [Login]
 #NAutoVTs=6
 #ReserveVT=6
-#KillUserProcesses=yes
+#KillUserProcesses=@KILL_USER_PROCESSES@
 #KillOnlyUsers=
 #KillExcludeUsers=root
 #InhibitDelayMaxSec=5