Interface SDNotify

All Known Implementing Classes:
ActualSDNotify, NOOPSDNotify

public interface SDNotify
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Notify systemd that a D-Bus error has occurred.
    static SDNotify
    Create a new SDNotify instance.
    boolean
    errno(int errno)
    Notify systemd that an error has occurred.
    boolean
    Tells the service manager to extend the startup, runtime or shutdown service timeout corresponding the current state.
    boolean
    mainPid(int pid)
    Inform systemd of the main pid of the service.
    boolean
    Notify systemd that the service has started successfully.
    boolean
    Notify systemd that the service is currently reloading.
    boolean
    status(String message)
    Send a free form status message to systemd.
    boolean
    Notify systemd that the service is stopping.
    boolean
    Update the watchdog timestamp for services with WatchDogSec enabled.
    boolean
    An error that should be handled by the watchdog options occured.
  • Method Details

    • create

      static SDNotify create()
      Create a new SDNotify instance. Returns a NOOP Variant if the NOTIFY_SOCKET environment variable is not set (for example on Windows).
      Returns:
      an appropriate SDNotify instance
    • ready

      boolean ready()
      Notify systemd that the service has started successfully. This has to be sent for services of Type=notify to be considered running by systemd.
      Returns:
      if the message was successfully sent
    • status

      boolean status(String message)
      Send a free form status message to systemd.
      Parameters:
      message - the message to be sent
      Returns:
      if the message was successfully sent
    • reloading

      boolean reloading()
      Notify systemd that the service is currently reloading. ready() must be called once this reloading has finished.
      Returns:
      if the message was successfully sent
    • stopping

      boolean stopping()
      Notify systemd that the service is stopping.
      Returns:
      if the message was successfully sent
    • errno

      boolean errno(int errno)
      Notify systemd that an error has occurred.
      Parameters:
      errno - the ERRNO of the error
      Returns:
      if the message was successfully sent
    • busError

      boolean busError(String error)
      Notify systemd that a D-Bus error has occurred.
      Parameters:
      error - a description of the error
      Returns:
      if the message was successfully sent
    • mainPid

      boolean mainPid(int pid)
      Inform systemd of the main pid of the service. This is only necessary under special circumstances.
      Parameters:
      pid - the main pic
      Returns:
      if the message was successfully sent
    • watchdog

      boolean watchdog()
      Update the watchdog timestamp for services with WatchDogSec enabled.
      Returns:
      if the message was successfully sent
    • watchdogTrigger

      boolean watchdogTrigger()
      An error that should be handled by the watchdog options occured.
      Returns:
      if the message was successfully sent
    • extendTimeout

      boolean extendTimeout(Duration duration)
      Tells the service manager to extend the startup, runtime or shutdown service timeout corresponding the current state.
      Parameters:
      duration - the new value of the timeout
      Returns:
      if the message was successfully sent