forked from I2P_Developers/i2p.i2p
Util: Consolidate linux service detection code
This commit is contained in:
@ -201,7 +201,7 @@ public class ConfigServiceHandler extends FormHandler {
|
||||
*/
|
||||
public boolean shouldShowSystray() {
|
||||
return !
|
||||
(RouterConsoleRunner.DAEMON_USER.equals(System.getProperty("user.name")) ||
|
||||
(SystemVersion.isLinuxService() ||
|
||||
(SystemVersion.isWindows() && _context.hasWrapper() && WrapperManager.isLaunchedAsService()) ||
|
||||
// headless=true is forced in i2prouter script to prevent useless dock icon;
|
||||
// must fix this first
|
||||
|
@ -131,7 +131,6 @@ public class RouterConsoleRunner implements RouterApp {
|
||||
private static final int MAX_THREADS = 24;
|
||||
private static final int MAX_IDLE_TIME = 90*1000;
|
||||
private static final String THREAD_NAME = "RouterConsole Jetty";
|
||||
public static final String DAEMON_USER = "i2psvc";
|
||||
public static final String PROP_DTG_ENABLED = "desktopgui.enabled";
|
||||
|
||||
/**
|
||||
@ -273,7 +272,7 @@ public class RouterConsoleRunner implements RouterApp {
|
||||
private void startTrayApp() {
|
||||
// if no permissions, don't even try
|
||||
// isLaunchedAsService() always returns true on Linux
|
||||
if (DAEMON_USER.equals(System.getProperty("user.name")) ||
|
||||
if (SystemVersion.isLinuxService() ||
|
||||
(SystemVersion.isWindows() && _context.hasWrapper() && WrapperManager.isLaunchedAsService())) {
|
||||
// required true for jrobin to work
|
||||
System.setProperty("java.awt.headless", "true");
|
||||
|
Reference in New Issue
Block a user