Using the following symbols:
RS: Resource-Server (holds user's resources, provides authentication/authorization)A: A client application relying on RS for authentication/authorizationU: A user of A owning resources on RS
Let Tomcat is download and installed under /opt/tomcat.
Also, let tomcat be a non-provileged user under which the server will be running.
We assume that we keep server's binaries under /opt/tomcat and we will create a server instance named foo under /var/tomcat/ (carrying its own conf, logs, webapps, work, lib directories).
See also https://dzone.com/articles/running-multiple-tomcat.
Create a template service unit file at /etc/systemd/system/[email protected]:
Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services,
no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.
Let's create a example foo service that when started creates a file, and when stopped it deletes it.
Create executable file /opt/foo/setup-foo.sh: