Logoj0ke.net Open Build Service > Projects > home:netmax > festival-german > rcfestival
Sign Up | Log In

File rcfestival of Package festival-german

x
 
1
#! /bin/sh
2
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>.
3
# All rights reserved.
4
#
5
# This file and all modifications and additions to the pristine
6
# package are under the same license as the package itself.
7
#
8
# /etc/init.d/festival
9
#   and its symbolic link
10
# /usr/sbin/rcfestival
11
#
12
### BEGIN INIT INFO
13
# Provides:          festival
14
# Required-Start:    $syslog $remote_fs
15
# Should-Start:      $time
16
# Required-Stop:     $syslog $remote_fs
17
# Should-Stop:       $time
18
# Default-Start:     3 5
19
# Default-Stop:      0 1 2 6
20
# Short-Description: festival daemon providing full text-to-speech system
21
# Description:       Start festival to allow applications to access a
22
#   text-to-speech system with various APIs, as well as an environment
23
#   for development and research of speech synthesis techniques. It is
24
#   written in C++ and has a Scheme-based command interpreter for
25
#   general control. 
26
### END INIT INFO
27
28
# Check for missing binaries (stale symlinks should not happen)
29
# Note: Special treatment of stop for LSB conformance
30
FESTIVAL_BIN=/usr/bin/festival
31
test -x $FESTIVAL_BIN || { echo "$FESTIVAL_BIN not installed"; 
32
    if [ "$1" = "stop" ]; then exit 0;
33
    else exit 5; fi; }
34
35
# Check for existence of needed config file and read it
36
FESTIVAL_CONFIG=/etc/sysconfig/festival
37
test -r $FESTIVAL_CONFIG || { echo "$FESTIVAL_CONFIG not existing";
38
    if [ "$1" = "stop" ]; then exit 0;
39
    else exit 6; fi; }
40
41
# Read config   
42
. $FESTIVAL_CONFIG
43
44
# Source LSB init functions
45
. /etc/rc.status
46
47
# Reset status of this service
48
rc_reset
49
50
case "$1" in
51
    start)
52
    echo -n "Starting festival "
53
    /sbin/startproc $FESTIVAL_BIN --server $FESTIVAL_OPTIONS >/dev/null 2>&1
54
    rc_status -v
55
    ;;
56
    stop)
57
    echo -n "Shutting down festival "
58
    /sbin/killproc -TERM $FESTIVAL_BIN
59
    rc_status -v
60
    ;;
61
    try-restart|condrestart)
62
    if test "$1" = "condrestart"; then
63
        echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
64
    fi
65
    $0 status
66
    if test $? = 0; then
67
        $0 restart
68
    else
69
        rc_reset    # Not running is not a failure.
70
    fi
71
    rc_status
72
    ;;
73
    restart)
74
    $0 stop
75
    $0 start
76
    rc_status
77
    ;;
78
    force-reload)
79
    echo -n "Reload service festival "
80
    /sbin/killproc -HUP $FESTIVAL_BIN
81
    rc_status -v
82
    ;;
83
    reload)
84
    echo -n "Reload service festival "
85
    /sbin/killproc -HUP $FESTIVAL_BIN
86
    rc_status -v
87
    ;;
88
    status)
89
    echo -n "Checking for service festival "
90
    /sbin/checkproc $FESTIVAL_BIN
91
    rc_status -v
92
    ;;
93
    probe)
94
    test /etc/festival.scm -nt /var/run/festival.pid && echo reload
95
    ;;
96
    *)
97
    echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
98
    exit 1
99
    ;;
100
esac
101
rc_exit
102