Skip to content

auto reload config on file modify #284

Answered by mobin-2008
iacore asked this question in Q&A
Discussion options

You must be logged in to vote

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

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@iacore
Comment options

Answer selected by iacore
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants