mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-07-25 14:44:37 +02:00
fixed daemon install/removal with setup.py
This commit is contained in:
parent
efabcab056
commit
683141616f
@ -36,9 +36,6 @@ def main(monitor, live, daemon, install, log):
|
|||||||
if daemon:
|
if daemon:
|
||||||
while True:
|
while True:
|
||||||
root_check()
|
root_check()
|
||||||
# this is needed on SELinux enabled systems (see also ConditionPathExists in .service)
|
|
||||||
#create_log()
|
|
||||||
# ToDo: unless daemon invoked from snap fail
|
|
||||||
gov_check()
|
gov_check()
|
||||||
cpufreqctl()
|
cpufreqctl()
|
||||||
sysinfo()
|
sysinfo()
|
||||||
|
@ -15,7 +15,7 @@ fi
|
|||||||
touch /var/log/auto-cpufreq.log
|
touch /var/log/auto-cpufreq.log
|
||||||
|
|
||||||
echo -e "\n* Deploy auto-cpufreq systemd unit file"
|
echo -e "\n* Deploy auto-cpufreq systemd unit file"
|
||||||
cp scripts/auto-cpufreq.service /etc/systemd/system/auto-cpufreq.service
|
cp ../scripts/auto-cpufreq.service /etc/systemd/system/auto-cpufreq.service
|
||||||
|
|
||||||
echo -e "\n* Reloading systemd manager configuration"
|
echo -e "\n* Reloading systemd manager configuration"
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
0
source/__init__.py
Normal file
0
source/__init__.py
Normal file
@ -72,13 +72,13 @@ def deploy():
|
|||||||
print("\nERROR:\nWas unable to turn off bluetooth on boot")
|
print("\nERROR:\nWas unable to turn off bluetooth on boot")
|
||||||
|
|
||||||
print("\n* Deploy auto-cpufreq as system wide accessible binary")
|
print("\n* Deploy auto-cpufreq as system wide accessible binary")
|
||||||
os.system("cp auto-cpufreq.py /usr/bin/auto-cpufreq")
|
os.system("cp auto-cpufreq /usr/bin/auto-cpufreq")
|
||||||
|
|
||||||
print("\n* Deploy auto-cpufreq install script")
|
print("\n* Deploy auto-cpufreq install script")
|
||||||
os.system("cp scripts/auto-cpufreq-install.sh /usr/bin/auto-cpufreq-install")
|
os.system("cp ../scripts/auto-cpufreq-install.sh /usr/bin/auto-cpufreq-install")
|
||||||
|
|
||||||
print("\n* Deploy auto-cpufreq remove script")
|
print("\n* Deploy auto-cpufreq remove script")
|
||||||
os.system("cp scripts/auto-cpufreq-remove.sh /usr/bin/auto-cpufreq-remove")
|
os.system("cp ../scripts/auto-cpufreq-remove.sh /usr/bin/auto-cpufreq-remove")
|
||||||
|
|
||||||
# run auto-cpufreq daemon deploy script
|
# run auto-cpufreq daemon deploy script
|
||||||
s.call("/usr/bin/auto-cpufreq-install", shell=True)
|
s.call("/usr/bin/auto-cpufreq-install", shell=True)
|
||||||
@ -104,6 +104,9 @@ def remove():
|
|||||||
# run auto-cpufreq daemon install script
|
# run auto-cpufreq daemon install script
|
||||||
s.call("/usr/bin/auto-cpufreq-remove", shell=True)
|
s.call("/usr/bin/auto-cpufreq-remove", shell=True)
|
||||||
|
|
||||||
|
# remove auto-cpufreq-remove
|
||||||
|
os.remove("/usr/bin/auto-cpufreq-remove")
|
||||||
|
|
||||||
# check for necessary scaling governors
|
# check for necessary scaling governors
|
||||||
def gov_check():
|
def gov_check():
|
||||||
avail_gov = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors"
|
avail_gov = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors"
|
||||||
@ -365,10 +368,6 @@ def read_log():
|
|||||||
print("ERROR: auto-cpufreq log is missing.\n\nMake sure to run: \"python3 auto-cpufreq.py --install\" first")
|
print("ERROR: auto-cpufreq log is missing.\n\nMake sure to run: \"python3 auto-cpufreq.py --install\" first")
|
||||||
footer(79)
|
footer(79)
|
||||||
|
|
||||||
# create log func
|
|
||||||
def creat_log():
|
|
||||||
open("/var/log/auto-cpufreq.log", "a").close()
|
|
||||||
|
|
||||||
def running_check():
|
def running_check():
|
||||||
daemon_marker = False
|
daemon_marker = False
|
||||||
for proc in p.process_iter():
|
for proc in p.process_iter():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user