Using Apinizer as a Linux Service

In case you want to use the application as a service, you need to make some changes to the startApinizer.sh file.If you use linux auto restart:

  • Replace export currentDirectory=$(pwd) with export currentDirectory=/opt/apinizerManager/.
  • Remove remove 2>&1 & from $JRE_FILE/bin/java $APINIZER_START_INITIAL_MEMORY $APINIZER_START_MAX_MEMORY -jar $APINIZER_MANAGER --port $APINIZER_PORT > $apinizerHome/apinizer.log 2>&1 & .

Create a service file called apinizer.service under /etc/systemd/system.

$ su -
$ vi /etc/systemd/system/apinizer.service

Fill the file:

[Unit]
Description=Apinizer

[Service]
ExecStart=/opt/apinizerManager/startApinizer.sh -s
User=apinizer
Group=apinizer

[Install]
WantedBy=default.target

After this apinizer becomes usable as a service:

$ systemctl start apinizer.service
$ systemctl status apinizer.service
$ systemctl enable apinizer.service

If you want to start Apinizer on system boot, you can enable service:

$ systemctl enable apinizer.service