summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2008-10-29 18:53:45 +0000
committerUlrich Müller <ulm@gentoo.org>2008-10-29 18:53:45 +0000
commit8c575553113604860ca4e732b653957b3749d299 (patch)
tree95762186fae98d4be42f158ef9ff816efb801886
parentP->PN (diff)
downloademacs-8c575553113604860ca4e732b653957b3749d299.tar.gz
emacs-8c575553113604860ca4e732b653957b3749d299.tar.bz2
emacs-8c575553113604860ca4e732b653957b3749d299.zip
Support symlinked multiple instances of the rc script.
svn path=/emacs-overlay/; revision=1188
-rw-r--r--app-emacs/emacs-daemon/ChangeLog8
-rw-r--r--app-emacs/emacs-daemon/Manifest7
-rw-r--r--app-emacs/emacs-daemon/emacs-daemon-0.2.ebuild (renamed from app-emacs/emacs-daemon/emacs-daemon-0.1.ebuild)0
-rw-r--r--app-emacs/emacs-daemon/files/emacs-daemon.conf4
-rw-r--r--app-emacs/emacs-daemon/files/emacs-daemon.rc31
5 files changed, 28 insertions, 22 deletions
diff --git a/app-emacs/emacs-daemon/ChangeLog b/app-emacs/emacs-daemon/ChangeLog
index 20ee2d6..f596889 100644
--- a/app-emacs/emacs-daemon/ChangeLog
+++ b/app-emacs/emacs-daemon/ChangeLog
@@ -2,6 +2,14 @@
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+*emacs-daemon-0.2 (29 Oct 2008)
+
+ 29 Oct 2008; Ulrich Mueller <ulm@gentoo.org> -files/emacs-daemon.conf,
+ files/emacs-daemon.rc, -emacs-daemon-0.1.ebuild, +emacs-daemon-0.2.ebuild:
+ Support symlinked multiple instances of the rc script, so that an
+ individual user can have his Emacs daemon restarted, without affecting
+ others. Thanks to Flameeyes for the suggestion.
+
*emacs-daemon-0.1 (29 Oct 2008)
29 Oct 2008; Ulrich Mueller <ulm@gentoo.org> +files/emacs-daemon.conf,
diff --git a/app-emacs/emacs-daemon/Manifest b/app-emacs/emacs-daemon/Manifest
index a613173..3635da4 100644
--- a/app-emacs/emacs-daemon/Manifest
+++ b/app-emacs/emacs-daemon/Manifest
@@ -1,5 +1,4 @@
-AUX emacs-daemon.conf 121 RMD160 54fa96afc172f76d99048a39fdb8940a5ca73a8e SHA1 8b994cc7026ee835f37ab3f79627e8daf2198e51 SHA256 7a9ec630a5e781a03d7e0db05634719419a4b91f6dd09c32864e31d5476c8cb2
-AUX emacs-daemon.rc 998 RMD160 e43855433d2d1ca36f916465cdb88c9addf2d0e8 SHA1 93e48980d3438a1f7f6011d509f1fb96671f58ee SHA256 77818abc6bf12556fbc819ccd7ffd793449af7f4cbfcba935f1c2793dceb08ed
-EBUILD emacs-daemon-0.1.ebuild 892 RMD160 bd4e40b46b607966d2e3ad2f46caab0b744d70ba SHA1 c769ddeb6124819ea392a14ee5c161305af0c959 SHA256 19e76e5f9fc0d2537b331296e19225a69b90b0936de2fc6a371bba33aa653670
-MISC ChangeLog 315 RMD160 9463b35f50e12695e32fc74dfd9868b2c4832a95 SHA1 50554800f940b77ae78ca9a2bc002159989c5840 SHA256 864aacab33c2950cda63b7837d43d3d6d53854f2c8de31ca7debef13b2b40d1b
+AUX emacs-daemon.rc 1122 RMD160 e62b9a907df1b2d77e028e864c9d214cd7dfcf6e SHA1 32e1362f91e21325472299e91f32f6d5df3cfe8f SHA256 a005c94c3e58a914e5b7621481cb980fa6bdf22d5920f1634fa4019ab6c94530
+EBUILD emacs-daemon-0.2.ebuild 892 RMD160 bd4e40b46b607966d2e3ad2f46caab0b744d70ba SHA1 c769ddeb6124819ea392a14ee5c161305af0c959 SHA256 19e76e5f9fc0d2537b331296e19225a69b90b0936de2fc6a371bba33aa653670
+MISC ChangeLog 690 RMD160 544295c5eb856bc7a95cd12f0362e8cd08b15441 SHA1 1852a602f06f164df54a0c3f0ad977279db84612 SHA256 f309a7d627c3ea8690e95536c3d2686dc5c0468405e973e2763fdc3e359e2ec8
MISC metadata.xml 158 RMD160 415d172437ca754d24fc5ab186ba8e77934d96e4 SHA1 61f6eff9729cd87a725c2a70c81aca4270a17fc4 SHA256 1393bdef3a74343fdb40a112c7096a1af16f67e7a43413250de28dfe73810eab
diff --git a/app-emacs/emacs-daemon/emacs-daemon-0.1.ebuild b/app-emacs/emacs-daemon/emacs-daemon-0.2.ebuild
index bf0376a..bf0376a 100644
--- a/app-emacs/emacs-daemon/emacs-daemon-0.1.ebuild
+++ b/app-emacs/emacs-daemon/emacs-daemon-0.2.ebuild
diff --git a/app-emacs/emacs-daemon/files/emacs-daemon.conf b/app-emacs/emacs-daemon/files/emacs-daemon.conf
deleted file mode 100644
index bfd59b4..0000000
--- a/app-emacs/emacs-daemon/files/emacs-daemon.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-# Config file for emacs-daemon
-
-# Space-separated list of users for whom an Emacs daemon should be started
-EMACSUSERS=""
diff --git a/app-emacs/emacs-daemon/files/emacs-daemon.rc b/app-emacs/emacs-daemon/files/emacs-daemon.rc
index d9f84a3..494f52b 100644
--- a/app-emacs/emacs-daemon/files/emacs-daemon.rc
+++ b/app-emacs/emacs-daemon/files/emacs-daemon.rc
@@ -4,10 +4,17 @@
# Distributed under the terms of the GNU General Public License v2
EMACS="/usr/bin/emacs"
+USER=${RC_SVCNAME#*.}
checkconfig() {
- if [ -z "${EMACSUSERS}" ]; then
- eerror "You must setup EMACSUSERS in /etc/conf.d/emacs-daemon first"
+ if [ "${USER}" = "${RC_SVCNAME}" ]; then
+ eerror "You have to create an init script for each user:"
+ eerror "ln -s emacs-daemon /etc/init.d/emacs-daemon.<user>"
+ return 1
+ fi
+
+ if ! id -u "${USER}" >/dev/null; then
+ eerror "${USER}: No such user"
return 1
fi
@@ -22,22 +29,18 @@ checkconfig() {
}
start() {
- local user dir fail=0
+ local home
checkconfig || return 1
- for user in ${EMACSUSERS}; do
- ebegin "Starting Emacs daemon for ${user}"
- eval dir="~${user}"
- start-stop-daemon --start --user "${user}" --chdir "${dir}" \
- --name emacs-daemon --exec "${EMACS}" -- --daemon &>/dev/null
- eend $? || fail=1
- done
-
- return ${fail}
+ ebegin "Starting Emacs daemon for ${USER}"
+ eval home=~${USER}
+ start-stop-daemon --start --user "${USER}" --chdir "${home}" \
+ --name "emacs-daemon-${USER}" --exec "${EMACS}" -- --daemon &>/dev/null
+ eend $?
}
stop() {
- ebegin "Stopping all Emacs daemons"
- start-stop-daemon --stop --name emacs-daemon --exec "${EMACS}"
+ ebegin "Stopping Emacs daemon for ${USER}"
+ start-stop-daemon --stop --name "emacs-daemon-${USER}" --exec "${EMACS}"
eend $?
}