Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@kohatrusty:~# service koha-api-daemon start
- Starting Hypnotoad
- ALL GLORY TO THE HYPNOTOAD.
- Use of uninitialized value $0 in scalar assignment at /usr/local/share/perl/5.14.2/Mojo/Server/Hypnotoad.pm line 44, <DATA> line 2231.
- /api/v1/script.cgiUsage: hypnotoad [OPTIONS] [APPLICATION]
- kivilahtio@kohatrusty:/home/koha/kohaclone$ cat /etc/init.d/koha-api-daemon
- #!/bin/bash
- # This file is part of Koha.
- #
- # Koha is free software; you can redistribute it and/or modify it
- # under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 3 of the License, or
- # (at your option) any later version.
- #
- # Koha is distributed in the hope that it will be useful, but
- # WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with Koha; if not, see <http://www.gnu.org/licenses>.
- ### BEGIN INIT INFO
- # Provides: koha-api-daemon
- # Required-Start: $syslog $remote_fs
- # Required-Stop: $syslog $remote_fs
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: Hypnotoad Mojolicious Server for handling Koha API requests
- ### END INIT INFO
- USER=kivilahtio
- loggedInUser=`whoami`
- NAME=koha-api-daemon
- test -f $ZEBRASRV || exit 0
- OTHERUSER=''
- if [[ $EUID -ne 0 && $loggedInUser -ne $USER ]]; then
- echo "You must run this script as 'root' or as '$USER'";
- exit 1;
- fi
- function start {
- echo "Starting Hypnotoad"
- echo "ALL GLORY TO THE HYPNOTOAD."
- su --shell /bin/bash -c "hypnotoad $PERL5LIB/api/v1/script.cgi" $USER
- }
- function stop {
- echo "Stopping Hypnotoad"
- su --shell /bin/bash -c "hypnotoad $PERL5LIB/api/v1/script.cgi -s" $USER
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- echo "Restarting Hypnotoad"
- stop
- start
- ;;
- *)
- echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
- exit 1
- ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement