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

(-)a/debian/docs/koha-enable-sip.xml (+57 lines)
Line 0 Link Here
1
<article xmlns='http://docbook.org/ns/docbook'>
2
<title>koha-enable-sip</title>
3
<info>
4
    <productname>Koha</productname> is the first free software library automation package.
5
    <author>
6
        <personname>
7
            <firstname>Robin</firstname>
8
            <surname>Sheat</surname>
9
        </personname>
10
        <affiliation>
11
            <orgname>Catalyst IT</orgname>
12
            <uri>http://www.catalyst.net.nz</uri>
13
        </affiliation>
14
        <contrib>Author</contrib>
15
    </author>
16
</info>
17
18
<refentry xml:id="koha-enable-sip">
19
20
    <refmeta>
21
        <refentrytitle>koha-enable-sip</refentrytitle>
22
        <manvolnum>8</manvolnum>
23
    </refmeta>
24
25
    <refnamediv>
26
        <refname>koha-enable-sip</refname>
27
        <refpurpose>Copies the SIP configuration file to allow SIP to be controlled by init scripts.</refpurpose>
28
        <refclass>UNIX/Linux</refclass>
29
    </refnamediv>
30
31
    <refsynopsisdiv>
32
        <cmdsynopsis>
33
            <command>koha-enable-sip</command>
34
            <arg choice="req" rep="repeat"><replaceable>instancename</replaceable></arg>
35
        </cmdsynopsis>
36
    </refsynopsisdiv>
37
38
    <refsect1><title>Description</title>
39
        <para>This copies the default SIP configuration file /etc/koha/SIPconfig.xml to the
40
            /etc/koha/sites/instancename directory. This allows it to be started by
41
            <command>koha-start-sip(8)</command>, and <command>koha-stop-sip</command>. In turn,
42
            this means that it will be started on boot and stopped on shutdown.</para>
43
        <para>After running this, you will need to edit the newly created file to configure it
44
            for your site.</para>
45
        <para>To disable SIP again, delete or rename the configuration file.</para>
46
    </refsect1>
47
48
  <refsect1><title>See also</title>
49
  <simplelist type="inline">
50
    <member><command>koha-start-sip(8)</command></member>
51
    <member><command>koha-stop-sip(8)</command></member>
52
  </simplelist>
53
  </refsect1>
54
55
</refentry>
56
57
</article>
(-)a/debian/docs/koha-start-sip.xml (+53 lines)
Line 0 Link Here
1
<article xmlns='http://docbook.org/ns/docbook'>
2
<title>koha-start-sip</title>
3
<info>
4
    <productname>Koha</productname> is the first free software library automation package.
5
    <author>
6
        <personname>
7
            <firstname>Robin</firstname>
8
            <surname>Sheat</surname>
9
        </personname>
10
        <affiliation>
11
            <orgname>Catalyst IT</orgname>
12
            <uri>http://www.catalyst.net.nz</uri>
13
        </affiliation>
14
        <contrib>Author</contrib>
15
    </author>
16
</info>
17
18
<refentry xml:id="koha-start-sip">
19
20
    <refmeta>
21
        <refentrytitle>koha-start-sip</refentrytitle>
22
        <manvolnum>8</manvolnum>
23
    </refmeta>
24
25
    <refnamediv>
26
        <refname>koha-start-sip</refname>
27
        <refpurpose>Starts the SIP daemon for the specified Koha instances.</refpurpose>
28
        <refclass>UNIX/Linux</refclass>
29
    </refnamediv>
30
31
    <refsynopsisdiv>
32
        <cmdsynopsis>
33
            <command>koha-start-sip</command>
34
            <arg choice="req" rep="repeat"><replaceable>instancename</replaceable></arg>
35
        </cmdsynopsis>
36
    </refsynopsisdiv>
37
38
    <refsect1><title>Description</title>
39
        <para>This will start the SIP daemon for the Koha instance specified by <arg>instancename</arg>.</para>
40
        <para>If the SIP configuration is not present for the supplied instance, it will be silently skipped.</para>
41
        <para>To enable SIP support for an instance, refer to <command>koha-enable-sip(8)</command>.</para>
42
    </refsect1>
43
44
  <refsect1><title>See also</title>
45
  <simplelist type="inline">
46
    <member><command>koha-stop-sip(8)</command></member>
47
    <member><command>koha-enable-sip(8)</command></member>
