Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Automatic systemd daemon-reload
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
armills
n00b
n00b


Joined: 31 Jan 2012
Posts: 6

PostPosted: Thu Jan 12, 2017 3:05 pm    Post subject: Automatic systemd daemon-reload Reply with quote

Just wanted to share my latest snippet from /etc/portage/bashrc. Saves me from constantly forgetting to reload after updates.

Code:
if [ "${EBUILD_PHASE}" == "postinst" ] && \
        equery files "${CATEGORY}/${PN}" | \
        grep -q '^/usr/lib/systemd/system/.*\.service$' ; then
    einfo "Reloading systemd daemons"
    systemctl daemon-reload
fi
Back to top
View user's profile Send private message
littletux
n00b
n00b


Joined: 08 Dec 2003
Posts: 38

PostPosted: Tue Mar 21, 2017 11:49 pm    Post subject: Reply with quote

Why you not use the automated reload mechanism from systemd?

you can copy the original systemd file associated with (your_needed_service) from /usr/lib/systemd/system/(your_needed_service) to /etc/systemd/system/(your_needed_service)

Then under the [Service] section in the file you have to add the following 2 lines:

Code:

Restart=always
RestartSec=3


and then either restart your Computer or do

Code:

systemctl daemon-reload
systemctl restart (your_needed_service)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum