[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

keeping processes running over emacs reboots

From: joakim
Subject: keeping processes running over emacs reboots
Date: Sat, 28 Feb 2015 01:04:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

I like using emacs as a launcher for other programs. However, it's
inconvenient when Emacs crashes for some reason, and all your programs
die as well.

So, here is an example how to use dtach to avoid having the program die,
and be recovered by emacs next time around.

  (defun bankid ()
    ;;important! check if there is a process already
    (if  (get-process "bankid-process")
        (message "already running")
      (start-process-dtach "bankid-process" "bankid-process" "qemu-kvm"

  (defun start-process-dtach ( name buffer program &rest program-args)
  ;; start program and create a dtach socket for it, with name 
  ;; if the socket exists, attach to it
    (eval  `(start-process ,name ,buffer "dtach" "-A" ,(expand-file-name 
(concat user-emacs-directory "dtach/" name)) ,program  ,@program-args)))

Joakim Verona

reply via email to

[Prev in Thread] Current Thread [Next in Thread]