Starting JIRA automatically on FreeBSD

*nix-based operating system administration is outside the scope of Atlassian support. This document is provided for information-purposes only.

On *nix-based BSD operating systems, the best practice is to install, configure and run each service (including JIRA) as a dedicated user with only the permissions they require.

To run JIRA automatically on FreeBSD:

  1. As root, create the file /usr/local/etc/rc.d/jira.sh (code shown below), which will be responsible for starting up JIRA after a reboot (or when manually invoked). If you are not using postgresql for your database, change the REQUIRE line to whatever is in the PROVIDE line in your database init script.

    #!/bin/sh
    #
    # Startup script for JIRA on FreeBSD
    #
    # This goes in /usr/local/etc/rc.d and gets run at boot-time.
    
    # PROVIDE: jira
    # REQUIRE: postgresql
    # KEYWORD: shutdown
    
    #
    # Add the following lines to /etc/rc.conf to enable jira:
    #
    #jira_enable="YES"
    #
    jira_enable="${jira_enable-NO}"
    
    . /etc/rc.subr
    
    name="jira"
    rcvar=`set_rcvar`
    start_cmd="${name}_start"
    stop_cmd="${name}_stop"
    
    jira_start()
    {
        echo -n " Starting JIRA"
        su - atlassian -c '/home/atlassian/jira/bin/startup.sh'
    }
    
    jira_stop()
    {
        echo -n " Stopping JIRA"
        su - atlassian -c '/home/atlassian/jira/bin/shutdown.sh'
    }
    
    load_rc_config $name
    run_rc_command "$1"
    
  2. Make the init script executable:

    chmod \+x /usr/local/etc/rc.d/jira.sh
    
  3. Make the init script readonly:

    chmod \-w /usr/local/etc/rc.d/jira.sh
    
  4. Add the following line to /etc/rc.conf

    jira_enable="YES"
    

More information can be found in this article.

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport