Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How Do I Change The Linux Service Name

Matt Kennedy June 8, 2018

I am installing JIRA Software and JIRA Servicedesk on the same linux server (different directories) however i first installed JIRA Service desk, and the service installed was jira. But after installing JIRA Software, there are two services, jira and jira1.

 

How can I change the name of jira1 to jirasoftware

1 answer

1 accepted

0 votes
Answer accepted
Mirek
Community Champion
June 8, 2018
Matt Kennedy June 10, 2018

Hi Mirek,

 

This is helpful for changing the user running the service.

 

I need to change the name of the service.

 

I am wanting to have JIRA Software and JIRA Servicedesk running from the SAME user, (lets say the user is atlas) and the services named jirasoftware and jiraservicedesk.

Mirek
Community Champion
June 11, 2018

Hmm .. Assuming that you run on linux then services are stored /etc/init.d , so you should have /etc/init.d/jira and /etc/init.d/jira1 .. Cannot you simply copy script and rename to jirasoftware and jiraservicedesk, then make a changes inside?. It might look like this...

#!/bin/sh -e
# JIRA startup script
#chkconfig: 2345 80 05
#description: JIRA

# Define some variables
# Name of app ( JIRA, Confluence, etc )
APP=jira
# Name of the user to run as
USER=jira
# Location of application's bin directory
BASE=/opt/atlassian/jira/current
# Location of Java JDK
export JAVA_HOME=/usr/lib/jvm/java-6-sun

case "$1" in
  # Start command
  start)
    echo "Starting $APP"
    /bin/su -m $USER -c "cd $BASE/logs && $BASE/bin/startup.sh &> /dev/null"
    ;;
  # Stop command
  stop)
    echo "Stopping $APP"
    /bin/su -m $USER -c "$BASE/bin/shutdown.sh &> /dev/null"
    echo "$APP stopped successfully"
    ;;
   # Restart command
   restart)
        $0 stop
        sleep 5
        $0 start
        ;;
  *)
    echo "Usage: /etc/init.d/$APP {start|restart|stop}"
    exit 1
    ;;
esac

exit 0

Second, on Debian/Ubuntu, use update-rc.d to install the script to the default runlevels

update-rc.d jirasoftware defaults

On CentOS, RHEL, Fedora and other distributions need to run the following command:

chkconfig --add jirasoftware

You should be done.

Matt Kennedy June 11, 2018

Nailed it. Thanks Merik. Cheers

Mirek
Community Champion
June 12, 2018

Awesome! Glad that I was able to help :)

Suggest an answer

Log in or Sign up to answer