Changeset e8de1daf for router


Ignore:
Timestamp:
Nov 6, 2016 12:49:34 AM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
26a24a9
Parents:
11e8611
Message:

Util: Consolidate linux service detection code

Location:
router/java/src/net/i2p/router
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/startup/WorkingDir.java

    r11e8611 re8de1daf  
    5454    private final static String WORKING_DIR_DEFAULT_DAEMON = "i2p-config";
    5555    /** we do a couple of things differently if this is the username */
    56     private final static String DAEMON_USER = "i2psvc";
    5756    private static final String PROP_WRAPPER_LOG = "wrapper.logfile";
    5857    private static final String DEFAULT_WRAPPER_LOG = "wrapper.log";
     
    9493                }
    9594            } else {
    96                 if (DAEMON_USER.equals(System.getProperty("user.name")))
     95                if (SystemVersion.isLinuxService())
    9796                    dirf = new SecureDirectory(home, WORKING_DIR_DEFAULT_DAEMON);
    9897                else
     
    307306            out.println("# Modified by I2P User dir migration script");
    308307            String s = null;
    309             boolean isDaemon = DAEMON_USER.equals(System.getProperty("user.name"));
     308            boolean isDaemon = SystemVersion.isLinuxService();
    310309            while ((s = DataHelper.readLine(in)) != null) {
    311310                // readLine() doesn't strip \r
  • router/java/src/net/i2p/router/tasks/OOMListener.java

    r11e8611 re8de1daf  
    5454                // you the actual config file path, have to guess
    5555                String path;
    56                 if (!SystemVersion.isWindows() && !SystemVersion.isMac() &&
    57                     "i2psvc".equals(System.getProperty("user.name"))) {
     56                if (SystemVersion.isLinuxService()) {
    5857                    path = "/etc/i2p";
    5958                } else {
  • router/java/src/net/i2p/router/tunnel/BloomFilterIVValidator.java

    r11e8611 re8de1daf  
    107107        // TODO if !SystemVersion.hasWrapper ...
    108108        String path;
    109         if (!SystemVersion.isWindows() && !SystemVersion.isMac() &&
    110             "i2psvc".equals(System.getProperty("user.name"))) {
     109        if (SystemVersion.isLinuxService()) {
    111110            path = "/etc/i2p";
    112111        } else {
Note: See TracChangeset for help on using the changeset viewer.