Closed bricewge closed 1 year ago
Wow, interesting. I guess in the UI this would be something like M-x daemons-action
and then a prompt?
The existing commands are very limited as you've probably seen - it must be a shell command to be executed with the daemon's name. I'm a bit reluctant to mess with this because it's stable and I don't want to commit time to a proper refactoring. So I think an additive change would be best, adding :interactive-commands
to the daemons-define-submodule
, then three new functions:
daemons--run-interactive
daemons--run-interactive-with-output-buffer
daemons--interactive-command
all analagous to the existing non-interactive versions. There'd also need to be boilerplate for daemons-action
and daemons-action-at-point
.
It's a bit repetitive, but IMO a bit safer so if you went this route I'd be happy to merge. Thanks for your interest, always happy people are using this package!
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 oreval
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 thedoc
action with thelist-actions
. Following is a little example of such usage: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
?