That's the short email conversation I had with Ulrich Müller (ulm): > 2. When stopping the service emacs gets killed and all unsaved data in > non-file-visiting buffers is lost. For all file-visiting buffers > emacs' auto-save mechanism will ensure that there's no data loss, > though. > > I think it would be better if the service would simply hang and issue > a message telling that the user should connect again and save his > unsaved data. I don't know if that's feasible somehow, but any > option is better than losing data. I have to think about this one. A problem is that the runscript must not hang at system shutdown. Reproducible: Always
We could change the stop function to something like the following: stop() { if [ "${EMACS_STOP}" ] && [ -x "${EMACS_STOP}" ]; then "${EMACS_STOP}" || exit fi ebegin "Stopping Emacs daemon for ${USER}" start-stop-daemon --stop --user "${USER}" \ --pidfile "${PIDFILE}" --exec "${EMACS}" eend $? } where the optional EMACS_STOP would be the name of a user-supplied script. Would that suit your needs?
(In reply to comment #1) > "${EMACS_STOP}" || exit That should be "return", not "exit".
Hi Ulrich, yes, I think that would give users all possibilities for shooting in their feet they could possibly want. ;-)
Fixed in emacs-daemon-0.11.
*** Bug 337829 has been marked as a duplicate of this bug. ***