Skip to content

Commit

Permalink
Add a springboot-shutdown.target and Conflicts (#73)
Browse files Browse the repository at this point in the history
Closes #72 
* Add a springboot-shutdown.target and Conflicts
* Fixed README.md typos
* Including the new systemd target in RPM

---------

Signed-off-by: Hubert Quarantel-Colombani <[email protected]>
  • Loading branch information
hubertqc authored Jul 20, 2023
1 parent 498cbf0 commit a51aa30
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* [SELinux booleans](#selinux-booleans)
* [Interfaces for deployment tools](#interfaces-for-deployment-tools)
* [Starting the Springboot application](#starting-the-springboot-application)
3. [Running multiple Springboot appplications on the same host](#running-multiple-springboot-appplications-on-the-same-host)
3. [Running multiple Springboot applications on the same host](#running-multiple-springboot-applications-on-the-same-host)
4. [Related projects](#related-projects)
5. [Disclaimer](#disclaimer)

Expand Down Expand Up @@ -142,7 +142,7 @@ LDAP/LDAPS ports (locally assigned the `ldap_port_t` SELinux type).
When switch to `true`this boolean allows the Springboot application to connect to remote
SMTP/SMTPS/submission ports (locally assigned the `smtp_port_t` SELinux type).

#### Mutiple booleans allow_springboot_connectto_<DB> (default: `false`)
#### Mutiple booleans allow_springboot_connectto_\<DB\> (default: `false`)

When switch to `true`these boolean allows the Springboot application to connect to remote
database server ports: `couchdb`, `mongodb`, `mysql` (MariaDB), `oracle`, `pgsql` (PostgreSQL), `redis`.
Expand Down Expand Up @@ -262,7 +262,7 @@ The script(s) used to start or stop the Springboot application MUST be located i
/opt/springboot/service/ directory. The /opt/springboot/bin/springboot_service file name
is also supported.

### Running multiple Springboot appplications on the same host
### Running multiple Springboot applications on the same host

TO DO

Expand Down
2 changes: 2 additions & 0 deletions rpm/springboot-systemd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ mkdir -p -m 0755 %{buildroot}/opt/springboot/service

install -m 0444 %{_builddir}/systemd/[email protected] %{buildroot}/usr/lib/systemd/system/
install -m 0444 %{_builddir}/systemd/springboot.target %{buildroot}/usr/lib/systemd/system/
install -m 0444 %{_builddir}/systemd/springboot-shutdown.target %{buildroot}/usr/lib/systemd/system/
install -m 0555 %{_builddir}/systemd/springboot-service.sh %{buildroot}/opt/springboot/bin/

install -m 0444 %{_builddir}/systemd/env.SAMPLE %{buildroot}/%{_docdir}/%{name}/examples/
Expand All @@ -54,6 +55,7 @@ fi

/usr/lib/systemd/system/[email protected]
/usr/lib/systemd/system/springboot.target
/usr/lib/systemd/system/springboot-shutdown.target
/opt/springboot/bin/springboot-service.sh

%dir %{_docdir}/%{name}
Expand Down
10 changes: 10 additions & 0 deletions systemd/springboot-shutdown.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Shutdown target for all Springboot application services

Before=shutdown.target

Conflicts=springboot.target
DefaultDependencies=no

[Install]
WantedBy=shutdown.target
4 changes: 2 additions & 2 deletions systemd/springboot.target
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Description=Springboot target with all Springboot application services
Requires=network-online.target time-sync.target
After=network-online.target time-sync.target basic.target

Conflicts=shutdown.target
Conflicts=shutdown.target springboot-shutdown.target

[Install]
WantedBy=multi-user.target
WantedBy=default.target
3 changes: 3 additions & 0 deletions systemd/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Description=Springboot Server - %I
Requires=network-online.target time-sync.target
After=network-online.target time-sync.target basic.target

Conflicts=springboot-shutdown.target
DefaultDependencies=yes

[Service]
Type=forking

Expand Down

0 comments on commit a51aa30

Please sign in to comment.