-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from bitterhalt/main
add runit service
- Loading branch information
Showing
3 changed files
with
19 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
|
||
# Dependencies | ||
|
||
At build time: `autoconf` | ||
At runtime: `python`, `numpy`, `click`, `rich` and `pyyaml` | ||
|
||
Our standard builds use pyproject, mainly with poetry. | ||
|
||
# Preparing the sources | ||
|
||
The dist files are template files, which means you must first `autoconf` them. You could also just `sed` all the `.in` files if you don't want to use `autotools`. | ||
|
||
``` sh | ||
```sh | ||
git clone https://github.com/mcgillij/amdfan.git | ||
cd amdfan | ||
|
||
|
@@ -17,24 +18,25 @@ autoconf | |
``` | ||
|
||
# Service files | ||
|
||
There are two ways to obtain the systemd service file. One is available during runtime, through the `amdfan --service` command, but takes some assumptions of your system. May not work. | ||
|
||
``` sh | ||
```sh | ||
amdfan print-default --service | sudo tee /usr/lib/systemd/system/amdfan.service | ||
``` | ||
|
||
If you ran `./configure` successfully, you'll also find the service files for OpenRC and systemd under `dist/${init}/`. | ||
|
||
If you ran `./configure` successfully, you'll also find the service files for OpenRC, Runit and systemd under `dist/${init}/`. | ||
|
||
# Configuration files | ||
|
||
Similarly as above, you can obtain the sources from the runtime. This is not necessary, as this file is generated automatically after the daemon runs for the first time. | ||
|
||
``` bash | ||
```bash | ||
amdfan print-default --configuration | sudo tee /etc/amdfan.yml | ||
``` | ||
|
||
|
||
# Executable files | ||
|
||
The executable files are contained within amdfan. This directory is a python module, and can either be loaded as `python -m amdfan`. If you want to import the module, you may be interested in checking out `amdfan.commands`, which contains most of the subcommands. | ||
|
||
Otherwise, just use python-exec with something like | ||
|
@@ -47,27 +49,28 @@ if __name__ == '__main__': | |
sys.exit(main()) | ||
``` | ||
|
||
|
||
|
||
# Installing from PyPi | ||
|
||
You can also install amdfan from PyPi using something like poetry. | ||
|
||
``` bash | ||
```bash | ||
poetry init | ||
poetry add amdfan | ||
poetry run amdfan --help | ||
``` | ||
|
||
# Building Python package | ||
|
||
Requires [poetry](https://python-poetry.org/) to be installed. | ||
|
||
``` bash | ||
```bash | ||
git clone [email protected]:mcgillij/amdfan.git | ||
cd amdfan/ | ||
poetry build | ||
``` | ||
|
||
## Building Arch AUR package | ||
|
||
Building the Arch package assumes you already have a chroot env setup to build packages. | ||
|
||
```bash | ||
|
@@ -81,5 +84,3 @@ cp dist/pacman/PKGBUILD ./PKGBUILD | |
makechrootpkg -c -r $HOME/$CHROOT | ||
sudo pacman -U --asdeps amdfan-*-any.pkg.tar.zst | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
exec vlogger -t amdfan -p daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
exec 2>&1 | ||
exec /usr/bin/amdfan daemon |