mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-07-29 16:44:49 +02:00
new location for daemon logs on snap
This commit is contained in:
parent
75b15ff9b9
commit
d48587ce9e
@ -36,7 +36,7 @@ apps:
|
|||||||
PKG_MARKER: SNAP
|
PKG_MARKER: SNAP
|
||||||
|
|
||||||
service:
|
service:
|
||||||
command: bin/auto-cpufreq --daemon 2>&1 | tee -a /var/log/auto-cpufreq.log
|
command: bin/auto-cpufreq --daemon 2>&1 | tee -a $SNAP_DATA/auto-cpufreq.log
|
||||||
plugs:
|
plugs:
|
||||||
- cpu-control
|
- cpu-control
|
||||||
- system-observe
|
- system-observe
|
||||||
|
@ -40,6 +40,7 @@ bat_state = power.PowerManagement().get_providing_power_source_type()
|
|||||||
|
|
||||||
# auto-cpufreq log file
|
# auto-cpufreq log file
|
||||||
auto_cpufreq_log_file = "/var/log/auto-cpufreq.log"
|
auto_cpufreq_log_file = "/var/log/auto-cpufreq.log"
|
||||||
|
auto_cpufreq_log_file_snap = "/var/snap/auto-cpufreq/current/auto-cpufreq.log"
|
||||||
|
|
||||||
# daemon check
|
# daemon check
|
||||||
dcheck = s.getoutput("snapctl get daemon")
|
dcheck = s.getoutput("snapctl get daemon")
|
||||||
@ -406,8 +407,9 @@ def delete_file(file):
|
|||||||
|
|
||||||
# read log func
|
# read log func
|
||||||
def read_log():
|
def read_log():
|
||||||
if os.path.isfile(auto_cpufreq_log_file):
|
if os.getenv("PKG_MARKER") == "SNAP":
|
||||||
# read /var/log/auto-cpufreq.log
|
s.call(["tail", "-n 50", "-f", auto_cpufreq_log_file_snap])
|
||||||
|
elif os.path.isfile(auto_cpufreq_log_file):
|
||||||
s.call(["tail", "-n 50", "-f", auto_cpufreq_log_file])
|
s.call(["tail", "-n 50", "-f", auto_cpufreq_log_file])
|
||||||
else:
|
else:
|
||||||
print("\n" + "-" * 30 + " auto-cpufreq log " + "-" * 31 + "\n")
|
print("\n" + "-" * 30 + " auto-cpufreq log " + "-" * 31 + "\n")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user