You are not logged in.

#1 2016-08-26 21:56:14

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Policy on a hook or postinstall running systemctl daemon-reload

This was asked several year ago but the thread has gone stale.  I think the question is still relevant today: why are our packages that modify a systemd unit not trigger `systemctl daemon-reload` via a pacman hook or post_install script?  Per my inspection of everything in [core], [extra], and [community] (see below), nothing is doing it at last with a script.  Seems perfect for a pacman hook, no?  Pros?  Cons?  Perhaps this is best reported in the bug tracker.

% find /var/abs -type f -name '*.install' -print0 | xargs -0 grep daemon-reload

EDIT: FS#50529; let's see what the devs think.

Last edited by graysky (2016-08-26 22:15:03)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2016-08-27 03:19:22

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: Policy on a hook or postinstall running systemctl daemon-reload

Con: it screws up timers.

Online

#3 2016-08-27 07:42:53

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Policy on a hook or postinstall running systemctl daemon-reload

Scimmia wrote:

Con: it screws up timers.

@Scimmia - Does it?
Before:

% systemctl list-timers 
NEXT                         LEFT           LAST                         PASSED       UNIT                         ACTIVATES
Sat 2016-08-27 15:50:20 EDT  12h left       Fri 2016-08-26 15:50:20 EDT  11h ago      systemd-tmpfiles-clean.timer systemd-tmpfi
Sun 2016-08-28 00:00:00 EDT  20h left       Sat 2016-08-27 00:00:01 EDT  3h 40min ago logrotate.timer              logrotate.ser
Sun 2016-08-28 00:00:00 EDT  20h left       Sat 2016-08-27 00:00:01 EDT  3h 40min ago man-db.timer                 man-db.servic
Sun 2016-08-28 00:00:00 EDT  20h left       Sat 2016-08-27 00:00:01 EDT  3h 40min ago shadow.timer                 shadow.servic
Mon 2016-08-29 00:00:00 EDT  1 day 20h left Mon 2016-08-22 00:00:41 EDT  5 days ago   fstrim.timer                 fstrim.servic

Now reset and again:

% sudo systemctl daemon-reload
% systemctl list-timers       
NEXT                         LEFT           LAST                         PASSED       UNIT                         ACTIVATES
Sat 2016-08-27 15:50:20 EDT  12h left       Fri 2016-08-26 15:50:20 EDT  11h ago      systemd-tmpfiles-clean.timer systemd-tmpfi
Sun 2016-08-28 00:00:00 EDT  20h left       Sat 2016-08-27 00:00:01 EDT  3h 41min ago logrotate.timer              logrotate.ser
Sun 2016-08-28 00:00:00 EDT  20h left       Sat 2016-08-27 00:00:01 EDT  3h 41min ago man-db.timer                 man-db.servic
Sun 2016-08-28 00:00:00 EDT  20h left       Sat 2016-08-27 00:00:01 EDT  3h 41min ago shadow.timer                 shadow.servic
Mon 2016-08-29 00:00:00 EDT  1 day 20h left Mon 2016-08-22 00:00:41 EDT  5 days ago   fstrim.timer                 fstrim.servic

Last edited by graysky (2016-08-27 07:43:43)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2016-08-27 13:32:58

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: Policy on a hook or postinstall running systemctl daemon-reload

I believe those are all "OnCalender" timers. Try it with an "OnActive" timer.

Online

#5 2016-08-27 13:41:27

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Policy on a hook or postinstall running systemctl daemon-reload

Manager Lifecycle Commands
       daemon-reload
           Reload the systemd manager configuration. This will rerun all generators (see systemd.generator(7)), reload all
           unit files, and recreate the entire dependency tree. While the daemon is being reloaded, all sockets systemd
           listens on behalf of user configuration will stay accessible.

           This command should not be confused with the reload command.

This sounds rather intrusive and very similar to re-running init.
How well do X , gnome, KDE, server applications cope with this ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#6 2016-08-27 14:10:36

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Policy on a hook or postinstall running systemctl daemon-reload

@Scimmia - Don't think I have any of that type... will check on a some other boxes.
@Lone - Does not reset my displaymanager if that's your question.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#7 2016-08-27 14:45:19

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Policy on a hook or postinstall running systemctl daemon-reload

@Lone - Does not reset my displaymanager if that's your question.

Not what i meant, people can run "pacman -Syu" from an x-terminal (even i do it sometimes before running makepkg).

What will happen if your hook is executed while a user is in X and has multiple programs open ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB