Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi there I have made the following job:

description     "Emacs daemon"

start on runlevel[2345]
stop on runlevel[!2345]

expect daemon
respawn limit 10 5 # respawn up to 10 times, waiting 5 seconds each time

pre-start script
        echo "Starting emacs daemon..." > /home/kabelo/Desktop/emacs.log
end script

pre-stop script
    emacsclient -n -e '(save-persistent-scratch)'
end script

exec start-stop-daemon --start --chuid kabelo --exec /usr/bin/emacs -- --daemon -u kabelo

when I placd in in ~/.config/upstart then the commands sudo start emacs, start emacs, print the error, start: Unknown job: emacs. The same error is printed when I put it in both $XDG_CONFIG_DIRS, in /usr/share/upstart/sessions, in ~/.init. Now I'm too fed up to try making a directory, calling it $XDG_CONFIG_HOME and putting it there, since I'm pretty certain it would work. Why isn't the script working no matter where I put it. Note that I want it as a "Session Job" so that I can start it without sudo as documented in the docs.

share|improve this question
What is the output of env? – CameronNemo Jun 4 '14 at 15:46

You should store your script in the /etc/init directory, you may also want to run init-checkconfig emacs.conf on your script and initctl check-config.

share|improve this answer
Okay, so I moved it to /etc/init however, when I start it using sudo start emacs no processes named emacs appears when I list all processes. – 11Kilobytes Oct 11 '13 at 20:25
Ask another question. I only knew how to make the upstart job start, doing a script ending in .conf in the /etc/init directory. I'm not user of emacs tho – Braiam Oct 11 '13 at 22:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.