From 624b4619f13cf8bec8ab406b275af536b0579bd5 Mon Sep 17 00:00:00 2001 From: Evgenii Alekseev Date: Thu, 28 Dec 2023 15:24:14 +0200 Subject: [PATCH] chore: add daemon unit --- docs/faq.rst | 11 ++++++++++- package/lib/systemd/system/ahriman-daemon@.service | 11 +++++++++++ package/lib/systemd/system/ahriman@.service | 2 +- package/lib/systemd/system/ahriman@.timer | 2 +- 4 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 package/lib/systemd/system/ahriman-daemon@.service diff --git a/docs/faq.rst b/docs/faq.rst index b6ef89d5..889c2a90 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -25,6 +25,15 @@ Long answer The idea is to install the package as usual, create working directory tree, create configuration for ``sudo`` and ``devtools``. Detailed description of the setup instruction can be found :doc:`here `. +Run as daemon +""""""""""""" + +The alternative way (though not recommended) is to run service instead of timer: + +.. code-block:: shell + + systemctl enable --now ahriman-daemon@x86_64-aur-clone + How to validate settings ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -473,7 +482,7 @@ There is special ``repo-daemon`` subcommand which emulates systemd timer and wil docker run --privileged -v /path/to/local/repo:/var/lib/ahriman arcan1s/ahriman:latest repo-daemon -This command uses same rules as ``repo-update``, thus, e.g. requires ``--privileged`` flag. Chech also `examples `__. +This command uses same rules as ``repo-update``, thus, e.g. requires ``--privileged`` flag. Check also `examples `__. Web service setup ^^^^^^^^^^^^^^^^^ diff --git a/package/lib/systemd/system/ahriman-daemon@.service b/package/lib/systemd/system/ahriman-daemon@.service new file mode 100644 index 00000000..a58b9353 --- /dev/null +++ b/package/lib/systemd/system/ahriman-daemon@.service @@ -0,0 +1,11 @@ +[Unit] +Description=ArcH linux ReposItory MANager (%i) + +[Service] +Type=simple +ExecStart=/usr/bin/ahriman --repository-id "%I" repo-daemon --no-changes --refresh +User=ahriman +Group=ahriman + +[Install] +WantedBy=multi-user.target diff --git a/package/lib/systemd/system/ahriman@.service b/package/lib/systemd/system/ahriman@.service index 5d199d20..c3d0ff20 100644 --- a/package/lib/systemd/system/ahriman@.service +++ b/package/lib/systemd/system/ahriman@.service @@ -4,4 +4,4 @@ Description=ArcH linux ReposItory MANager (%i) [Service] ExecStart=/usr/bin/ahriman --repository-id "%I" repo-update --no-changes --refresh User=ahriman -Group=ahriman \ No newline at end of file +Group=ahriman diff --git a/package/lib/systemd/system/ahriman@.timer b/package/lib/systemd/system/ahriman@.timer index 03731030..8cf6444e 100644 --- a/package/lib/systemd/system/ahriman@.timer +++ b/package/lib/systemd/system/ahriman@.timer @@ -6,4 +6,4 @@ OnCalendar=daily RandomizedDelaySec=3600 [Install] -WantedBy=timers.target \ No newline at end of file +WantedBy=timers.target