Last change
on this file since 36761 was 34682, checked in by davidb, 3 years ago |
Files to setup and run extension as a Unix service
|
-
Property svn:executable
set to
*
|
File size:
1.2 KB
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 | _servicename=greenstone3-triplestore
|
---|
4 |
|
---|
5 | if [ -d "/etc/systemd/system/" ] ; then
|
---|
6 |
|
---|
7 | if [ "x$GEXT_JENA" = "x" ] ; then
|
---|
8 | cd .. && source ./setup.bash && cd service.d
|
---|
9 | fi
|
---|
10 |
|
---|
11 | gsdl_service_username=${1-www-data}
|
---|
12 | echo ""
|
---|
13 |
|
---|
14 | echo "****"
|
---|
15 | echo "* Generating $_servicename.service from $_servicename.service.in"
|
---|
16 | echo "****"
|
---|
17 | cat $_servicename.service.in \
|
---|
18 | | sed "s%@GEXT_JENA@%$GEXT_JENA%g" \
|
---|
19 | | sed "s%@GSDL_SERVICE_USERNAME@%$gsdl_service_username%g" \
|
---|
20 | > $_servicename.service
|
---|
21 |
|
---|
22 | echo "****"
|
---|
23 | echo "* Copying $_servicename.service to /etc/systemd/system/"
|
---|
24 | echo "****"
|
---|
25 | sudo /bin/cp $_servicename.service /etc/systemd/system/.
|
---|
26 |
|
---|
27 | echo ""
|
---|
28 | echo "----"
|
---|
29 | echo "General info:"
|
---|
30 | echo " In the event of the service being updated, you will most likely need to run:"
|
---|
31 | echo " sudo systemctl daemon-reload"
|
---|
32 | echo ""
|
---|
33 | echo " To enable this service to be run at boot-up time, run:"
|
---|
34 | echo " sudo systemctl enable $_servicename"
|
---|
35 | echo "----"
|
---|
36 |
|
---|
37 | else
|
---|
38 | echo "Error: Failed to find '/etc/systemd/system'" >&2
|
---|
39 | echo "This install script was developed on a Debian system." >&2
|
---|
40 | echo "It looks like your Linux Distribution uses a different directory structure for services" >&2
|
---|
41 |
|
---|
42 | exit 1
|
---|
43 | fi
|
---|
44 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.