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.


          • 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| ...
          • 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 ...
          • How to download agent from application installed in LINUX machine.

            Issue Description: There is an issue downloading agent from application installed in LINUX machines. While downloading the agent we write certain server related settings (i.e) server name, port number etc, in the agent using a dll file. Since .dll is ...
          • Upgrade failure to 10500 - Linux platforms

            You may experience an upgrade failure in linux platforms when upgrading to 10500. Here are the traces from logs, Feb 21, 2020 4:55:03 PM  [com.adventnet.tools.update.installer.Unzipper]  [SEVERE] : ERRUnexpected Error. Please click View Log>> for ...