-
-
Notifications
You must be signed in to change notification settings - Fork 271
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
"WIP" Create auto-cpufreq-sysvinit #599
base: master
Are you sure you want to change the base?
Conversation
A sysvinit daemon for auto-cpufreq generated THANKS TO :- https://github.com/yunginnanet/sysvinit-service-generator fork of https://github.com/wyhasany/sysvinit-service-generator It should be inside /etc/init.d/
Run script For auto-cpufreq That can make sysvinit recognise auto-cpufreq Note You can Also use the runscript inside auto-cpufreq/scripts/auto-cpufreq-s6 By @AnasR7 /run
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run script For auto-cpufreq That can make sysvinit recognise auto-cpufreq
Note You can Also use the runscript inside auto-cpufreq/scripts/auto-cpufreq-s6 By @AnasR7
LGTM, but the part which I'm missing is how will the auto-cpufreq-installer detect if system user is running on is running on systemv and it's not refering to install script anywhre? Or was there other you were envisioning of working? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this pr.
I do agree we should remove the auto-cpufreq-run
since we already have the runfile in auto-cpufreq/scripts/auto-cpufreq-s6
to avoid redundancy and bloat
Also to repeat what Adnan suggested, the daemon installer script should be updated to include this new sysvinit service. The problem I see is what we already support openrc which uses sysvinit by default, so they both use the init
process name for PID 1, so we need a way to distinguish the difference.
Something like this could work:
# snippet
elif [ "$(ps h -o comm 1)" = "init" ];then
# Check if /etc/inittab file exists
if [ -e "/etc/inittab" ]; then
# sysvinit command here
else
# openrc stuff moved here
fi
Additionally, the same change should be made to the daemon removal script. If that doesn't make sense, please let me know and also feel free to comment if you have any alternative ideas since I am not as familiar with openrc or sysvinit :)
scripts/auto-cpufreq-run
Outdated
@@ -0,0 +1,3 @@ | |||
!#/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this file since we already have one like it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's deleted
It's deleted |
👍, but this part is still missing:
For reference see how in daemon installer script it was done for |
Sorry if I was late I want to take some time until I finish some few important things to do these days and I need to organize myself a little bit. I will test my fork repository and will give you what happens then . also thanks for these suggestions. |
No worries and take your time |
I Edited openrc script to be like that and I used this fedora resource in this link that helped me find sysvinit commands https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet For now I didn't test the code tell me for any suggestions if needed I'll see you guys next time |
I will test in a VM with both init systems |
I am testing this right now on MX linux 23 Fluxbox 64 bit edition (non systemd) and would like to post my observations from discord (sry for the ad-hoc writing style): Mh, it seems to work, installation went good, when i started in monitor mode it reminded me to de-install tlp, I did that restarted, now I'm running in live mode, the temperatures are the same with a different monitoring tool, unplugging the power supply gets detected, the setting to use governor is the same like in cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor from another terminal. The testing laptop is fairly old: Not setting EPP (Not supported by system) Warning: CPU turbo is not available seem plausible. However, I get "System has not been booted with systemd as init system (PID 1 ). Can't operate. Failed to connect to bus: PC is not active .... " when starting live or monitor mode, but I ignored that for now. I see, I have to check if I get it installed permanently. There seems to be a problem in line 84 at the auto-cpufreq-install script: echo -e "\n* "Enabling auto-cpufreq daemon (sysvinit) service at boot" when running sudo auto-cpufreq -- install
There was a problem, couldn't determine GNOME Power Profiles Daemon -----------------Running auto-cpufreq daemon install script ------------------------- --------------------- auto-cpufreq daemon installed and runnin-------------------------- .... Thank you for your work on non-systemd compatibility . :) |
Further investigating: there seems to be at least some trouble with the additional (") after "\n
and
|
After deleting the additional " the terminal output says it doesn't know chkconfig which doesn't seem to be used by mx linux fluxbox (not installed). |
I'm downloding mx linux on a vm and test the code again , I'm sorry for not giving much time to this pull request . |
Ok it seems that chkconfig command is deprecated years ago and we should use insteasd sysv-rc-conf it can be found in debian repos https://packages.debian.org/bookworm/sysv-rc-conf source https://askubuntu.com/questions/221293/why-is-chkconfig-no-longer-available-in-ubuntu/277732#277732 |
Alrighty, there are some errors I want to post here besides chkconfig, you might have come across them in your virtual machine: when running auto-cpufreq --install (with the changes from above) I also get these three errors: mkdir: cannot create folder : "/etc/inittab": file exists already
Again, thanks for your work :) |
applied some suggested fixes and replace (mkdir) command with (ls) and also replaced deprecated (chkconfig) command with (sysv-rc-conf) last but not least I need to have auto-cpufreq-sysvinit inside '/usr/local/share/auto-cpufreq/scripts/' for testing I tried to copy auto-cpufreq-sysvinit file to '/usr/local/share/auto-cpufreq/scripts/' manually to check if the install script will work and I had the output below ''' /etc/inittab * Deploy auto-cpufreq sysvinit unit file * Starting auto-cpufreq daemon (sysvinit) service * Enabling auto-cpufreq daemon (sysvinit) service at boot '''
scripts/auto-cpufreq-install.sh
Outdated
|
||
echo -e "\n* "Reloading sysvinit manager configuration" | ||
service auto-cpufreq reload | ||
cp /usr/local/share/auto-cpufreq/scripts/auto-cpufreq-sysvinit /etc/init.d/auto-cpufreq | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need a
chmod +x /etc/init.d/auto-cpufreq
here
The copying to /etc/init.d works on my system but the script is not executable.
Maybe the same later for openrc.
Just for a heads up: as written in the review the copying when running auto-cpufreq --install seems to work now. When adding chmod +x /etc/init.d/auto-cpufreq and restart the os the shell script runs as a system service at reboot. But when running auto-cpufreq --stats the daemon doesn't seem to be active. I think it's close to working but sadly I am no expert at all. I guess the sysvinit script needs some revisit and maybe the things pointed out by shadeyg56 regarding the daemon removal script. Maybe shadeyg56 can take a look at the state right now? |
@shadeyg56 could you please take a final look and confirm if it's all working, if it's let's merge this. Thanks! |
As written above I think it's not quite there yet, at least on my machine the auto-cpufreq daemon isn't active. The init system script gets started however (after the suggested changes). |
Haven't been able to test in a VM since |
change SCRIPT to use runfile inside "/usr/local/share/auto-cpufreq/scripts/auto-cpufreq-s6/"
I forget that (sysvinit-service-generator I used earlier) had some small tutorial at the end of running script to make the service work so I replaced sysvinit daemon install section with commands inspired from that script and added commands to make the service and the run script inside auto-cpufreq-s6 to run as executables
sysvinit-service-generator script aslo helped me know how to uninstall sysvinit service I added the commands that are inspired by these scripts I have to thank @wyhasany for making the script and @yunginnanet for his fork with the needed fixes otherwise I wouldn't be able to get auto-cpufreq-sysvinit to work
small Fix for small mistake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 92 has extra "local/share/auto-cpufreq/scripts/auto-cpufreq-openrc /etc/init.d/auto-cpufreq" added there by mistake
This is fixed in the more updated commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to thank @wyhasany for making the script and @yunginnanet for his fork with the needed fixes otherwise I wouldn't be able to get auto-cpufreq-sysvinit to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you prepend "WIP" (work in progress) to title of this PR, and then please remove WIP part & announce it when it's ready for review.
Thanks!
Remove note needed code in line 78
I did some test to the code and it ran perfectly fine on mx-linux with sysvinit even after reboot , But I couldn't test it in openrc distro . I tried to install artix with openrc but the installation was broken so I need another distro or maybe other iso version . |
Hi, I'm looking to use auto-cpufreq with MX-Linux as well but I still got the same error message in your earlier posts: how did you manage to get it work with MX-Linux and sysvinit system? would love to learn more to get this working. |
Did you clone from |
This reverts commit 27a2f93.
I hope this will work
IIRC @Angel-Karasu recently made some changes to make auto-cpufreq work with MX Linux? Regardless, @AmerXz if this is anywhere close to merging (if it works) maybe it's good idea to start the review/merge process? |
It works on mx-linux but I didn't test it on openrc distro |
Run Script (Could be replaceable by auto-cpufreq-r6 runscript )
And a sysvinit daemon for auto-cpufreq generated THANKS TO :-
https://github.com/yunginnanet/sysvinit-service-generator fork of https://github.com/wyhasany/sysvinit-service-generator
It should be inside /etc/init.d/