diff options
author | Ulrich Müller <ulm@gentoo.org> | 2011-12-10 13:58:30 +0000 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2011-12-10 13:58:30 +0000 |
commit | 5800a2c7a829cf95b5fa2b52bd15a3226b9f472c (patch) | |
tree | 93493b3bd11f8bfde560e705353bd0fa855002ff | |
parent | Update copyright years. (diff) | |
download | emacs-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-- | ChangeLog | 4 | ||||
-rw-r--r-- | emacs.rc | 28 |
2 files changed, 16 insertions, 16 deletions
@@ -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. @@ -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 $? } |