Class SDNotifySocketFile

java.lang.Object
de.afoo.sdnotify.SDNotifySocketFile

public class SDNotifySocketFile extends Object
Thin abstraction around the UNIX socket file systemd stores in the NOTIFY_SOCKET environment variable of processes it starts.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Check if the UNIX socket to communicate with systemd exists.
    static File
    get()
    Returns null if the NOTIFY_SOCKET environment variable is not set (which should mean we are not running under systemd in most cases)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • get

      public static File get()
      Returns null if the NOTIFY_SOCKET environment variable is not set (which should mean we are not running under systemd in most cases)
      Returns:
      the UNIX socket or null
    • exists

      public static boolean exists()
      Check if the UNIX socket to communicate with systemd exists.
      Returns:
      if the socket exists