Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fish 5785 create systemd service #5450

Merged
merged 2 commits into from
Oct 21, 2021

Conversation

aubi
Copy link
Contributor

@aubi aubi commented Oct 13, 2021

Description

Add SystemD support for create-service asadmin command. The configuration script is generated in /etc/systemd/system, filename is payara-{domainname}.service. The help describes, what are further necessary steps.

Add --system-type parameter to override autodetection, allowing to force a specific init type script generation.
Add --system-type also to _delete-script subcommand.
Add _delete-script help page.

Testing

Testing Performed

SystemD, SystemV script creation, both autodetection and --system-type, deleting service

Create domain and service for it:

create-domain domain3
create-service --serviceproperties CONF_ENV=VALUE1 domain3
systemctl daemon-reload
systemctl start payara_domain3.service

After that, try systemctl, find payara, you should see

payara.service    loaded active running   "Payara Server Service"

Verify the running payara is domain3:
Open http://localhost:4848/common/index.jsf in browser, you should see on the right side: Domain: domain3

To verify, that the CONF_ENV is visible in the service (via microprofile config), try the simple app attached to the jira ticket. The key piece of source code:

@Inject
@ConfigProperty(name = "CONF_ENV", defaultValue = "CONF_ENV environment variable not set")
String myEnv;

Test:

curl http://localhost:8080/conf-app-1.0/
VALUE1

Try to stop, start, restart service:

systemctl stop payara_domain3.service
systemctl start payara_domain3.service
systemctl restart payara_domain3.service

Delete service:

asadmin _delete-service domain3

Testing Environment

Linux Debian, SystemD (tried forced SystemV scripts)

Documentation

in process

Notes for Reviewers

Verify Windows service, if it isn't broken, please.
After creating SystemD service, it is necessary to call systemctl daemon-reload, it reloads service files, must be run after every change in the service file(s)! It also automatically restarts the changed services.
Other commands to try:
systemctl status payara.service
journalctl -xe
Review help create-service and help _delete-service

@aubi
Copy link
Contributor Author

aubi commented Oct 13, 2021

Jenkins test please

@aubi aubi force-pushed the FISH-5785-create-systemd-service branch 2 times, most recently from 1c5c92e to b0fb92c Compare October 13, 2021 14:17
@aubi
Copy link
Contributor Author

aubi commented Oct 13, 2021

Jenkins test please

@aubi aubi marked this pull request as ready for review October 13, 2021 14:37
@aubi aubi requested a review from OndroMih October 13, 2021 14:38
@aubi aubi force-pushed the FISH-5785-create-systemd-service branch from b0fb92c to c9477ee Compare October 15, 2021 08:01
@aubi aubi requested a review from Pandrex247 October 15, 2021 08:03
@aubi
Copy link
Contributor Author

aubi commented Oct 15, 2021

Jenkins test please

@aubi aubi merged commit 52ed910 into payara:master Oct 21, 2021
@aubi aubi deleted the FISH-5785-create-systemd-service branch October 21, 2021 12:42
JamesHillyard pushed a commit to JamesHillyard/Payara that referenced this pull request Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants