auto reload config on file modify #284
-
I want dinit to auto reload config file if it can be parsed. Is this possible? Is this a good idea? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi. I think it's not a good idea because a possible implementation for this is to create a "watcher" for each loaded service which is waste of resources (especially memory). Also workaround for this is so simple, add this to your .bashrc (or any file which get loaded on your shell startup): editsrv()
{
${EDITOR} "$1" # Or your fav text editor
dinitcheck "$1" || return 1 # Check it for errors
dinitctl reload "$1"
} So any time you need to modify a service and reload it right after that, just use that function: sudo editsrv dbus
editsrv pipewire |
Beta Was this translation helpful? Give feedback.
-
I do not much like the idea of auto-reloading service descriptions. As a general rule, Dinit avoids implicit behaviour. I have been thinking it might be good to warn though if a service is started after the service description has changed. |
Beta Was this translation helpful? Give feedback.
Hi.
I think it's not a good idea because a possible implementation for this is to create a "watcher" for each loaded service which is waste of resources (especially memory).
Also workaround for this is so simple, add this to your .bashrc (or any file which get loaded on your shell startup):
So any time you need to modify a service and reload it right after that, just use that function: