Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/quarkiverse/quarkus-systemd-notify
This project demonstrates integrating systemd-notify with Quarkus
https://github.com/quarkiverse/quarkus-systemd-notify
linux quarkus quarkus-extension systemd systemd-notify
Last synced: 3 months ago
JSON representation
This project demonstrates integrating systemd-notify with Quarkus
- Host: GitHub
- URL: https://github.com/quarkiverse/quarkus-systemd-notify
- Owner: quarkiverse
- License: apache-2.0
- Created: 2022-11-30T13:25:05.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T13:37:54.000Z (3 months ago)
- Last Synced: 2024-10-25T16:21:51.112Z (3 months ago)
- Topics: linux, quarkus, quarkus-extension, systemd, systemd-notify
- Language: Java
- Homepage:
- Size: 153 KB
- Stars: 8
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Quarkus Systemd Notify Extension
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
[![Version](https://img.shields.io/maven-central/v/io.quarkiverse.systemd.notify/quarkus-systemd-notify?logo=apache-maven&style=flat-square)](https://search.maven.org/artifact/io.quarkiverse.systemd.notify/quarkus-systemd-notify)
## 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:
```
io.quarkiverse.systemd.notify
quarkus-systemd-notify
${quarkus.systemd.notify.version}```
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](https://allcontributors.org/docs/en/emoji-key)):
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!