Skip to content

Commit 89ec324

Browse files
committed
revert to using logfiles instead of the systemd journal
Unfortunately some distros that use systemd don't configure its journal to be persisted between boots (because they prefer to forward things to syslog). That means we shouldn't rely on it for `keybase log send`, or else we'll lose info about e.g. crashes caused by the FUSE kernel module.
1 parent 7e35954 commit 89ec324

4 files changed

Lines changed: 8 additions & 12 deletions

File tree

‎go/libkb/log_send.go‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -362,16 +362,11 @@ func (l *LogSendContext) LogSend(statusJSON, feedback string, sendLogs bool, num
362362
var gitLog string
363363

364364
if sendLogs {
365-
if l.G().Env.WantsSystemd() {
366-
svcLog = tailSystemdJournal(l.G().Log, "keybase.service", numBytes)
367-
kbfsLog = tailSystemdJournal(l.G().Log, "kbfs.service", numBytes)
368-
desktopLog = tailSystemdJournal(l.G().Log, "keybase.gui.service", numBytes)
369-
} else {
370-
svcLog = tail(l.G().Log, "service", logs.Service, numBytes)
371-
kbfsLog = tail(l.G().Log, "kbfs", logs.Kbfs, numBytes)
372-
desktopLog = tail(l.G().Log, "desktop", logs.Desktop, numBytes)
373-
}
365+
svcLog = tail(l.G().Log, "service", logs.Service, numBytes)
366+
kbfsLog = tail(l.G().Log, "kbfs", logs.Kbfs, numBytes)
367+
desktopLog = tail(l.G().Log, "desktop", logs.Desktop, numBytes)
374368
updaterLog = tail(l.G().Log, "updater", logs.Updater, numBytes)
369+
// TODO: get start logs from systemd?
375370
startLog = tail(l.G().Log, "start", logs.Start, numBytes)
376371
installLog = tail(l.G().Log, "install", logs.Install, numBytes)
377372
systemLog = tail(l.G().Log, "system", logs.System, numBytes)

‎packaging/linux/systemd/kbfs.service‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Type=notify
1111
# Without this line, `systemctl --user restart kbfs.service` will hit mount
1212
# failures if there are any running shells cd'd into a Keybase folder.
1313
ExecStartPre=-/usr/bin/env fusermount -uz /keybase
14-
ExecStart=/usr/bin/kbfsfuse -debug /keybase
14+
ExecStart=/usr/bin/kbfsfuse -debug -log-to-file /keybase
1515
Restart=on-failure
1616

1717
[Install]

‎packaging/linux/systemd/keybase.gui.service‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Wants=keybase.service kbfs.service
44

55
[Service]
66
Type=simple
7-
ExecStart=/opt/keybase/Keybase
7+
ExecStartPre=/usr/bin/env mkdir -p %h/.cache/keybase
8+
ExecStart=/usr/bin/env bash -c "/opt/keybase/Keybase &>> %h/.cache/keybase/Keybase.app.log"
89
# The environment file lets run_keybase pass along KEYBASE_START_UI. The
910
# autostart file will set that to suppress showing the main window during boot.
1011
# %t is the XDG_RUNTIME_DIR, and the leading - means it's ok if the file is

‎packaging/linux/systemd/keybase.service‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Description=Keybase core service
55
# "notify" means we promise to call SdNotify() at the end of startup.
66
Type=notify
77
Environment=KEYBASE_SERVICE_TYPE=systemd
8-
ExecStart=/usr/bin/keybase --debug service
8+
ExecStart=/usr/bin/keybase --debug --log-file=%h/.cache/keybase/keybase.service.log service
99
Restart=on-failure
1010

1111
[Install]

0 commit comments

Comments
 (0)