You are not logged in.
For example, modifying /usr/share/libalpm/hooks/man-db-purge.hook to run the following in the background:
Exec = /bin/sh -c 'mkdir -p /var/cache/man; exec mandb --quiet'
Is this supported? Simply adding a & to the end of the command seems to be ignored. Thanks!
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
pacman is calling /bin/sh, so making the commend backgrounded has no effect...
(I disabled that hook... it is annoying)
Offline
Thanks for the reply, Allan. To serve as a surrogate, I wrote: https://github.com/graysky2/mandb-ondemand
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
alpm doesn't have any kind of support for backgrounding a hook, nor do I suggest doing it, but if you run it via a shell you can run it in the background the same way you run anything else in the background with a shell.
Offline
The thing that annoys me most about that hook, is that it runs every time a manpage is installed or updated. I recently discovered that is because I use the following pacman.conf line (removing it will make the hook stop running all the time):
NoExtract = usr/share/man/* !usr/share/man/man*
Apparently NoExtract counts as "removed"? Although it is not actually preventing anything from being installed for some packages, and still triggers the hook!
I assume this is a bug.
Edit: Or maybe not, on the theory that it could remove a file installed before that NoExtract line was added? Well, it is still annoying.
...
graysky, very nice except you really don't have to invoke /bin/sh in order to run /usr/bin/touch if you aren't using any shell-specific features. However, you probably shouldn't assume /var/cache/man/ exists (the default hook doesn't). I'd probably use /usr/bin/install to save a call to /bin/sh
Last edited by eschwartz (2016-07-12 04:01:04)
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
graysky, very nice except you really don't have to invoke /bin/sh in order to run /usr/bin/touch if you aren't using any shell-specific features. However, you probably shouldn't assume /var/cache/man/ exists (the default hook doesn't). I'd probably use /usr/bin/install to save a call to /bin/sh
Thanks! Good idea... I am not sure about the syntax of creating a zero-byte file with install as it requires a source and destination as far as I know... what about just:
Exec = /usr/bin/touch /var/cache/man/.runflag
Last edited by graysky (2016-07-12 10:47:02)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Ah! I see Heftig is making my little package obsolete, but his code still causes delays on an install.
https://git.archlinux.org/svntogit/pack … 8063aa8061
Last edited by graysky (2016-07-23 10:55:13)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
/dev/null is a zero-byte file.
But that change does look much nicer.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
alpm doesn't have any kind of support for backgrounding a hook, nor do I suggest doing it, but if you run it via a shell you can run it in the background the same way you run anything else in the background with a shell.
I tried backgrounding it within /usr/share/libalpm/hooks/man-db.hook but pacman still waits for the mandb pid to finish before exiting... you can manually delete /var/cache/man/index.db then install a package that has a manpage to see this effect.
Exec = /bin/sh -c 'mkdir -p /var/cache/man; exec mandb --quiet --no-purge &'
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Shells obviously cannot exec something in the background. You also need to close the file descriptors that pacman is reading from.
Exec = /bin/sh -c 'mkdir -p /var/cache/man; mandb --quiet --no-purge <&- >&- 2>&- &'
Offline
@graysky
Have you considered triggering your mandb-ondemand with systemd path files instead of using a daily timer? In theory it would achieve the same affect as the blocking pacman hook without the blocking.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
@R - That is exactly what I have been playing with this morning. I will push the commit to the package once I test it a bit.
EDIT: https://github.com/graysky2/mandb-ondemand/tree/dev
Last edited by graysky (2016-07-23 15:27:59)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
I am going to move this to a new thread in CC. Please continue the discussion here
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline