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 ADManager Plus?

                  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 ...
                    • 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 ...
                    • 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| ...
                    • Syntax for SDP MSP migration to Linux

                      While migrating to different database you can use backupdataold.bat. Here backup will be in .data format and this can be restored in across DB platform. Note: Backup from taken from a particular build can be restored only on the same build. Example: ...
                    • 10.5 Linux Upgrade failure and solutions

                      Traces in logs : 1. java.lang.Exception: InitPgsqlScript exited with value :: 1 at com.adventnet.persistence.PostgresPreProcessor.executeInitPgsqlScript(PostgresPreProcessor.java:1733) 2. PGSQL Permission related errors. 3. SDP MSP installed as root ...