anyone interested in systemd user session integration... have a look.
and again.. with patch attached.
--
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler) ras...@rasterman.com
>From 4588942d356c7f8133eda119a293a87e69e466fa Mon Sep 17 00:00:00 2001
From: Karol Lewandowski <k.lewando...@samsung.com>
Date: Sun, 19 Aug 2012 15:48:46 +0900
Subject: [PATCH] Support startup notification via systemd
Change-Id: I8299ff3c0baa0b360113faacc41c8cba31559d16
---
configure.ac | 23 +++++++++++++++++++++++
src/bin/Makefile.am | 3 ++-
src/bin/e.h | 4 ++++
src/bin/e_main.c | 4 ++++
4 files changed, 33 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index e3601d2..8b87449 100644
--- a/configure.ac
+++ b/configure.ac
@@ -109,6 +109,29 @@ if test "x$want_pam" != "xno" ; then
fi
fi
+have_systemd=no
+AC_ARG_ENABLE([systemd],
+ AC_HELP_STRING([--enable-systemd], [enable startup notification via systemd sd_notify() @<:@default=detect@:>@]),
+ [want_systemd=$enableval],
+ [want_systemd=auto]
+)
+if test "x$want_systemd" != "xno" ; then
+ PKG_CHECK_MODULES(SYSTEMD, [libsystemd-daemon],
+ [have_systemd=yes],
+ [have_systemd=no])
+else
+ have_systemd=no
+fi
+
+if test "x$want_systemd$have_sytemd" = "xyesno" ; then
+ AC_MSG_ERROR([Startup notification via systemd was requested but not found])
+fi
+
+if test "x$have_systemd" = "xyes" ; then
+ AC_MSG_NOTICE([enabling startup notification via systemd sd_notify()])
+ AC_DEFINE_UNQUOTED([HAVE_SYSTEMD], [1], [Startup notification via systemd])
+fi
+
dnl AC_E_CHECK_PKG(VALGRIND, [valgrind >= 2.4.0], [], [:])
AC_SUBST(VALGRIND_CFLAGS)
AC_SUBST(VALGRIND_LIBS)
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 5a2d8f9..a31e450 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -11,6 +11,7 @@ INCLUDES = \
@e_cflags@ \
@cf_cflags@ \
@VALGRIND_CFLAGS@ \
+@SYSTEMD_CFLAGS@ \
@EDJE_DEF@ \
-DPACKAGE_BIN_DIR=\"@PACKAGE_BIN_DIR@\" \
-DPACKAGE_LIB_DIR=\"@PACKAGE_LIB_DIR@\" \
@@ -345,7 +346,7 @@ e_main.c \
$(enlightenment_src)
enlightenment_LDFLAGS = -export-dynamic
-enlightenment_LDADD = @e_libs@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@ -lm
+enlightenment_LDADD = @e_libs@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@ @SYSTEMD_LIBS@ -lm
enlightenment_imc_SOURCES = \
e.h \
diff --git a/src/bin/e.h b/src/bin/e.h
index 53ba86c..e544b1e 100644
--- a/src/bin/e.h
+++ b/src/bin/e.h
@@ -109,6 +109,10 @@ void *alloca (size_t);
# include <E_Hal.h>
# endif
+# ifdef HAVE_SYSTEMD
+# include <systemd/sd-daemon.h>
+# endif
+
# ifdef EAPI
# undef EAPI
# endif
diff --git a/src/bin/e_main.c b/src/bin/e_main.c
index 76b3452..c233fc1 100644
--- a/src/bin/e_main.c
+++ b/src/bin/e_main.c
@@ -1775,6 +1775,10 @@ _e_main_cb_idle_after(void *data __UNUSED__)
TS("SLEEP");
first_idle = 0;
e_precache_end = EINA_TRUE;
+#ifdef HAVE_SYSTEMD
+ if (sd_booted())
+ sd_notify(0, "READY=1");
+#endif
}
return ECORE_CALLBACK_RENEW;
--
1.7.5.4
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel