mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
journalctl: have a useful --setup-keys error message when using non-persistant logging
Generating seed... Generating key pair... Generating sealing key... Failed to open /var/log/journal/33f46101703a10c5fc6fa4f451840101/fss.tmp.k2wDDU: No such file or directory
This commit is contained in:
parent
3d56f7df44
commit
b98e3866fd
@ -725,6 +725,19 @@ static int setup_keys(void) {
|
||||
char *p = NULL, *k = NULL;
|
||||
struct FSSHeader h;
|
||||
uint64_t n;
|
||||
struct stat st;
|
||||
|
||||
r = stat("/var/log/journal", &st);
|
||||
if (r < 0 && errno != ENOENT && errno != ENOTDIR) {
|
||||
log_error("stat(\"%s\") failed: %m", "/var/log/journal");
|
||||
return -errno;
|
||||
}
|
||||
|
||||
if (r < 0 || !S_ISDIR(st.st_mode)) {
|
||||
log_error("%s is not a directory, must be using persistent logging for FSS.",
|
||||
"/var/log/journal");
|
||||
return r < 0 ? -errno : -ENOTDIR;
|
||||
}
|
||||
|
||||
r = sd_id128_get_machine(&machine);
|
||||
if (r < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user