Changeset 37686


Ignore:
Timestamp:
2023-04-20T10:27:10+12:00 (13 months ago)
Author:
davidb
Message:

Upgrade to script, and update to README file

Location:
main/trunk/greenstone3/service.d
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/service.d/README.txt

    r36354 r37686  
    22To install Greenstone3 as a service, run:
    33
    4 sudo ./INSTALL-SERVICE.sh [user] [service-name]
     4    ./SUDO-INSTALL-SERVICE.sh [service-user] service-name
    55
    6 The two parameters are optional. The defaults are
    7  - user : www-data
    8  - service name : greenstone3
    96
    10 Change the service name eg if you want to have more than one greenstone service running
    11 (eg greenstone3-foo, greenstone3-bar)
     7The service-user parameter is optional. It defaults to:
     8    www-data
     9
     10Greenstone3 is typically installed as the service name:
     11    greenstone3
     12   
     13Change the service name if you want to have more than one greenstone service running
     14(e.g. greenstone3-foo, greenstone3-bar)
    1215
    1316This script checks a few things first, and if all is well, goes ahead and
  • main/trunk/greenstone3/service.d/SUDO-INSTALL-SERVICE.sh

    r37685 r37686  
    44# 1 - username for the service to run as (defaults to www-data)
    55# 2 - the name for the service (defaults to greenstone3) - change this eg if you want to run two greenstone services
     6
     7if [ $# = 0 ] || [ $# -ge 3 ] ; then
     8    # Usage then stop
     9    echo "" >&2
     10    echo "Usage: $0 [service-user] service-name" >&2
     11    echo "" >&2
     12    echo "For example:" >&2
     13    echo "    $0 greenstone3" >&2
     14    echo "" >&2
     15
     16    exit 1
     17   
     18elif [ $# = 1 ] ; then
     19    # Assume username fo service is 'www-data'   
     20    gsdl_service_username="www-data"
     21    gsdl_service_name=$1
     22else
     23    gsdl_service_username=$1
     24    gsdl_service_name=$2
     25fi
     26
     27
    628if [ -d "/etc/systemd/system/" ] ; then
    729
    830    if [ "x$GSDL3SRCHOME" = "x" ] ; then
     31
     32    full_progdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
     33    cd "$full_progdir"
     34   
    935    cd .. && source ./gs3-setup.sh && cd service.d
    1036    fi
    11 
    12     gsdl_service_username=${1-www-data}
    13     gsdl_service_name=${2-greenstone3}
    14    
    1537    echo ""
    1638   
Note: See TracChangeset for help on using the changeset viewer.