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

(-)a/debian/docs/koha-common.xml (-22 / +1 lines)
Lines 4-10 Link Here
4
<productname>Koha</productname> is the first free software library automation package.
4
<productname>Koha</productname> is the first free software library automation package.
5
<author>
5
<author>
6
  <orgname>The Koha Community</orgname>
6
  <orgname>The Koha Community</orgname>
7
  <uri>http://koha-community.org/</uri>
7
  <uri>https://koha-community.org/</uri>
8
</author>
8
</author>
9
</info>
9
</info>
10
10
Lines 180-206 Link Here
180
          <para>Manage the SIP server for named Koha instances.</para>
180
          <para>Manage the SIP server for named Koha instances.</para>
181
        </listitem>
181
        </listitem>
182
      </varlistentry>
182
      </varlistentry>
183
184
      <varlistentry>
185
        <term><option>koha-enable-sip</option></term>
186
        <listitem>
187
          <para>Copies the SIP configuration file to allow SIP to be controlled by init scripts.</para>
188
        </listitem>
189
      </varlistentry>
190
191
      <varlistentry>
192
        <term><option>koha-start-sip</option></term>
193
        <listitem>
194
          <para>Starts the SIP daemon for the specified Koha instances.</para>
195
        </listitem>
196
      </varlistentry>
197
198
      <varlistentry>
199
        <term><option>koha-stop-sip</option></term>
200
        <listitem>
201
          <para>Stops the SIP daemon for the specified Koha instances.</para>
202
        </listitem>
203
      </varlistentry>
204
    </variablelist>
183
    </variablelist>
205
    </refsect2>
184
    </refsect2>
206
185
(-)a/debian/docs/koha-enable-sip.xml (-57 lines)
Lines 1-57 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)
Lines 1-53 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)
Lines 1-52 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.bash-completion (-8 lines)
Lines 98-117 _koha_sip_enabled_instances() Link Here
98
    return 0
98
    return 0
