Skip to content

Commit b011947

Browse files
committed
Merge branch '1.3.x'
2 parents df64a74 + 93de0d7 commit b011947

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

Diff for: spring-boot-docs/src/main/asciidoc/deployment.adoc

+23-6
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,13 @@ secured accordingly. Use `chmod` so that the file can only be read by the owner
499499

500500
[[deployment-systemd-service]]
501501
==== Installation as a systemd service
502-
Systemd is the successor to `init.d` scripts, and now being used by many many modern Linux
503-
distributions. Although you can continue to use `init.d` script with `systemd`, it is also
504-
possible to launch Spring Boot applications using `systemd` '`service`' scripts.
502+
Systemd is the successor of the System V init system, and is now being used by many modern
503+
Linux distributions. Although you can continue to use `init.d` scripts with `systemd`, it
504+
is also possible to launch Spring Boot applications using `systemd` '`service`' scripts.
505505

506-
For example, to run a Spring Boot application installed in `var/myapp` as user `myapp` you
507-
can add the following script in `/etc/systemd/system/myapp.service`:
506+
Assuming that you have a Spring Boot application installed in `/var/myapp`, to install a
507+
Spring Boot application as a `systemd` service create a script named `myapp.service` using
508+
the following example and place it in `/etc/systemd/system` directory:
508509

509510
[indent=0]
510511
----
@@ -521,7 +522,23 @@ can add the following script in `/etc/systemd/system/myapp.service`:
521522
WantedBy=multi-user.target
522523
----
523524

524-
TIP: Remember to change the `Description` and `ExecStart` fields for your application.
525+
TIP: Remember to change the `Description`, `User` and `ExecStart` fields for your
526+
application.
527+
528+
Note that unlike when running as an `init.d` service, user that runs the application, PID
529+
file and console log file behave differently under `systemd` and must be configured using
530+
appropriate fields in '`service`' script. Consult the
531+
http://www.freedesktop.org/software/systemd/man/systemd.service.html[service unit
532+
configuration man page] for more details.
533+
534+
To flag the application to start automatically on system boot use the following command:
535+
536+
[indent=0,subs="verbatim,quotes,attributes"]
537+
----
538+
$ systemctl enable myapp.service
539+
----
540+
541+
Refer to `man systemctl` for more details.
525542

526543

527544

0 commit comments

Comments
 (0)