Merge pull request #300 from sirlucjan/pacman-hooks-openrc

Add pacman hooks for openrc
This commit is contained in:
Tejun Heo 2024-05-20 06:47:25 -10:00 committed by GitHub
commit eeb2151804
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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

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