mirror of https://notabug.org/acetone/ircabot.git
fix for start to non-gui system (QApplication)
parent
304d917fd2
commit
3d56e593a6
7
main.cpp
7
main.cpp
|
@ -16,7 +16,12 @@ int main(int argc, char *argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
QApplication a(argc, argv);
|
// To start QApplication without X-server (non-GUI system) should use:
|
||||||
|
// "export QT_QPA_PLATFORM=offscreen" in plain shell
|
||||||
|
// or
|
||||||
|
// "Environment=QT_QPA_PLATFORM=offscreen" in systemd service ([Service] section)
|
||||||
|
|
||||||
|
QApplication a(argc, argv, false);
|
||||||
|
|
||||||
QString configFile;
|
QString configFile;
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
|
|
|
@ -8,7 +8,9 @@ Type=idle
|
||||||
User=USERNAME
|
User=USERNAME
|
||||||
# Change paths to actual (like a /srv/ircabot or something):
|
# Change paths to actual (like a /srv/ircabot or something):
|
||||||
ExecStart=/path/to/ircabot -c /path/to/ircabot.conf
|
ExecStart=/path/to/ircabot -c /path/to/ircabot.conf
|
||||||
|
# To run on non-GUI system:
|
||||||
|
Environment=QT_QPA_PLATFORM=offscreen
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Reference in New Issue