aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Hughes <davidhughes205@gmail.com>2021-04-13 09:15:18 -0400
committerDave Hughes <davidhughes205@gmail.com>2021-04-13 09:15:18 -0400
commitdffbec4f1321b7b80bc4efad6bdc78f46430c5aa (patch)
treefcaa9ad00a0fe9122bae2abb09986a04b2236253 /sys-auth/elogind/files
parentdev-lang/rust: sync with ::smaeul (diff)
downloadmusl-dffbec4f1321b7b80bc4efad6bdc78f46430c5aa.tar.gz
musl-dffbec4f1321b7b80bc4efad6bdc78f46430c5aa.tar.bz2
musl-dffbec4f1321b7b80bc4efad6bdc78f46430c5aa.zip
sys-auth/elogind: sync with ::gentoo
Package-Manager: Portage-3.0.18, Repoman-3.0.3 RepoMan-Options: --force Signed-off-by: Dave Hughes <davidhughes205@gmail.com>
Diffstat (limited to 'sys-auth/elogind/files')
-rw-r--r--sys-auth/elogind/files/0001-musl-mallinfo.patch36
-rw-r--r--sys-auth/elogind/files/elogind-243.7-musl-mallinfo.patch35
-rw-r--r--sys-auth/elogind/files/elogind.init-r127
3 files changed, 63 insertions, 35 deletions
diff --git a/sys-auth/elogind/files/0001-musl-mallinfo.patch b/sys-auth/elogind/files/0001-musl-mallinfo.patch
new file mode 100644
index 0000000..41a8575
--- /dev/null
+++ b/sys-auth/elogind/files/0001-musl-mallinfo.patch
@@ -0,0 +1,36 @@
+diff -Naur a/src/basic/selinux-util.c b/src/basic/selinux-util.c
+--- a/src/basic/selinux-util.c 2021-03-13 17:08:40.496016258 -0500
++++ b/src/basic/selinux-util.c 2021-03-13 17:10:54.928016323 -0500
+@@ -75,7 +75,6 @@
+ int mac_selinux_init(void) {
+ #if HAVE_SELINUX
+ usec_t before_timestamp, after_timestamp;
+- struct mallinfo before_mallinfo, after_mallinfo;
+ char timespan[FORMAT_TIMESPAN_MAX];
+ int l;
+
+@@ -87,7 +86,6 @@
+ if (!mac_selinux_use())
+ return 0;
+
+- before_mallinfo = mallinfo();
+ before_timestamp = now(CLOCK_MONOTONIC);
+
+ label_hnd = selabel_open(SELABEL_CTX_FILE, NULL, 0);
+@@ -95,14 +93,9 @@
+ return log_enforcing_errno(errno, "Failed to initialize SELinux labeling handle: %m");
+
+ after_timestamp = now(CLOCK_MONOTONIC);
+- after_mallinfo = mallinfo();
+-
+- l = after_mallinfo.uordblks > before_mallinfo.uordblks ? after_mallinfo.uordblks - before_mallinfo.uordblks : 0;
+-
+- log_debug("Successfully loaded SELinux database in %s, size on heap is %iK.",
+- format_timespan(timespan, sizeof(timespan), after_timestamp - before_timestamp, 0),
+- (l+1023)/1024);
+
++ log_debug("Successfully loaded SELinux database in %s",
++ format_timespan(timespan, sizeof(timespan), after_timestamp - before_timestamp, 0));
+ #endif
+ return 0;
+ }
diff --git a/sys-auth/elogind/files/elogind-243.7-musl-mallinfo.patch b/sys-auth/elogind/files/elogind-243.7-musl-mallinfo.patch
deleted file mode 100644
index b9b1700..0000000
--- a/sys-auth/elogind/files/elogind-243.7-musl-mallinfo.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff -Naur elogind-243.7.orig/src/basic/selinux-util.c elogind-243.7/src/basic/selinux-util.c
---- elogind-243.7.orig/src/basic/selinux-util.c 2020-03-12 20:33:40.000000000 +0100
-+++ elogind-243.7/src/basic/selinux-util.c 2020-07-03 12:29:16.140181565 +0200
-@@ -63,7 +63,6 @@
-
- #if HAVE_SELINUX
- usec_t before_timestamp, after_timestamp;
-- struct mallinfo before_mallinfo, after_mallinfo;
-
- if (label_hnd)
- return 0;
-@@ -71,7 +70,6 @@
- if (!mac_selinux_use())
- return 0;
-
-- before_mallinfo = mallinfo();
- before_timestamp = now(CLOCK_MONOTONIC);
-
- label_hnd = selabel_open(SELABEL_CTX_FILE, NULL, 0);
-@@ -83,13 +81,9 @@
- int l;
-
- after_timestamp = now(CLOCK_MONOTONIC);
-- after_mallinfo = mallinfo();
-
-- l = after_mallinfo.uordblks > before_mallinfo.uordblks ? after_mallinfo.uordblks - before_mallinfo.uordblks : 0;
--
-- log_debug("Successfully loaded SELinux database in %s, size on heap is %iK.",
-- format_timespan(timespan, sizeof(timespan), after_timestamp - before_timestamp, 0),
-- (l+1023)/1024);
-+ log_debug("Successfully loaded SELinux database in %s",
-+ format_timespan(timespan, sizeof(timespan), after_timestamp - before_timestamp, 0));
- }
- #endif
-
diff --git a/sys-auth/elogind/files/elogind.init-r1 b/sys-auth/elogind/files/elogind.init-r1
new file mode 100644
index 0000000..56acb1c
--- /dev/null
+++ b/sys-auth/elogind/files/elogind.init-r1
@@ -0,0 +1,27 @@
+#!/sbin/openrc-run
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need dbus
+
+ # Make sure elogind is up before xdm starts any dm
+ before xdm
+
+ use logger
+}
+
+start() {
+ ebegin "Starting elogind"
+
+ start-stop-daemon --start --quiet \
+ --pidfile "${ELOGIND_PIDFILE}" \
+ --exec "${ELOGIND_EXEC}" -- --daemon
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping elogind"
+ start-stop-daemon --stop --quiet --pidfile "${ELOGIND_PIDFILE}"
+ eend $?
+}