Changeset 36354


Ignore:
Timestamp:
2022-08-02T11:41:43+12:00 (11 days ago)
Author:
davidb
Message:

updated notes, plus added second servicename parameter to INSTALL_SERVICE

Location:
main/trunk/greenstone3/service.d
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/service.d/INSTALL-SERVICE.sh

    r34673 r36354  
    11#!/bin/bash
    22
     3# Run this script with optional args:
     4# 1 - username for the service to run as (defaults to www-data)
     5# 2 - the name for the service (defaults to greenstone3) - change this eg if you want to run two greenstone services
    36if [ -d "/etc/systemd/system/" ] ; then
    47
     
    811
    912    gsdl_service_username=${1-www-data}
     13    gsdl_service_name=${2-greenstone3}
     14   
    1015    echo ""
    1116   
    1217    echo "****"
    13     echo "* Generating greenstone3.service from greenstone3.service.in"
     18    echo "* Generating $gsdl_service_name.service from greenstone3.service.in"
     19    echo "* using user $gsdl_service_username"
    1420    echo "****"
    1521    cat greenstone3.service.in \
    1622    | sed "s%@GSDL3SRCHOME@%$GSDL3SRCHOME%g" \
    1723    | sed "s%@GSDL_SERVICE_USERNAME@%$gsdl_service_username%g" \
    18           > greenstone3.service
     24          > $gsdl_service_name.service
    1925     
    2026    echo "****"
    21     echo "* Copying greenstone3.service to /etc/systemd/system/"
     27    echo "* Copying $gsdl_service_name.service to /etc/systemd/system/"
    2228    echo "****"
    23     sudo /bin/cp greenstone3.service /etc/systemd/system/.
     29    sudo /bin/cp $gsdl_service_name.service /etc/systemd/system/.
    2430
    2531    echo ""
     
    3036    echo ""
    3137    echo "  To enable this service to be run at boot-up time, run:"
    32     echo "    sudo systemctl enable greenstone3"
     38    echo "    sudo systemctl enable $gsdl_service_name"
    3339    echo "----"
    3440   
  • main/trunk/greenstone3/service.d/README.txt

    r34672 r36354  
    11
    2 To install Greenstone3 as a service, operating as the user www-data, run:
     2To install Greenstone3 as a service, run:
    33
    4 ./INSTALL-SERVICE.sh
     4sudo ./INSTALL-SERVICE.sh [user] [service-name]
     5
     6The two parameters are optional. The defaults are
     7 - user : www-data
     8 - service name : greenstone3
     9
     10Change the service name eg if you want to have more than one greenstone service running
     11(eg greenstone3-foo, greenstone3-bar)
    512
    613This script checks a few things first, and if all is well, goes ahead and
    7 creates the greenstone3.service file (in this folder), and then installs
    8 it.
     14creates the <service-name>.service file (in this folder), and then installs
     15it into /etc/systemd/system
    916
    1017It finishes by printing out some extra details, such as how to use the
Note: See TracChangeset for help on using the changeset viewer.