Coder Social home page Coder Social logo

quarkiverse / quarkus-systemd-notify Goto Github PK

View Code? Open in Web Editor NEW
8.0 4.0 0.0 128 KB

This project demonstrates integrating systemd-notify with Quarkus

License: Apache License 2.0

Java 100.00%
linux quarkus quarkus-extension systemd systemd-notify

quarkus-systemd-notify's Introduction

Quarkus Systemd Notify Extension

All Contributors

Version

Introduction

This extension is used to notify Linux service manager (systemd) about start-up completion and other service status changes.

Usage

To use the extension, add the dependency to the target project:

<dependency>
    <groupId>io.quarkiverse.systemd.notify</groupId>
    <artifactId>quarkus-systemd-notify</artifactId>
    <version>${quarkus.systemd.notify.version}</version>
</dependency>

and configure the service unit file with the following minumum configurations:

...

[Service]
Type=notify
AmbientCapabilities=CAP_SYS_ADMIN

...

Systemd Service Example

Assuming quarkus-run.jar is located at /opt/quarkus-app/quarkus-run.jar:

  • Create a unit configuration file at /etc/systemd/system/quarkus.service:
[Unit]
Description=Quarkus Server
After=network.target
Wants=network.target

[Service]
Type=notify
AmbientCapabilities=CAP_SYS_ADMIN
ExecStart=/bin/java -jar /opt/quarkus-app/quarkus-run.jar
SuccessExitStatus=0 143

[Install]
WantedBy=multi-user.target
  • Enable the service (this will make it to run at system start-up as well):
sudo systemctl enable quarkus
  • Start/Stop/Restart the service:
sudo systemctl start quarkus
sudo systemctl stop quarkus
sudo systemctl restart quarkus
  • Check status of the service:
sudo systemctl status quarkus

systemd-notify with SELinux

If SELinux (Mostly for RedHat OS) is enabled:

root# getenforce
Enforcing

Add systemd_notify_t to the permissive types:

semanage permissive -a systemd_notify_t

You can check with:

semanage permissive -l

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

Fouad Almalki
Fouad Almalki

๐Ÿ’ป ๐Ÿšง

This project follows the all-contributors specification. Contributions of any kind welcome!

quarkus-systemd-notify's People

Contributors

actions-user avatar allcontributors[bot] avatar dependabot[bot] avatar eng-fouad avatar gastaldi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

quarkus-systemd-notify's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.