Linux hints

The installation of .NET varies for different Linux distributions.
The .NET documentation covers this topic.

The systemd service

that runs the PDF service can be installed using an installation script.
For a more customized installation, proceed as follows.

The systemd service is defined in the stepover-pdf.service file

stepover-pdf.service
[Unit]
Description=StepOver PDF service

[Service]
Type=simple
#Restart=always
#RestartSec=1
#StartLimitIntervalSec=0
PIDFile=/run/stepover-pdf-service.pid
ExecStart=/usr/bin/env  java -cp   /usr/local/lib/pdfService-4.3.0-jar-with-dependencies.jar  com.so.pdfService.Main
ExecStop=/bin/kill -s QUIT $MAINPID

[Install]
WantedBy=multi-user.target

It has an ExecStart line that goes like this

ExecStart=<JAVA> -cp <PATH-TO-PDF-SERVICE-JAR> com.so.pdfService.Main

Provide <JAVA>

Using "/usr/bin/env java" for <JAVA> assumes an installed JRE.

For that to work, make sure to have a JRE (14+) on the system.

On Ubuntu and Debian, for example, installing the openjdk-14-jre package achieves that.

Alternatively, fetch a JRE from adoptopenjdk.net or from Oracle
and extract it to the file system, preferably to /usr/local.

In that case, one could also write
"/usr/local/bin/java" to the <JAVA> field in the ExecStart line.

The java version can be gotten as follows.

> <JAVA> --version

where <JAVA> is  "java" or "/usr/bin/env java" or "/usr/local/bin/java", or similar.

Example output:

openjdk 14.0.2 2020-07-14
OpenJDK Runtime Environment (build 14.0.2+12-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 14.0.2+12-Ubuntu-120.04, mixed mode, sharing)

Provide <PATH-TO-PDF-SERVICE-JAR>

Fetch the pdf-service-with-dependencies-jar
to the file system,
preferably to /usr/local/lib
and use that path to the jar in the ExecStart line.

Install the service

Put the stepover-pdf.service file to

/etc/systemd/system/stepover-pdf.service,

start it,

> systemctl start stepover-pdf.service

see whether that worked,

> systemctl status stepover-pdf.service

then, enable it

> systemctl enable stepover-pdf.service

such that it is run when the system boots.

Systemd services can be customized in various ways.

The installation script

attached here executes the steps above.
In doing so, it downloads a JRE from adoptopenjdk.net for Linux-x64 by means of curl.

install-pdf-service-with-AdoptOpenJDK-JRE-Linux-x64.sh
 #!/usr/bin/env sh
firstDir=`pwd`

echo "Please read https://www.stepoverinfo.net/src/Agreement/Agreement.html"
echo -n "Do you agree (y/n)? "
read answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
	echo "ok"
else
	exit
fi

pdf_service_jar="pdfService-4.3.0-jar-with-dependencies.jar" 
pdf_service_jar_link="https://stepoverinfo.net/DeveloperSamples/NETDriver/Setup/$pdf_service_jar"

jre_link="https://github.com/AdoptOpenJDK/openjdk16-binaries/releases/download/jdk-16%2B36/OpenJDK16-jre_x64_linux_hotspot_16_36.tar.gz"

cd /

target=/usr/local
mkdir -p $target/lib

if [ "_$1" != "_skip" ]  ;then

	curl $pdf_service_jar_link  >  $target/lib/$pdf_service_jar

	cd $target
	curl -L $jre_link | tar -zx
	cd /
fi

pdf_service_jar_path=`find $target/lib -name "pdfService-*-jar-with-dependencies.jar" | sort | tail -n 1`

jre_folder=`find $target -maxdepth 1 -type d  | grep -e "jdk-.*-jre" | sort | tail -n 1`
java=`readlink -f $jre_folder/bin/java`

cd $firstDir

printf "[Unit] \n\
Description=StepOver PDF service \n\
\n\
[Service] \n\
Type=simple \n\
PIDFile=/run/stepover-pdf-service.pid \n\
ExecStart=$java  -cp  $pdf_service_jar_path  com.so.pdfService.Main \n\
ExecStop=/bin/kill -s QUIT $MAINPID \n\
\n\
[Install] \n\
WantedBy=multi-user.target" \
> /etc/systemd/system/stepover-pdf.service

systemctl daemon-reload
systemctl restart stepover-pdf.service
systemctl enable stepover-pdf.service
systemctl status stepover-pdf.service