aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2011-12-10 13:58:30 +0000
committerUlrich Müller <ulm@gentoo.org>2011-12-10 13:58:30 +0000
commit5800a2c7a829cf95b5fa2b52bd15a3226b9f472c (patch)
tree93493b3bd11f8bfde560e705353bd0fa855002ff
parentUpdate copyright years. (diff)
downloademacs-tools-5800a2c7a829cf95b5fa2b52bd15a3226b9f472c.tar.gz
emacs-tools-5800a2c7a829cf95b5fa2b52bd15a3226b9f472c.tar.bz2
emacs-tools-5800a2c7a829cf95b5fa2b52bd15a3226b9f472c.zip
Drop baselayout-1 compatibility.
svn path=/emacs-daemon/; revision=1668
-rw-r--r--ChangeLog4
-rw-r--r--emacs.rc28
2 files changed, 16 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 03a4adb..e023aed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-12-10 Ulrich Mueller <ulm@gentoo.org>
+
+ * emacs.rc (checkconfig, start): Drop baselayout-1 compatibility.
+
2010-09-20 Ulrich Mueller <ulm@gentoo.org>
* Version 0.18 released.
diff --git a/emacs.rc b/emacs.rc
index d3233b1..c78e10c 100644
--- a/emacs.rc
+++ b/emacs.rc
@@ -9,7 +9,7 @@
: ${EMACS_SHELL=/bin/bash}
: ${EMACS_START:=/usr/libexec/emacs/emacs-wrapper.sh}
: ${EMACS_TIMEOUT:=30}
-USER=${SVCNAME#*.}
+USER=${RC_SVCNAME##*.}
PIDFILE_DIR=/var/run/emacs/${USER}
PIDFILE=${PIDFILE_DIR}/emacs.pid
@@ -21,7 +21,12 @@ depend() {
}
checkconfig() {
- if [ "${USER}" = "${SVCNAME}" ]; then
+ if [ "${RC_VERSION:-0}" = "0" ]; then
+ eerror "This script cannot be used for baselayout-1."
+ return 1
+ fi
+
+ if [ "${USER}" = "${RC_SVCNAME}" ]; then
eerror "You have to create an init script for each user:"
eerror "ln -s emacs /etc/init.d/emacs.<user>"
return 1
@@ -54,18 +59,9 @@ start() {
export SHELL EMACS EMACS_TIMEOUT EMACS_DEBUG
ebegin "Starting Emacs daemon for user ${USER}"
- 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
+ start-stop-daemon --start \
+ --user "${USER}" --pidfile "${PIDFILE}" --chdir "${home}" \
+ --exec "${EMACS_START}" -- ${EMACS_OPTS}
eend $?
}
@@ -79,7 +75,7 @@ stop() {
fi
ebegin "Stopping Emacs daemon for user ${USER}"
- start-stop-daemon --stop --user "${USER}" \
- --pidfile "${PIDFILE}" --exec "${EMACS}"
+ start-stop-daemon --stop \
+ --user "${USER}" --pidfile "${PIDFILE}" --exec "${EMACS}"
eend $?
}