Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Ulrich Mueller (ulm)" <ulm@g.o>
Subject: emacs r1336 - emacs-daemon
Date: Fri, 17 Jul 2009 12:58:52 +0000
Author: ulm
Date: 2009-07-17 12:58:51 +0000 (Fri, 17 Jul 2009)
New Revision: 1336

Modified:
   emacs-daemon/ChangeLog
   emacs-daemon/emacs.rc
Log:
Be compatible with baselayout-1.

Modified: emacs-daemon/ChangeLog
===================================================================
--- emacs-daemon/ChangeLog	2009-07-16 17:22:31 UTC (rev 1335)
+++ emacs-daemon/ChangeLog	2009-07-17 12:58:51 UTC (rev 1336)
@@ -1,3 +1,10 @@
+2009-07-17  Ulrich Mueller  <ulm@g.o>
+
+	* emacs.rc (USER): Initialise from SVCNAME instead of RC_SVCNAME,
+	in order to be compatible with baselayout-1. OpenRC defines both.
+	(start): Test for OpenRC. Compatibility code for start-stop-daemon
+	of baselayout-1.
+
 2009-03-18  Ulrich Mueller  <ulm@g.o>
 
 	* Version 0.14 released.

Modified: emacs-daemon/emacs.rc
===================================================================
--- emacs-daemon/emacs.rc	2009-07-16 17:22:31 UTC (rev 1335)
+++ emacs-daemon/emacs.rc	2009-07-17 12:58:51 UTC (rev 1336)
@@ -8,7 +8,7 @@
 : ${EMACS_SHELL=/bin/bash}
 : ${EMACS_START:=/usr/libexec/emacs/emacs-wrapper.sh}
 : ${EMACS_TIMEOUT:=30}
-USER=${RC_SVCNAME#*.}
+USER=${SVCNAME#*.}
 PIDFILE_DIR=/var/run/emacs/${USER}
 PIDFILE=${PIDFILE_DIR}/emacs.pid
 
@@ -20,7 +20,7 @@
 }
 
 checkconfig() {
-    if [ "${USER}" = "${RC_SVCNAME}" ]; then
+    if [ "${USER}" = "${SVCNAME}" ]; then
 	eerror "You have to create an init script for each user:"
 	eerror "ln -s emacs /etc/init.d/emacs.<user>"
 	return 1
@@ -50,15 +50,21 @@
 
     SHELL=${EMACS_SHELL:-$(awk -F: "\$1 == \"${USER}\" { print \$7 }" \
 	/etc/passwd)}
-    export SHELL
+    export SHELL EMACS EMACS_TIMEOUT
 
     ebegin "Starting Emacs daemon for user ${USER}"
-    # This was tested with start-stop-daemon from OpenRC; don't expect
-    # it to work with other implementations.
-    start-stop-daemon --start \
-	--user "${USER}" --chdir "${home}" --pidfile "${PIDFILE}" \
-	--env EMACS="${EMACS}" --env EMACS_TIMEOUT="${EMACS_TIMEOUT}" \
-	--exec "${EMACS_START}" -- ${EMACS_OPTS}
+    if [ -z "${RC_SVCNAME}" ]; then
+	# baselayout-1
+	start-stop-daemon --start \
+	    --user "${USER}" --exec "${EMACS}" --pidfile "${PIDFILE}" \
+	    --chuid "${USER}" --chdir "${home}" --env HOME="${home}" \
+	    --startas "${EMACS_START}" -- ${EMACS_OPTS}
+    else
+	# OpenRC
+	start-stop-daemon --start \
+	    --user "${USER}" --pidfile "${PIDFILE}" --chdir "${home}" \
+	    --exec "${EMACS_START}" -- ${EMACS_OPTS}
+    fi
     eend $?
 }
 



Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo-x86 commit in dev-python/python-musicbrainz: python-musicbrainz-0.7.0.ebuild
Next by thread:
gentoo-x86 commit in sys-apps/halevt: ChangeLog halevt-0.1.4-r2.ebuild
Previous by date:
gentoo-x86 commit in sci-biology/biopython: ChangeLog biopython-1.49.ebuild
Next by date:
gentoo-x86 commit in sys-apps/halevt: ChangeLog halevt-0.1.4-r2.ebuild


Updated Jun 26, 2012

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.