Debug logs on linux drain battery
- Dominant language
- Go
- Stars
- 9.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
It appears that keybase is packaging [systemd unit files](https://github.com/keybase/client/tree/master/packaging/linux/systemd) as well as the [run_keybase](https://github.com/keybase/client/blob/master/packaging/linux/run_keybase) script so that the keybase service and kbfs start under the `debug` flags.
This is resulting in much I/O. With trivial usage (listing git repos and cloning) the log files are exceeding megabytes;
```
$ ls -hog ~/.cache/keybase
total 9.4M
drwxr-xr-x 2 3.5K Dec 21 20:27 avatars
-rw------- 1 55K Dec 22 08:49 Keybase.app.log
-rw------- 1 0 Dec 21 20:13 keybase.ek.log
-rw------- 1 2.6M Dec 21 20:34 keybase.git.log
-rw------- 1 70K Dec 21 20:34 keybase.git.perf.log
-rw------- 1 374K Jan 5 14:14 keybase.kbfs.log
-rw------- 1 79K Jan 5 14:14 keybase.kbfs.perf.log
-rw------- 1 178K Jan 5 14:15 keybase.perf.log
-rw------- 1 6.1M Jan 5 14:15 keybase.service.log
```
Worse, `powertop` is showing keybase and kbfs as using more power than both firefox and chrome and I have to remember to kill the services when unplugged. Removing the flags makes things better, and has been suggested in https://github.com/keybase/keybase-issues/issues/3155
Is there a real reason we should be in debug mode by default?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the systemd unit files under packaging/linux/systemd and the packaging/linux/run_keybase script, then inspect where the debug flags are supplied by default. Compare the startup configuration with the behavior described in the issue and the linked discussion in issue 3155. Done means the normal Linux services no longer start in debug mode and the excessive logging and power use are addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux
- Domain
- devops, operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100