$ strawberry
17:50:33.254 INFO main:165 Strawberry is already running - activating existing window (1)
17:50:38.256 WARN unknown Connection timed out
17:50:38.256 ERROR main:168 Could not send message to primary instance.
由于某种原因,草莓认为有一个实例正在运行,并且连接到它超时 - 因为没有任何东西正在运行。
尝试以 root 身份启动(但没有声音并且以 root 身份运行无论如何都不是解决方案)。
与草莓相关的所有文件都已被清除,包括草莓本身,但全新安装后错误仍然存在。
$ strawberry --version
Strawberry 1.0.23
$ pgrep -f strawberry
(no output)
$ ps aux | grep '[s]trawberry'
(no output)
$ cat /etc/os-release command
NAME="Linux Mint"
VERSION="21.2 (Victoria)"
ID=linuxmint
ID_LIKE="ubuntu debian"
PRETTY_NAME="Linux Mint 21.2"
VERSION_ID="21.2"
VERSION_CODENAME=victoria
UBUNTU_CODENAME=jammy
我在代码中发现了这个错误消息,但它并没有帮助我解决这个问题。
https://github.com/strawberrymusicplayer/strawberry/blob/master/src/main.cpp
CommandlineOptions options(argc, argv);
{
// Only start a core application now, so we can check if there's another instance without requiring an X server.
// This MUST be done before parsing the commandline options so QTextCodec gets the right system locale for filenames.
QCoreApplication core_app(argc, argv);
KDSingleApplication single_app(QCoreApplication::applicationName(), KDSingleApplication::Option::IncludeUsernameInSocketName);
// Parse commandline options - need to do this before starting the full QApplication, so it works without an X server
if (!options.Parse()) return 1;
logging::SetLevels(options.log_levels());
if (!single_app.isPrimaryInstance()) {
if (options.is_empty()) {
qLog(Info) << "Strawberry is already running - activating existing window (1)";
}
if (!single_app.sendMessage(options.Serialize())) {
qLog(Error) << "Could not send message to primary instance.";
}
return 0;
}
}
正如怀疑的那样,草莓在某处放置了一个锁定文件,并且该锁定文件没有放在
/home/
.它被放在
/tmp/
.正在删除这两个文件...
...解决了这个问题。