aboutsummarylogtreecommitdiffstats
path: root/README.md
blob: abe852740484259b9f522a50633468863a8526d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# `bustd` Pacman Hooks

`bustd` is designed and expected to operate well in harsh environemnts that
may be resource hungry or memory starved. Therefore, extra preference is given to this
package to ensure that the latest (and greatest) version is always running.

![Hooks Directory Tree](pacman-hooks-scrot.png "Bustd Pacman Hooks")

## Why are Pacman Hooks Used

`pacman` is arch's system package manager, therefore, any changes to our executable's
binary will be caused by this program. Whether that be an installation, upgrade, or
un-installation. So, from the momemt we install `bustd` the most recent version available
is running on our system. After an update is pushed to the *AUR*, `pacman` will be able
to fetch and install it. At this moment there is a newer version of the binary locally
available, but there is no indication that the old version will be turned-off and the new
version kicked-off. Pacman hooks solve this problem by forcing a restart of `bustd`
whenever the executable is modified.

---

## Hooks Used

- [Install](#hooks-used-install)
- [Remove](#hooks-used-remove)
- [Upgrade](#hooks-used-upgrade)

### Install<a name="hooks-used-install"></a>

This hook is triggered on the event that the package **bustd** is freshly installed
locally. Following this install, the program `bustd` will be immediately kicked-off via
a systemd service unit, which will also begin the program on system startup.

### Remove<a name="hooks-used-remove"></a>

This hook is triggered on the event that the package **bustd** is uninstalled from the
system. Once the uninstallation process is begun, before any files are removed, this hook
will halt the currently running instance and not begin another one, allowing for a smooth
uninstallation.

### Upgrade<a name="hooks-used-upgrade"></a>

This hook is triggered on the event that a new version of the package **bustd** becomes
available on the *AUR*. Once the executable has been upgraded, the currently running
instance is halted and an instance of the new version is started.

## Installation

Install this package before, at the same time as, or after the *bustd* package.

> `$ yay -S bustd-pacman-hooks`

Once installed, the hooks will simply be set up but will not be triggered until the
appropriate event takes place. Therefore, once the package bustd is installed, the binary
will be registered with systemd and started. Any updates to this package will cause
a restart in the binary, and a removal of the program also halts the executable. Should
any of these events not trigger the associated hook, it will simply keep its current
instance running and not restart to the fresh version until a reboot.