diff options
-rw-r--r-- | psd.install | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/psd.install b/psd.install index bafaf1b324ec..6a085c0f8555 100644 --- a/psd.install +++ b/psd.install @@ -29,7 +29,6 @@ pre_upgrade() { running="$(su $i -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID systemctl --user is-active psd')" if [[ "$running" = "active" ]]; then su $i -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID systemctl --user stop psd.service' - su $i -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID systemctl --user daemon-reload' echo '-> Internal changes to psd require it to be stopped now before updating.' echo '-> Recommend that you diff /usr/share/doc/psd/psd.conf against ~/.config/psd/psd.conf' fi @@ -52,7 +51,6 @@ pre_upgrade() { running="$(su $i -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID systemctl --user is-active psd')" if [[ "$running" = "active" ]]; then su $i -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID systemctl --user stop psd.service' - su $i -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID systemctl --user daemon-reload' echo '-> Internal changes to psd require it to be stopped now before updating.' echo '-> Users of overlayfs: you must run the following before starting the service: psd p' fi @@ -71,11 +69,34 @@ pre_upgrade() { running="$(su $i -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID systemctl --user is-active psd')" if [[ "$running" = "active" ]]; then su $i -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID systemctl --user stop psd.service' - su $i -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID systemctl --user daemon-reload' echo '-> Internal changes to psd require it to be stopped now before updating.' fi done fi +} + +post_upgrade() { + # version 6.01 redefines the location of tmpfs for the software so it is + # required that pacman stop the user service here if running + if [ $(vercmp $2 6.01) -lt 0 ]; then + _daemon_refresh + fi + + # version 6.05 impliments changes to both the service and the way overlayfs is mounted/umount + # so it is required that pacman stop the user service here if running + if [ $(vercmp $2 6.05) -lt 0 ]; then + _daemon_refresh + fi + + # version 6.10 relocates pid file + if [ $(vercmp $2 6.10) -lt 0 ]; then + _daemon_refresh + fi + + # version 6.11 modified services + if [ $(vercmp $2 6.11) -lt 0 ]; then + _daemon_refresh + fi } @@ -89,3 +110,12 @@ pre_remove() { fi done } + +_daemon_refresh() { + for i in $(users); do + running="$(su $i -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID systemctl --user is-active psd')" + if [[ "$running" = "active" ]]; then + su $i -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID systemctl --user daemon-reload' + fi + done +} |