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

(-)a/debian/koha-common.init (-7 / +74 lines)
Lines 70-75 do_reload() { Link Here
70
    koha-start-sip $(koha-list --enabled)
70
    koha-start-sip $(koha-list --enabled)
71
}
71
}
72
72
73
#
74
# Function that checks zebrasrv is running for the specified instance
75
#
76
is_zebra_running()
77
{
78
    local instancename=$1
79
80
    if daemon --name="$instancename-koha-zebra" \
81
            --user="$instancename-koha.$instancename-koha" \
82
            --running ; then
83
        return 0
84
    else
85
        return 1
86
    fi
87
}
88
89
#
90
# Function that checks SIP server is running for the specified instance
91
#
92
is_sip_running()
93
{
94
    local instancename=$1
95
96
    if daemon --name="$instancename-koha-sip" \
97
            --pidfiles="/var/run/koha/$instancename" \
98
            --user="$instancename-koha.$instancename-koha" \
99
            --running ; then
100
        return 0
101
    else
102
        return 1
103
    fi
104
}
105
106
#
107
# Function that shows the status of the zebrasrv daemon for
108
# enabled instances
109
#
110
zebra_status()
111
{
112
    for instance in $(koha-list --enabled); do
113
114
        log_daemon_msg "Zebra server running for instace $instance"
115
116
        if is_zebra_running $instance ; then
117
            log_end_msg 0
118
        else
119
            log_end_msg 1
120
        fi
121
    done
122
}
123
124
#
125
# Function that shows the status of the SIP server daemon for
126
# enabled instances
127
#
128
sip_status()
129
{
130
    for instance in $(koha-list --enabled --sip); do
131
132
        log_daemon_msg "SIP server running for instace $instance"
133
134
        if is_sip_running $instance ; then
135
            log_end_msg 0
136
        else
137
            log_end_msg 1
138
        fi
139
    done
140
}
141
73
case "$1" in
142
case "$1" in
74
  start)
143
  start)
75
	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
144
	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
Lines 108-120 case "$1" in Link Here
108
		;;
177
		;;
109
	esac
178
	esac
110
	;;
179
	;;
111
# TODO: Implement this. It should check every daemon is running
180
  status)
112
#  status)
181
        zebra_status
113
#        status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
182
        sip_status
114
#        ;;
183
        ;;
115
  *)
184
  *)
116
    #echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
185
	echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
117
    echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
118
	exit 3
186
	exit 3
119
	;;
187
	;;
120
esac
188
esac
121
- 

Return to bug 10624