99
}
99
}
100
100
101
# koha-*-sip autocomplete with sip-enabled instances
102
complete -F _koha_sip_enabled_instances koha-start-sip
103
complete -F _koha_sip_enabled_instances koha-restart-sip
104
complete -F _koha_sip_enabled_instances koha-stop-sip
105
106
_koha_sip_disabled()
101
_koha_sip_disabled()
107
{
102
{
108
    _koha_list_cmd "--nosip"
103
    _koha_list_cmd "--nosip"
109
    return 0
104
    return 0
110
}
105
}
111
106
112
# koha-enable-sip autocompletes with sip-disabled instances
113
complete -F _koha_sip_disabled koha-enable-sip
114
115
_koha_disabled_instances()
107
_koha_disabled_instances()
116
{
108
{
117
    _koha_list_cmd "--disabled"
109
    _koha_list_cmd "--disabled"
(-)a/debian/koha-common.install (-4 / +1 lines)
Lines 29-41 debian/scripts/koha-reset-passwd usr/sbin Link Here
29
debian/scripts/koha-restore                 usr/sbin
29
debian/scripts/koha-restore                 usr/sbin
30
debian/scripts/koha-run-backups             usr/sbin
30
debian/scripts/koha-run-backups             usr/sbin
31
debian/scripts/koha-shell                   usr/sbin
31
debian/scripts/koha-shell                   usr/sbin
32
debian/scripts/koha-sip                     usr/sbin
32
debian/scripts/koha-sitemap                 usr/sbin
33
debian/scripts/koha-sitemap                 usr/sbin
33
debian/scripts/koha-translate               usr/sbin
34
debian/scripts/koha-translate               usr/sbin
34
debian/scripts/koha-upgrade-schema          usr/sbin
35
debian/scripts/koha-upgrade-schema          usr/sbin
35
debian/scripts/koha-upgrade-to-3.4          usr/sbin
36
debian/scripts/koha-upgrade-to-3.4          usr/sbin
36
debian/scripts/koha-zebra                   usr/sbin
37
debian/scripts/koha-zebra                   usr/sbin
37
debian/scripts/koha-start-sip               usr/sbin
38
debian/scripts/koha-stop-sip                usr/sbin
39
debian/scripts/koha-enable-sip              usr/sbin
40
debian/scripts/koha-sip                     usr/sbin
41
debian/tmp_docbook/*.8                      usr/share/man/man8
38
debian/tmp_docbook/*.8                      usr/share/man/man8
(-)a/debian/koha-common.links (-1 / +4 lines)
Lines 1-3 Link Here
1
usr/sbin/koha-zebra  usr/sbin/koha-start-zebra
1
usr/sbin/koha-zebra  usr/sbin/koha-start-zebra
2
usr/sbin/koha-zebra  usr/sbin/koha-stop-zebra
2
usr/sbin/koha-zebra  usr/sbin/koha-stop-zebra
3
usr/sbin/koha-zebra  usr/sbin/koha-restart-zebra
3
usr/sbin/koha-zebra  usr/sbin/koha-restart-zebra
4
usr/sbin/koha-sip    usr/sbin/koha-enable-sip
5
usr/sbin/koha-sip    usr/sbin/koha-start-sip
6
usr/sbin/koha-sip    usr/sbin/koha-stop-sip
(-)a/debian/scripts/koha-enable-sip (-38 lines)
Lines 1-38 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-sip (+2 lines)
Lines 229-234 if [ "$used_script_name" != "koha-sip" ]; then Link Here
229
            set_action "start" ;;
229
            set_action "start" ;;
230
        koha-stop-sip)
230
        koha-stop-sip)
231
            set_action "stop" ;;
231
            set_action "stop" ;;
232
        koha-enable-sip)
233
            set_action "enable" ;;
232
        *)
234
        *)
233
            break ;;
235
            break ;;
234
    esac
236
    esac
(-)a/debian/scripts/koha-start-sip (-68 lines)
Lines 1-68 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
# Read configuration variable file if it is present
22
[ -r /etc/default/koha-common ] && . /etc/default/koha-common
23
24
# include helper functions
25
if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then
26
    . "/usr/share/koha/bin/koha-functions.sh"
27
else
28
    echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2
29
    exit 1
30
fi
31
32
for name in "$@"
33
do
34
    if [ ! -e /etc/koha/sites/${name}/koha-conf.xml ] ;
35
    then
36
        echo "No such instance: ${name}" > /dev/stderr
37
        continue;
38
    fi
39
    [ -e /etc/koha/sites/${name}/SIPconfig.xml ] || continue
40
    echo "Starting SIP server for $name"
41
    mkdir -p /var/run/koha/${name}
42
    chown "${name}-koha:${name}-koha" /var/run/koha/${name}
43
44
    adjust_paths_dev_install $name
45
    export KOHA_CONF PERL5LIB
46
    KOHA_CONF=/etc/koha/sites/${name}/koha-conf.xml
47
    # PERL5LIB has been read already
48
    if [ "$DEV_INSTALL" = "" ]; then
49
        LIBDIR=$KOHA_HOME/lib
50
    else
51
        LIBDIR=$KOHA_HOME
52
    fi
53
54
    daemon \
55
        --name="$name-koha-sip" \
56
        --errlog="/var/log/koha/$name/sip-error.log" \
57
        --stdout="/var/log/koha/$name/sip.log" \
58
        --output="/var/log/koha/$name/sip-output.log" \
59
        --verbose=1 \
60
        --respawn \
61
        --delay=30 \
62
        --pidfiles="/var/run/koha/${name}" \
63
        --user="$name-koha.$name-koha" \
64
        -- \
65
        perl \
66
        "$LIBDIR/C4/SIP/SIPServer.pm" \
67
        "/etc/koha/sites/${name}/SIPconfig.xml"
68
done
(-)a/debian/scripts/koha-stop-sip (-46 lines)
Lines 1-45 Link Here
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
    daemon \
35
        --name="$name-koha-sip" \
36
        --errlog="/var/log/koha/$name/sip-error.log" \
37
        --stdout="/var/log/koha/$name/sip.log" \
38
        --output="/var/log/koha/$name/sip-output.log" \
39
        --verbose=1 \
40
        --respawn \
41
        --delay=30 \
42
        --pidfiles="/var/run/koha/${name}" \
43
        --user="$name-koha.$name-koha" \
44
        --stop
45
done
46
- 

Return to bug 22238