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?