Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-13417

Starting opennms with systemd as non-root fails with access denied for pid

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 29.0.0
    • Component/s: None
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Sprint:
      Horizon 2021 - Jul 7 - Jul 21

      Description

      When you do a fresh installation on Debian and try to start the service with systemd it fails with the following error message:

      sudo journalctl -xe
      Jun 28 15:53:48 debian opennms[29907]: file locks                      (-x) unlimited
      Jun 28 15:53:48 debian systemd[1]: opennms.service: Can't open PID file /run/opennms.pid (yet?) after start: No such file or directory
      Jun 28 15:53:48 debian opennms[29907]: ERROR: failed to write PID to /var/run/opennms.pid: /var/run/opennms.pid
      Jun 28 15:53:48 debian opennms[29907]: java.nio.file.AccessDeniedException: /var/run/opennms.pid
      Jun 28 15:53:48 debian opennms[29907]:         at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
      Jun 28 15:53:48 debian opennms[29907]:         at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
      Jun 28 15:53:48 debian opennms[29907]:         at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
      Jun 28 15:53:48 debian opennms[29907]:         at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
      Jun 28 15:53:48 debian opennms[29907]:         at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:478)
      Jun 28 15:53:48 debian opennms[29907]:         at java.base/java.nio.file.Files.newOutputStream(Files.java:220)
      Jun 28 15:53:48 debian opennms[29907]:         at java.base/java.nio.file.Files.newBufferedWriter(Files.java:2920)
      Jun 28 15:53:48 debian opennms[29907]:         at java.base/java.nio.file.Files.newBufferedWriter(Files.java:2963)
      Jun 28 15:53:48 debian opennms[29907]:         at org.opennms.bootstrap.Bootstrap.writePid(Bootstrap.java:551)
      Jun 28 15:53:48 debian opennms[29907]:         at org.opennms.bootstrap.Bootstrap.executeClass(Bootstrap.java:517)
      Jun 28 15:53:48 debian opennms[29907]:         at org.opennms.bootstrap.Bootstrap.executeClass(Bootstrap.java:484)
      Jun 28 15:53:48 debian opennms[29907]:         at org.opennms.bootstrap.Bootstrap.main(Bootstrap.java:480)
      Jun 28 15:55:01 debian CRON[31020]: pam_unix(cron:session): session opened for user root by (uid=0)
      Jun 28 15:55:01 debian CRON[31021]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
      Jun 28 15:55:01 debian CRON[31020]: pam_unix(cron:session): session closed for user root
      Jun 28 15:55:11 debian systemd[1]: opennms.service: Start operation timed out. Terminating.
      Jun 28 15:55:11 debian systemd[1]: opennms.service: Failed with result 'timeout'.
      

      The OpenNMS user can't create the pid file in /var/run/opennms.pid.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ranger Benjamin Reed
              Reporter:
              indigo Ronny Trommer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration