Ubuntu 18.04 LTS - Start as service issue

Ubuntu 18.04 LTS - Start as service issue

After following the steps for running the application as service in linux  the following errors may occur to start the service. 

Aug 17 06:56:07 ip-172-31-14-254 systemd[1]: Started ServiceDesk.
Aug 17 06:56:07 ip-172-31-14-254 systemd[14138]: servicedesk.service: Failed to execute command: Permission denied
Aug 17 06:56:07 ip-172-31-14-254 systemd[14138]: servicedesk.service: Failed at step EXEC spawning /ServiceDeskPlus-MSP/bin/run.sh: Permission denied
Aug 17 06:56:07 ip-172-31-14-254 systemd[1]: servicedesk.service: Main process exited, code=exited, status=203/EXEC
Aug 17 06:56:07 ip-172-31-14-254 systemd[1]: servicedesk.service: Failed with result 'exit-code'.

If we try to enable the service as follows we get these errors

root@ip-172-31-14-254:/etc/init.d# systemctl enable servicedesk
Synchronizing state of servicedesk.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable servicedesk
update-rc.d: error: servicedesk Default-Start contains no runlevels, aborting.


Fix:  We need to copy the servicedesk script file into /etc/systemd/system/ instead of /etc/init.d/ for this to work

UBUNTU 20:

Need to change top of original file from:

 

#!/bin/bash

#

# Startup script for the pmagent

#

 

# chkconfig: 345 99 02

# description: Run the ServiceDesk-Plus program

 

To:

 

#!/bin/sh

### BEGIN INIT INFO

# Provides:          servicedesk

# Should-Start:

# Required-Start:   

# Required-Stop:    

# Default-Start:     2 3 4 5

# Default-Stop:      0 1 6

# Short-Description: ServiceDesk

# Description:       init script for ServiceDesk

### END INIT INFO

# /etc/init.d/servicedesk

 

Ubuntu need to define Default-Start and Default-Stop to configure the service.


                  New to ADSelfService Plus?

                    • Related Articles

                    • Linux - Startup issue

                      System Halted error message during startup (Fresh installation)  Error Trace : [16:36:59:243]|[04-15-2021]|[com.adventnet.db.adapter.postgres.DefaultPostgresDBInitializer]|[INFO]|[1]: ErrorStream ::: /opt/MSP/ServiceDeskPlus-MSP/pgsql/bin/psql: error ...
                    • Startup issue in Linux after fresh installation_Error code 10001

                      In certain scenario, the application cannot be started just after the fresh install. Below are the error traces, [06:24:57:427]|[10-11-2021]|[pglog]|[INFO]|[18]: -sh: 1: /root/ManageEngine/ServiceDeskPlus-MSP/pgsql/bin/pg_ctl: Permission denied| ...
                    • Known issue in generating reports in Linux installation

                      Error: Sorry an error has occurred. It appears to be an issue related to the fonts. JDK recommends installing the font on the Linux machine. In general, OpenJDK installation packages do not include any font files by default. But automatically use ...
                    • Migration of ServiceDesk Plus from Windows to Linux Server

                      The following instructions will help you migrate the ServiceDesk Plus from Windows to Linux Server 1. Take a trimmed backup using the commands below, cmd> cd [ServiceDesk-Home]\bin cmd> backupdata.bat --trimmed The backup will now be created under ...
                    • Run the Application as a Service in Linux server (tested on Cent OS 8)

                      This is for Version 11.0.  https://help.servicedeskplus.com/introduction/start-servicedeskplus-server.html$Linux