Add pacman hooks for openrc

Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
This commit is contained in:
Piotr Gorski 2024-05-20 08:32:05 +02:00
parent c9bfc5f98b
commit 951a3d66bc
No known key found for this signature in database
GPG Key ID: 79AFA05ABDB26C5A
4 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,19 @@
[Trigger]
Type = Path
Operation = Upgrade
Target = etc/conf.d/scx
Target = etc/default/scx
Target = etc/init.d/scx
Target = usr/bin/scx_*
[Trigger]
Type = Package
Operation = Upgrade
Target = scx-scheds
Target = scx-scheds-git
[Action]
Description = Checking scx_scheduler...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/scx-openrc-restart
NeedsTargets

View File

@ -0,0 +1,4 @@
# Install the 'scx-openrc-restart' file to the '/usr/share/libalpm/scripts' directory
install_data('scx-openrc-restart', install_dir: '/usr/share/libalpm/scripts')
# Install the '90-scx-scheds-upgrade.hook' file to the '/usr/share/libalpm/hooks' directory
install_data('90-scx-scheds-upgrade.hook', install_dir: '/usr/share/libalpm/hooks')

View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# Check the status of the service
if /etc/init.d/scx status > /dev/null; then
echo "The service is active. Restarting..."
/usr/bin/rc-service scx restart
echo "Service has been restarted."
else
echo "The service is not active."
fi

View File

@ -338,3 +338,7 @@ libalpm = dependency('libalpm', required: get_option('libalpm'))
if libalpm.found() and systemd.found()
subdir('libalpm/systemd')
endif
if libalpm.found() and openrc.found()
subdir('libalpm/openrc')
endif