Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dinit init system #690

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scripts/auto-cpufreq-dinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type = scripted
command = /usr/local/bin/auto-cpufreq --daemon
run-as = root
10 changes: 10 additions & 0 deletions scripts/auto-cpufreq-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ elif [ "$(ps h -o comm 1)" = "s6-svscan" ];then
s6-rc -u change auto-cpufreq default
echo -e "\n* Update daemon service bundle (s6)"
s6-db-reload
# Install script for dinit
elif [ "$(ps h -o comm 1)" = "dinit" ];then
echo -e "\n* Deploying auto-cpufreq dinit unit file"
cp /usr/local/share/auto-cpufreq/scripts/auto-cpufreq-dinit /etc/dinit.d/auto-cpufreq

echo -e "Starting auto-cpufreq daemon (dinit) service"
dinitctl start auto-cpufreq

echo -e "\n* Enabling auto-cpufreq daemon (dinit) service at boot"
dinitctl enable auto-cpufreq
else
echo -e "\n* Unsupported init system detected, could not install the daemon\n"
echo -e "\n* Please open an issue on https://github.com/AdnanHodzic/auto-cpufreq\n"
Expand Down
11 changes: 11 additions & 0 deletions scripts/auto-cpufreq-remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ elif [ "$(ps h -o comm 1)" = "systemd" ];then

echo -e "reset failed"
systemctl reset-failed
# Remove service for openrc
elif [ "$(ps h -o comm 1)" = "init" ];then
echo -e "\n* Stopping auto-cpufreq daemon (openrc) service"
rc-service auto-cpufreq stop
Expand All @@ -69,6 +70,16 @@ elif [ "$(ps h -o comm 1)" = "s6-svscan" ];then
rm -rf /etc/s6/sv/auto-cpufreq
echo -e "\n* Update daemon service bundle (s6)"
s6-db-reload
# Remove service for dinit
elif [ "$(ps h -o comm 1)" = "init" ];then
echo -e "\n* Stopping auto-cpufreq daemon (dinit) service"
dinitctl stop auto-cpufreq

echo -e "\n* Disabling auto-cpufreq daemon (dinit) at boot"
dinitctl disable auto-cpufreq

echo -e "\n* Removing auto-cpufreq daemon (dinit) unit file"
rm /etc/dinit.d/auto-cpufreq
else
echo -e "\n* Unsupported init system detected, could not remove the daemon\n"
echo -e "\n* Please open an issue on https://github.com/AdnanHodzic/auto-cpufreq\n"
Expand Down