Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 246462 - app-emacs/emacs-daemon should prevent data loss when stopping the service
Summary: app-emacs/emacs-daemon should prevent data loss when stopping the service
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Emacs project
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2008-11-12 08:02 UTC by Tassilo Horn
Modified: 2010-09-18 12:10 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tassilo Horn 2008-11-12 08:02:09 UTC
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
Comment 1 Ulrich Müller gentoo-dev 2008-12-31 12:54:51 UTC
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?
Comment 2 Ulrich Müller gentoo-dev 2009-01-01 13:12:01 UTC
(In reply to comment #1)
>         "${EMACS_STOP}" || exit

That should be "return", not "exit".
Comment 3 Tassilo Horn 2009-01-02 10:33:52 UTC
Hi Ulrich,

yes, I think that would give users all possibilities for shooting in their feet they could possibly want. ;-)
Comment 4 Ulrich Müller gentoo-dev 2009-01-14 23:55:15 UTC
Fixed in emacs-daemon-0.11.
Comment 5 Ulrich Müller gentoo-dev 2010-09-18 12:10:27 UTC
*** Bug 337829 has been marked as a duplicate of this bug. ***