48
  </simplelist>
49
  </refsect1>
50
51
</refentry>
52
53
</article>
(-)a/debian/docs/koha-stop-sip.xml (+52 lines)
Line 0 Link Here
1
<article xmlns='http://docbook.org/ns/docbook'>
2
<title>koha-stop-sip</title>
3
<info>
4
    <productname>Koha</productname> is the first free software library automation package.
5
    <author>
6
        <personname>
7
            <firstname>Robin</firstname>
8
            <surname>Sheat</surname>
9
        </personname>
10
        <affiliation>
11
            <orgname>Catalyst IT</orgname>
12
            <uri>http://www.catalyst.net.nz</uri>
13
        </affiliation>
14
        <contrib>Author</contrib>
15
    </author>
16
</info>
17
18
<refentry xml:id="koha-stop-sip">
19
20
    <refmeta>
21
        <refentrytitle>koha-stop-sip</refentrytitle>
22
        <manvolnum>8</manvolnum>
23
    </refmeta>
24
25
    <refnamediv>
26
        <refname>koha-stop-sip</refname>
27
        <refpurpose>Stops the SIP daemon for the specified Koha instances.</refpurpose>
28
        <refclass>UNIX/Linux</refclass>
29
    </refnamediv>
30
31
    <refsynopsisdiv>
32
        <cmdsynopsis>
33
            <command>koha-stop-sip</command>
34
            <arg choice="req" rep="repeat"><replaceable>instancename</replaceable></arg>
35
        </cmdsynopsis>
36
    </refsynopsisdiv>
37
38
    <refsect1><title>Description</title>
39
        <para>This will stop the SIP daemon for the Koha instance specified by <arg>instancename</arg>.</para>
40
        <para>If it's not running, an note will be displayed.</para>
41
    </refsect1>
42
43
  <refsect1><title>See also</title>
44
  <simplelist type="inline">
45
    <member><command>koha-start-sip(8)</command></member>
46
    <member><command>koha-enable-sip(8)</command></member>
47
  </simplelist>
48
  </refsect1>
49
50
</refentry>
51
52
</article>
(-)a/debian/koha-common.init (+4 lines)
Lines 45-50 do_start() Link Here
45
    # We insure all required directories exist, including disabled ones.
45
    # We insure all required directories exist, including disabled ones.
46
    koha-create-dirs $(koha-list)
46
    koha-create-dirs $(koha-list)
47
    koha-start-zebra $(koha-list --enabled)
47
    koha-start-zebra $(koha-list --enabled)
48
    koha-start-sip $(koha-list --enabled)
