working daemon as part of snap (dirty)
This commit is contained in:
parent
9f1bbc1778
commit
efabcab056
|
@ -36,6 +36,9 @@ 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()
|
||||||
|
@ -63,6 +66,7 @@ def main(monitor, live, daemon, install, log):
|
||||||
countdown(5)
|
countdown(5)
|
||||||
subprocess.call("clear")
|
subprocess.call("clear")
|
||||||
elif log:
|
elif log:
|
||||||
|
# ToDo: fail if log is missing or empty (on)
|
||||||
read_log()
|
read_log()
|
||||||
elif install:
|
elif install:
|
||||||
running_check()
|
running_check()
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
auto-cpufreq --daemon 2>&1 | tee -a /var/log/auto-cpufreq.log
|
|
@ -32,6 +32,13 @@ parts:
|
||||||
organize:
|
organize:
|
||||||
cpufreqctl.sh: usr/bin/cpufreqctl
|
cpufreqctl.sh: usr/bin/cpufreqctl
|
||||||
|
|
||||||
|
# ToDo: remove scripts/daemon
|
||||||
|
# deploy-demon:
|
||||||
|
# plugin: dump
|
||||||
|
# source: scripts
|
||||||
|
# organize:
|
||||||
|
# daemon.sh: usr/bin/daemon
|
||||||
|
|
||||||
apps:
|
apps:
|
||||||
auto-cpufreq:
|
auto-cpufreq:
|
||||||
command: bin/auto-cpufreq
|
command: bin/auto-cpufreq
|
||||||
|
@ -39,3 +46,11 @@ apps:
|
||||||
LC_ALL: C.UTF-8
|
LC_ALL: C.UTF-8
|
||||||
LANG: C.UTF-8
|
LANG: C.UTF-8
|
||||||
PKG_MARKER: SNAP
|
PKG_MARKER: SNAP
|
||||||
|
auto-cpufreq-service:
|
||||||
|
command: bin/auto-cpufreq --daemon 2>&1 | tee -a /var/log/auto-cpufreq.log
|
||||||
|
environment:
|
||||||
|
LC_ALL: C.UTF-8
|
||||||
|
LANG: C.UTF-8
|
||||||
|
PKG_MARKER: SNAP
|
||||||
|
daemon: simple
|
||||||
|
|
|
@ -365,6 +365,10 @@ 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…
Reference in New Issue