cbowdon / daemons.el Goto Github PK
View Code? Open in Web Editor NEWAn Emacs UI for managing init system services
License: GNU General Public License v3.0
An Emacs UI for managing init system services
License: GNU General Public License v3.0
It would be useful to also read system logs with this package. For instance, journalctl -u .service
works with systemd.
shepherd
allows one to define arbitrary actions for each services taking any number of arguments.
As an example, the root service support, by default, several actions in addition to the more common ones (ie: start, disable, status, ...) that are specific of this service. Like power-off
to shutdown your system that takes no other arguments or eval
that takes some Guile code as an argument to be executed by shepherd. To get the list of the actions a service support we can use the doc
action with the list-actions
. Following is a little example of such usage:
$ herd doc root
The root service is used to operate on shepherd itself
$ herd doc root list-actions
root (help status halt power-off load eval unload reload daemonize persistency no-persistency cd restart)
$ herd eval root '(* 2 21)'
Évaluation de l'expression utilisateur (* 2 21).
42
$ sudo herd power-off root
# The system shutdown.
I couldn't find any supported system daemons which accept arbitrary actions. How should I went about implement such a feature for shepherd in daemons.el
?
Hi Thanks for the package, first time user, i am on debian (systemd), just installed the package and called M-x daemons
I get the error above
Backtrace:
Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 1) 0)
shell-command-to-string()
apply(shell-command-to-string nil)
daemons--shell-command-to-string()
daemons-systemd--list()
funcall(daemons-systemd--list)
daemons--list()
tabulated-list-print(t t)
(save-current-buffer (set-buffer list-buffer) (display-buffer-pop-up-window list-buffer nil) (switch-to-buffer-other-window list-buffer) (if daemons-always-sudo (progn (daemons--sudo))) (daemons--require-init-system-submodule) (daemons-mode) (daemons-mode-refresh) (tabulated-list-print t t))
(let ((list-buffer (get-buffer-create daemons--list-buffer-name))) (save-current-buffer (set-buffer list-buffer) (display-buffer-pop-up-window list-buffer nil) (switch-to-buffer-other-window list-buffer) (if daemons-always-sudo (progn (daemons--sudo))) (daemons--require-init-system-submodule) (daemons-mode) (daemons-mode-refresh) (tabulated-list-print t t)))
daemons()
funcall-interactively(daemons)
#<subr call-interactively>(daemons record nil)
apply(#<subr call-interactively> daemons (record nil))
call-interactively@ido-cr+-record-current-command(#<subr call-interactively> daemons record nil)
apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (daemons record nil))
call-interactively(daemons record nil)
command-execute(daemons record)
execute-extended-command(nil "daemons")
Under some circumstances, brew services list
's output may contain "Warning" lines which break this package's ability to parse the output.
For example, my current output of the command is:
Warning: Calling bottle :unneeded is deprecated! There is no replacement.
Please report this issue to the lucagrulla/tap tap (not Homebrew/brew or Homebrew/core):
/usr/local/Homebrew/Library/Taps/lucagrulla/homebrew-tap/Formula/cw.rb:9
Warning: Calling bottle :unneeded is deprecated! There is no replacement.
Please report this issue to the polyfy/polylith tap (not Homebrew/brew or Homebrew/core):
/usr/local/Homebrew/Library/Taps/polyfy/homebrew-polylith/Formula/poly.rb:8
Name Status User File
offlineimap started camdez ~/Library/LaunchAgents/homebrew.mxcl.offlineimap.plist
redis stopped
syncthing started camdez ~/Library/LaunchAgents/homebrew.mxcl.syncthing.plist
unbound stopped
(FWIW, these lines are printed to STDERR, but still are included in the text returned by daemons--shell-command-to-string
.)
PR to follow promptly.
PR #20 apparently introduced a reference to a nonexistent function daemons--test-submodule
. /cc @thiderman
I only use debian based machines as of now, so i have systemd
installed, the following features requests may only pertain to systemd
.
key-commands for enable/disable services.
Sorting the services by status (enabled/disabled/masked etc..)
Caching root password for some time (some packages (I dont remember which, tramp may be?) don't ask for password each time) , or even better an option to start the daemons as super user (Ideally with warning banner on top saying "running daemons as root, be careful" or something)
If I need any other I will add here.
Thank you.
One of the great things about tramp mode is that if I'm remote editing a file and open a shell it opens on the remote host. What would it take for daemons.el to support something like that?
Thanks!
should be smth like
(defun daemons-mode-refresh ()
"Refresh the list of daemons."
(let ((list-buffer (get-buffer-create daemons--list-buffer-name)))
(with-current-buffer list-buffer
(setq-local tabulated-list-entries 'daemons--list))))
Hi, cool package, thank you!
I just noticed that my emacs-daemon service which is running as systemd --user server isn't listed. Is that expected?
With a systemwide installation on GuixSD of the GNU Shepherd,
invocations of any command need to be prefixed with sudo
.
While daemons-always-sudo
solves this problem partially, it is not invoked early enough.
The initial list is not populated, only when I call daemons
again from the unpopulated daemons-buffer it works. Both times, my sudo password is required.
The workaround that I now have in my config:
(defadvice daemons (before make-sure-sudo)
"Make sure we actually call sudo before we start doing occult
stuff."
(when daemons-always-sudo
(daemons--sudo)))
(ad-activate 'daemons)
This is with the buffer-per-host
branch. Maybe that function got removed in Emacs trunk (which I am using)?
There are not a lot of situations where I'm actually interested in the buffer that pops up after running daemons-{stop,start}
. Is there some way where I can make the buffer with e.g. "Service vpn has been stopped." instead be a message in the echo area?
Currently, services-mode displays the template but not instantiated templated services. For example, it lists getty@
but not getty@tty1
.
Also, hitting RET
on a template doesn't do anything useful (it opens a buffer that displays "Failed to get properties: Unit name [email protected] is neither a valid invocation ID nor unit name.").
I don't have any strong opinons on how these services should be handled, but they should be handled somehow (e.g., being able to stop [email protected]
would be nice).
(Also, awesome project! I've been looking for something like this for a while. I currently have a set of ivy commands but this is much nicer).
Sorry, not an issue per se, more of a question: any chance you're going to put this on MELPA?
This is a package I'd definitely use. :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.