48
}
49
}
49
50
50
#
51
#
Lines 54-59 do_stop() Link Here
54
{
55
{
55
    # We stop everything, including disabled ones.
56
    # We stop everything, including disabled ones.
56
    koha-stop-zebra $(koha-list) || true
57
    koha-stop-zebra $(koha-list) || true
58
    koha-stop-sip $(koha-list) || true
57
}
59
}
58
60
59
#
61
#
Lines 61-66 do_stop() Link Here
61
#
63
#
62
do_reload() {
64
do_reload() {
63
    koha-restart-zebra $(koha-list --enabled)
65
    koha-restart-zebra $(koha-list --enabled)
66
    koha-stop-sip $(koha-list) || true
67
    koha-start-sip $(koha-list --enabled)
64
}
68
}
65
69
66
case "$1" in
70
case "$1" in
(-)a/debian/koha-common.install (+3 lines)
Lines 29-32 debian/scripts/koha-start-zebra usr/sbin Link Here
29
debian/scripts/koha-stop-zebra              usr/sbin
29
debian/scripts/koha-stop-zebra              usr/sbin
30
debian/scripts/koha-upgrade-schema          usr/sbin
30
debian/scripts/koha-upgrade-schema          usr/sbin
31
debian/scripts/koha-upgrade-to-3.4          usr/sbin
31
debian/scripts/koha-upgrade-to-3.4          usr/sbin
32
debian/scripts/koha-start-sip               usr/sbin
33
debian/scripts/koha-stop-sip                usr/sbin
34
debian/scripts/koha-enable-sip              usr/sbin
32
debian/tmp_docbook/*.8                      usr/share/man/man8
35
debian/tmp_docbook/*.8                      usr/share/man/man8
(-)a/debian/scripts/koha-enable-sip (+38 lines)
Line 0 Link Here
1
#!/bin/sh
2
#
3
# koha-enable-sip -- Set up the config files to allow SIP to run
4
# Copyright 2012  Catalyst IT, Ltd
5
#
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19
set -e
20
21
for name in "$@"
22
do
23
    if [ ! -e /etc/koha/sites/${name}/koha-conf.xml ] ;
24
    then
25
        echo "No such instance: ${name}" > /dev/stderr
26
        continue;
27
    fi
28
    sipfile=/etc/koha/sites/${name}/SIPconfig.xml
29
    if [ -e ${sipfile} ]
30
    then
31
        echo "SIP already enabled for $name"
32
    else
33
        echo "Enabling SIP for $name - edit ${sipfile} to configure"
34
        cp -v /etc/koha/SIPconfig.xml ${sipfile}
35
        chown ${name}-koha:${name}-koha ${sipfile}
36
        chmod 600 ${sipfile}
37
    fi
38
done
(-)a/debian/scripts/koha-start-sip (+49 lines)
Line 0 Link Here
1
#!/bin/sh
2
#
3
# koha-start-sip -- Start SIP server for named Koha instance
4
# Copyright 2012  Catalyst IT, Ltd
5
#
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19
set -e
20
21
for name in "$@"
22
do
23
    if [ ! -e /etc/koha/sites/${name}/koha-conf.xml ] ;
24
    then
25
        echo "No such instance: ${name}" > /dev/stderr
26
        continue;
27
    fi
28
    [ -e /etc/koha/sites/${name}/SIPconfig.xml ] || continue
29
    echo "Starting SIP server for $name"
30
    mkdir -p /var/run/koha/${name}
31
    chown "${name}-koha:${name}-koha" /var/run/koha/${name}
32
    export KOHA_CONF PERL5LIB
33
    KOHA_CONF=/etc/koha/sites/${name}/koha-conf.xml
34
    PERL5LIB="/usr/share/koha/lib:/usr/share/koha/lib/C4/SIP"
35
    daemon \
36
        --name="$name-koha-sip" \
37
        --errlog="/var/log/koha/$name/sip-error.log" \
38
        --stdout="/var/log/koha/$name/sip.log" \
39
        --output="/var/log/koha/$name/sip-output.log" \
40
        --verbose=1 \
41
        --respawn \
42
        --delay=30 \
43
        --pidfiles="/var/run/koha/${name}" \
44
        --user="$name-koha.$name-koha" \
45
        -- \
46
        perl \
47
        "/usr/share/koha/lib/C4/SIP/SIPServer.pm" \
48
        "/etc/koha/sites/${name}/SIPconfig.xml"
49
done
(-)a/debian/scripts/koha-stop-sip (-1 / +52 lines)
Line 0 Link Here
0
- 
1
#!/bin/sh
2
#
3
# koha-stop-sip -- Stop SIP server for named Koha instance
4
# Copyright 2012  Catalyst IT, Ltd
5
#
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19
set -e
20
21
for name in "$@"
22
do
23
    if [ ! -e /etc/koha/sites/${name}/koha-conf.xml ] ;
24
    then
25
        echo "No such instance: ${name}" > /dev/stderr
26
        continue;
27
    fi
28
    if [ ! -e /var/run/koha/${name}/${name}-koha-sip.pid ] ;
29
    then
30
        echo "SIP server for ${name} not running."
31
        continue;
32
    fi
33
    echo "Stopping SIP server for $name"
34
    KOHA_CONF=/etc/koha/sites/${name}/koha-conf.xml
35
    PERL5LIB=/usr/share/koha/lib
36
    export KOHA_CONF PERL5LIB
37
    daemon \
38
        --name="$name-koha-sip" \
39
        --errlog="/var/log/koha/$name/sip-error.log" \
40
        --stdout="/var/log/koha/$name/sip.log" \
41
        --output="/var/log/koha/$name/sip-output.log" \
42
        --verbose=1 \
43
        --respawn \
44
        --delay=30 \
45
        --pidfiles="/var/run/koha/${name}" \
46
        --user="$name-koha.$name-koha" \
47
        --stop \
48
        -- \
49
        perl \
50
        "/usr/share/koha/lib/C4/SIP/SIPServer.pm" \
51
        "/etc/koha/sites/${name}/SIPconfig.xml"
52
done

Return to bug 9250