View | Details | Raw Unified | Return to bug 13799
Collapse All | Expand All

(-)a/api/v1/hypnotoad.conf (+21 lines)
Line 0 Link Here
1
### Configuration options for the hypnotoad server
2
## See. https://metacpan.org/pod/Mojo::Server::Hypnotoad
3
{
4
  hypnotoad => {
5
    proxy => 1,
6
7
    #Number of worker processes
8
    workers => 4,
9
10
    #Maximum number of connections a worker is allowed to accept before stopping
11
    #gracefully and then getting replaced with a newly started worker
12
    accepts => 100,
13
14
    #Maximum number of concurrent connections each worker process is allowed to
15
    #handle before stopping to accept new incoming connections
16
    clients => 5,
17
18
    #Number of keep-alive requests per connection
19
    requests => 50,
20
  }
21
};
(-)a/misc/bin/koha-api-daemon.sh (-1 / +66 lines)
Line 0 Link Here
0
- 
1
#!/bin/bash
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
### BEGIN INIT INFO
19
# Provides:          koha-api-daemon
20
# Required-Start:    $syslog $remote_fs
21
# Required-Stop:     $syslog $remote_fs
22
# Default-Start:     2 3 4 5
23
# Default-Stop:      0 1 6
24
# Short-Description: Hypnotoad Mojolicious Server for handling Koha API requests
25
### END INIT INFO
26
27
USER=__KOHA_USER__
28
loggedInUser=`whoami`
29
NAME=koha-api-daemon
30
KOHA_PATH=__INTRANET_WWW_DIR__
31
32
test -f $ZEBRASRV || exit 0
33
34
OTHERUSER=''
35
if [[ $EUID -ne 0 && $loggedInUser -ne $USER ]]; then
36
    echo "You must run this script as 'root' or as '$USER'";
37
    exit 1;
38
fi
39
40
function start {
41
    echo "Starting Hypnotoad"
42
    echo "ALL GLORY TO THE HYPNOTOAD."
43
    su -c "hypnotoad $PERL5LIB/api/v1/script.cgi" $USER
44
}
45
function stop {
46
    echo "Stopping Hypnotoad"
47
    su -c "hypnotoad $PERL5LIB/api/v1/script.cgi -s" $USER
48
}
49
50
case "$1" in
51
    start)
52
        start
53
      ;;
54
    stop)
55
        stop
56
      ;;
57
    restart)
58
        echo "Restarting Hypnotoad"
59
        stop
60
        start
61
      ;;
62
    *)
63
      echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
64
      exit 1
65
      ;;
66
esac

Return to bug 13799