Problem with initctl stop

Eric Huang ehuang4 at gmail.com
Fri Oct 4 04:27:17 UTC 2013


Hi,

I am trying to write an upstart script that will start and gracefully
shutdown emacs with my system. However, initctl stop emacs does not work.

Basically, when I run initctl stop emacs:

dmesg only shows
    [ 4363.589893] init: emacs goal changed from stop to start

on ctrl-c of initctl stop emacs, ps aux | grep emacs shows
    eric 13008 14.5 0.0 291228 29200 ? Ssl 23:46 0:01 /usr/bin/emacs
--daemon -u eric

indicating that it never killed the daemon

However, if I kill the daemon by sending SIGTERM or by running emacsclient
-n -e '(kill-emacs)', then dmesg shows

[ 4378.169286] init: emacs state changed from spawned to stopping
[ 4378.169314] init: event_new: Pending stopping event
[ 4378.169325] init: Handling stopping event
[ 4378.169392] init: event_finished: Finished stopping event
[ 4378.169399] init: emacs state changed from stopping to killed
[ 4378.169431] init: emacs state changed from killed to post-stop
[ 4378.169450] init: emacs state changed from post-stop to waiting
[ 4378.169473] init: event_new: Pending stopped event
[ 4378.169484] init: job_change_state: Destroyed inactive instance emacs
[ 4378.169542] init: Handling stopped event
[ 4378.169594] init: event_finished: Finished stopped event

It's important to me that I run code in pre-stop to save my emacs buffers,
and obvs. that isn't working either.

How can I fix this?


I've posted the details of problem here:
http://askubuntu.com/questions/353288/upstart-not-starting-emacs-daemon

Thanks,
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/upstart-devel/attachments/20131004/63fb5167/attachment.html>


More information about the upstart-devel mailing list