chiark / gitweb /
Add sysv init scripts and splitoff pam module
authorAndreas Messer <andi@bastelmap.de>
Fri, 5 Jan 2018 19:19:02 +0000 (20:19 +0100)
committerAndreas Messer <andi@bastelmap.de>
Fri, 5 Jan 2018 19:19:02 +0000 (20:19 +0100)
debian/control
debian/elogind.init [new file with mode: 0644]
debian/elogind.install
debian/extra/elogind [new file with mode: 0644]
debian/libelogind.install
debian/libpam-elogind.install [new file with mode: 0644]
debian/libpam-elogind.postinst [new file with mode: 0755]
debian/libpam-elogind.prerm [new file with mode: 0755]

index 030d44ebab4e8e87cb4fc08ff4e8cf623724ec6f..2ab734c4aebf5b13b7846973c1b8796ddde80637 100644 (file)
@@ -36,7 +36,8 @@ Multi-Arch: same
 Pre-Depends: debconf, ${misc:Pre-Depends}
 Depends: ${shlibs:Depends},
          ${misc:Depends},
-         libelogind (= ${binary:Version})
+         libelogind (= ${binary:Version}),
+         libpam-elogind (= ${binary:Version})
 Recommends: dbus (>= 1.4), policykit-1
 Conflicts: openrc
 Description: user, seat and session management daemon
@@ -76,3 +77,14 @@ Description: libelogind development files
   This package contains the files needed for developing applications that 
   use libelogind
 
+Package: libpam-elogind
+Section: admin
+Priority: optional
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends:  ${misc:Pre-Depends}
+Depends: ${shlibs:Depends},
+         ${misc:Depends},
+         libpam-runtime
+Provides: libpam-systemd
+Description: elogind PAM module
diff --git a/debian/elogind.init b/debian/elogind.init
new file mode 100644 (file)
index 0000000..6c1177e
--- /dev/null
@@ -0,0 +1,103 @@
+#! /bin/sh
+
+### BEGIN INIT INFO
+# Provides:    logind
+# Required-Start:      $dbus $remote_fs $syslog
+# Required-Stop:       $dbus $remote_fs $syslog
+# Default-Start:       2 3 4 5
+# Default-Stop:                
+# Short-Description:   elogind session management daemon
+### END INIT INFO
+
+set -e
+
+# /etc/init.d/elogind: start and stop the elogind session management daemon
+
+ELOGIND=/lib/elogind/elogind
+
+test -x $ELOGIND || exit 0
+
+umask 022
+
+. /lib/lsb/init-functions
+
+ELOGIND_OPTS="-D"
+
+# Are we running from init?
+run_by_init() {
+    ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
+}
+
+check_for_upstart() {
+  if init_is_upstart; then
+         exit $1
+  fi
+}
+
+export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
+
+case "$1" in
+  start)
+       check_for_upstart 1
+       log_daemon_msg "Starting session management daemon" "elogind" || true
+       if start-stop-daemon --start --quiet --oknodo --pidfile /run/elogin.pid --exec $ELOGIND -- $ELOGIND_OPTS; then
+           log_end_msg 0 || true
+       else
+           log_end_msg 1 || true
+       fi
+       ;;
+  stop)
+       check_for_upstart 0
+       log_daemon_msg "Stopping session management daemon" "elogind" || true
+       if start-stop-daemon --stop --quiet --oknodo --pidfile /run/elogind.pid; then
+           log_end_msg 0 || true
+       else
+           log_end_msg 1 || true
+       fi
+       ;;
+  reload|force-reload|restart)
+       check_for_upstart 1
+       log_daemon_msg "Restarting session management daemon" "elogind" || true
+       start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /run/elogind.pid
+       if start-stop-daemon --start --quiet --oknodo --pidfile /run/elogind.pid --exec $ELOGIND -- $ELOGIND_OPTS; then
+           log_end_msg 0 || true
+       else
+           log_end_msg 1 || true
+       fi
+       ;;
+  try-restart)
+       check_for_upstart 1
+       log_daemon_msg "Restarting session management daemon" "elogind" || true
+       RET=0
+       start-stop-daemon --stop --quiet --retry 30 --pidfile /run/elogind.pid || RET="$?"
+       case $RET in
+           0)
+               # old daemon stopped
+               if start-stop-daemon --start --quiet --oknodo --pidfile /run/elogind.pid --exec $ELOGIND -- $ELOGIND_OPTS; then
+                   log_end_msg 0 || true
+               else
+                   log_end_msg 1 || true
+               fi
+               ;;
+           1)
+               # daemon not running
+               log_progress_msg "(not running)" || true
+               log_end_msg 0 || true
+               ;;
+           *)
+               # failed to stop
+               log_progress_msg "(failed to stop)" || true
+               log_end_msg 1 || true
+               ;;
+       esac
+       ;;
+  status)
+       check_for_upstart 1
+       status_of_proc -p /run/elogind.pid $ELOGIND elogind && exit 0 || exit $?
+       ;;
+  *)
+       log_action_msg "Usage: /etc/init.d/elogind {start|stop|reload|force-reload|restart|try-restart|status}" || true
+       exit 1
+esac
+
+exit 0
index d405bcef380c1837deb2fde5921dc7955b0d22ac..9483f24aad4174d0291068d73d41f0d6685ad659 100644 (file)
@@ -1,7 +1,6 @@
 bin/loginctl
 bin/elogind-inhibit
 etc/elogind/logind.conf
-etc/pam.d/elogind-user
 lib/elogind/elogind
 lib/elogind/elogind-cgroups-agent
 lib/udev/rules.d/*.rules
@@ -12,7 +11,6 @@ usr/share/factory/*
 usr/share/man/man1/loginctl.1
 usr/share/man/man5/logind.conf.5
 usr/share/man/man7/elogind.*.7
-usr/share/man/man8/pam_elogind.8
 usr/share/man/man8/elogind.8
 usr/share/polkit-1/*
 usr/share/zsh/*
diff --git a/debian/extra/elogind b/debian/extra/elogind
new file mode 100644 (file)
index 0000000..e66eebb
--- /dev/null
@@ -0,0 +1,7 @@
+Name: elogind Session Management
+Default: yes
+Priority: 0
+Session-Interactive-Only: yes
+Session-Type: Additional
+Session-Final:
+       optional                        pam_elogind.so
index 62e19c2ba121636cd5c9b3f744bc7585cfced25a..964806c1d9820f8411990e978dbf761dc918168b 100644 (file)
@@ -1,2 +1 @@
 lib/*/libelogind.so.*
-lib/*/security/pam_elogind.so
diff --git a/debian/libpam-elogind.install b/debian/libpam-elogind.install
new file mode 100644 (file)
index 0000000..c6dc41c
--- /dev/null
@@ -0,0 +1,4 @@
+etc/pam.d/elogind-user
+lib/*/security/pam_elogind.so
+usr/share/man/man8/pam_elogind.8
+debian/extra/elogind /usr/share/pam-configs/
diff --git a/debian/libpam-elogind.postinst b/debian/libpam-elogind.postinst
new file mode 100755 (executable)
index 0000000..9310a14
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+pam-auth-update --package
+
+
diff --git a/debian/libpam-elogind.prerm b/debian/libpam-elogind.prerm
new file mode 100755 (executable)
index 0000000..11329dd
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = remove ]; then
+       pam-auth-update --package --remove consolekit
+fi
+
+