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

(-)a/debian/scripts/koha-elasticsearch (-10 / +3 lines)
Lines 84-95 run_rebuild_elasticsearch() Link Here
84
    # read instance name and eliminate instance name from params
84
    # read instance name and eliminate instance name from params
85
    local name=$1; shift
85
    local name=$1; shift
86
86
87
    if [ "$GIT_INSTALL" = "" ]; then
88
        KOHA_BINDIR=${KOHA_HOME}/bin
89
    else
90
        KOHA_BINDIR=${KOHA_HOME}/misc
91
    fi
92
93
    if [ "${clo_commit_size}" -gt 0 ] 2>/dev/null; then
87
    if [ "${clo_commit_size}" -gt 0 ] 2>/dev/null; then
94
        commit_size=${clo_commit_size}
88
        commit_size=${clo_commit_size}
95
    fi
89
    fi
Lines 120-127 run_rebuild_elasticsearch() Link Here
120
        rebuild_opts="${rebuild_opts} -v"
114
        rebuild_opts="${rebuild_opts} -v"
121
    fi
115
    fi
122
116
117
    # KOHA_HOME and KOHA_BINDIR may have been adjusted/set by adjust_paths_git_install
123
    if koha-shell \
118
    if koha-shell \
124
          -c "${KOHA_BINDIR}/search_tools/rebuild_elasticsearch.pl ${rebuild_opts}" \
119
          -c "${KOHA_HOME}/${KOHA_BINDIR}/search_tools/rebuild_elasticsearch.pl ${rebuild_opts}" \
125
          ${name}; then
120
          ${name}; then
126
        return 0
121
        return 0
127
    else
122
    else
Lines 177-185 while [ -n "$*" ]; do Link Here
177
    shift
172
    shift
178
done
173
done
179
174
180
# Optionally use alternative paths for a dev install
181
adjust_paths_git_install $1
182
183
# Parse command line.
175
# Parse command line.
184
if [ $# -lt 1 ]; then
176
if [ $# -lt 1 ]; then
185
    usage
177
    usage
Lines 190-195 fi Link Here
190
for name in "$@"
182
for name in "$@"
191
do
183
do
192
    if is_instance $name; then
184
    if is_instance $name; then
185
        adjust_paths_git_install $name
193
        if [ "${op}" = "rebuild" ]; then
186
        if [ "${op}" = "rebuild" ]; then
194
            if ! run_rebuild_elasticsearch $name; then
187
            if ! run_rebuild_elasticsearch $name; then
195
                warn "Something went wrong rebuilding indexes for ${name}"
188
                warn "Something went wrong rebuilding indexes for ${name}"
(-)a/debian/scripts/koha-es-indexer (-12 / +4 lines)
Lines 198-221 while [ $# -gt 0 ]; do Link Here
198
198
199
done
199
done
200
200
201
# Optionally use alternative paths for a dev install
202
adjust_paths_git_install $1
203
204
if [ "$GIT_INSTALL" = "" ]; then
205
    worker_DAEMON="${KOHA_HOME}/bin/workers/es_indexer_daemon.pl"
206
else
207
    worker_DAEMON="${KOHA_HOME}/misc/workers/es_indexer_daemon.pl"
208
fi
209
210
# PERL5LIB has been read from etc/default
211
export PERL5LIB
212
213
if [ $# -gt 0 ]; then
201
if [ $# -gt 0 ]; then
214
    # We have at least one instance name
202
    # We have at least one instance name
215
    for name in "$@"; do
203
    for name in "$@"; do
216
204
217
        if is_instance $name; then
205
        if is_instance $name; then
218
206
207
            adjust_paths_dev_install $name
208
            worker_DAEMON="${KOHA_HOME}/${KOHA_BINDIR}/workers/es_indexer_daemon.pl"
209
            export PERL5LIB
210
219
            case $op in
211
            case $op in
220
                "start")
212
                "start")
221
                    start_es_indexer $name
213
                    start_es_indexer $name
(-)a/debian/scripts/koha-indexer (-13 / +7 lines)
Lines 194-212 while [ $# -gt 0 ]; do Link Here
194
194
195
done
195
done
196
196
197
# Optionally use alternative paths for a dev install
198
adjust_paths_git_install $1
199
200
# Check if an alternate indexer has been set
197
# Check if an alternate indexer has been set
201
if [ ! -z "$ALTERNATE_INDEXER_DAEMON" ]; then
198
if [ ! -z "$ALTERNATE_INDEXER_DAEMON" ]; then
202
    INDEXER_DAEMON="$ALTERNATE_INDEXER_DAEMON"
199
    INDEXER_DAEMON="$ALTERNATE_INDEXER_DAEMON"
203
else
204
    # We default to rebuild_zebra.pl if no alternate indexer set
205
    if [ "$GIT_INSTALL" = "" ]; then
206
        INDEXER_DAEMON="${KOHA_HOME}/bin/migration_tools/rebuild_zebra.pl"
207
    else
208
        INDEXER_DAEMON="${KOHA_HOME}/misc/migration_tools/rebuild_zebra.pl"
209
    fi
210
fi
200
fi
211
201
212
if [ $INDEXER_TIMEOUT -lt 1 ]; then
202
if [ $INDEXER_TIMEOUT -lt 1 ]; then
Lines 219-233 if [ -z "$INDEXER_PARAMS" ]; then Link Here
219
    INDEXER_PARAMS="-daemon -sleep $INDEXER_TIMEOUT $DEBUG"
209
    INDEXER_PARAMS="-daemon -sleep $INDEXER_TIMEOUT $DEBUG"
220
fi
210
fi
221
211
222
# PERL5LIB has been read from etc/default
223
export PERL5LIB
224
225
if [ $# -gt 0 ]; then
212
if [ $# -gt 0 ]; then
226
    # We have at least one instance name
213
    # We have at least one instance name
227
    for name in "$@"; do
214
    for name in "$@"; do
228
215
229
        if is_instance $name; then
216
        if is_instance $name; then
230
217
218
            adjust_paths_git_install $name
219
            if [ -z "$ALTERNATE_INDEXER_DAEMON" ]; then
220
                # We default to rebuild_zebra.pl if no alternate indexer set
221
                INDEXER_DAEMON="${KOHA_HOME}/${KOHA_BINDIR}/migration_tools/rebuild_zebra.pl"
222
            fi
223
            export PERL5LIB
224
231
            case $op in
225
            case $op in
232
                "start")
226
                "start")
233
                    start_indexer $name
227
                    start_indexer $name
(-)a/debian/scripts/koha-rebuild-zebra (-11 / +4 lines)
Lines 56-73 run_rebuild_zebra() Link Here
56
       [     "${full_reindex}" = "yes" ] ||
56
       [     "${full_reindex}" = "yes" ] ||
57
       [            "${force}" = "yes" ] ; then
57
       [            "${force}" = "yes" ] ; then
58
58
59
        if [ "$GIT_INSTALL" = "" ]; then
60
            KOHA_BINDIR=$KOHA_HOME/bin
61
        else
62
            KOHA_BINDIR=$KOHA_HOME/misc
63
        fi
64
65
        # TODO: This comment is here to remind us that we should make
59
        # TODO: This comment is here to remind us that we should make
66
        # rebuild_zebra.pl return error codes on failure
60
        # rebuild_zebra.pl return error codes on failure
67
        if sudo -u "$instancename-koha" -H \
61
        if sudo -u "$instancename-koha" -H \
68
            env PERL5LIB=$PERL5LIB \
62
            env PERL5LIB=$PERL5LIB \
69
            KOHA_CONF="/etc/koha/sites/$instancename/koha-conf.xml" \
63
            KOHA_CONF="/etc/koha/sites/$instancename/koha-conf.xml" \
70
            $KOHA_BINDIR/migration_tools/rebuild_zebra.pl $@ ; then
64
            $KOHA_HOME/$KOHA_BINDIR/migration_tools/rebuild_zebra.pl $@ ; then
71
            return 0
65
            return 0
72
        else
66
        else
73
            return 1
67
            return 1
Lines 148-157 while [ -n "$*" ]; do Link Here
148
    shift
142
    shift
149
done
143
done
150
144
151
# Optionally use alternative paths for a dev install
152
adjust_paths_git_install $1
153
154
# Parse command line.
155
if [ $# -lt 1 ]; then
145
if [ $# -lt 1 ]; then
156
    if [ "$quiet" = "no" ]; then
146
    if [ "$quiet" = "no" ]; then
157
        usage
147
        usage
Lines 165-170 fi Link Here
165
for name in "$@"
155
for name in "$@"
166
do
156
do
167
    if is_instance $name; then
157
    if is_instance $name; then
158
159
        adjust_paths_git_install $name
160
168
        if [ "$biblios" = "yes" ]; then
161
        if [ "$biblios" = "yes" ]; then
169
            if ! run_rebuild_zebra $name \
162
            if ! run_rebuild_zebra $name \
170
                -b $opt_verbose $opt_idx $opts_other; then
163
                -b $opt_verbose $opt_idx $opts_other; then
(-)a/debian/scripts/koha-reset-passwd (-10 / +3 lines)
Lines 45-63 set_password() Link Here
45
    local instancename=$1
45
    local instancename=$1
46
    local userid=$2
46
    local userid=$2
47
47
48
    # Optionally use alternative paths for a dev install
49
    adjust_paths_git_install $1
50
51
    if [ "$GIT_INSTALL" = "" ]; then
52
        KOHA_BINDIR=$KOHA_HOME/bin
53
    else
54
        KOHA_BINDIR=$KOHA_HOME/misc
55
    fi
56
57
    if sudo -u "$instancename-koha" -H \
48
    if sudo -u "$instancename-koha" -H \
58
        env PERL5LIB=$PERL5LIB \
49
        env PERL5LIB=$PERL5LIB \
59
        KOHA_CONF="/etc/koha/sites/$instancename/koha-conf.xml" \
50
        KOHA_CONF="/etc/koha/sites/$instancename/koha-conf.xml" \
60
        $KOHA_BINDIR/admin/set_password.pl --userid $userid ; then
51
        $KOHA_HOME/$KOHA_BINDIR/admin/set_password.pl --userid $userid ; then
61
52
62
        return 0
53
        return 0
63
    else
54
    else
Lines 72-77 fi Link Here
72
63
73
instance="$1"
64
instance="$1"
74
shift
65
shift
66
# Adjust KOHA_HOME, KOHA_BINDIR if needed
67
adjust_paths_git_install $instance
75
68
76
for userid in "$@"
69
for userid in "$@"
77
do
70
do
(-)a/debian/scripts/koha-sip (-1 / +1 lines)
Lines 70-76 start_sip() Link Here
70
            adjust_paths_git_install $name
70
            adjust_paths_git_install $name
71
            export KOHA_HOME PERL5LIB
71
            export KOHA_HOME PERL5LIB
72
72
73
            if [ "$GIT_INSTALL" = "" ]; then
73
            if ! is_git_install $name; then
74
                LIBDIR=$KOHA_HOME/lib
74
                LIBDIR=$KOHA_HOME/lib
75
            else
75
            else
76
                LIBDIR=$KOHA_HOME
76
                LIBDIR=$KOHA_HOME
(-)a/debian/scripts/koha-sitemap (-9 / +3 lines)
Lines 110-116 generate_sitemap() Link Here
110
        if sudo -u "$instance-koha" -H \
110
        if sudo -u "$instance-koha" -H \
111
            env PERL5LIB=$PERL5LIB \
111
            env PERL5LIB=$PERL5LIB \
112
            KOHA_CONF="/etc/koha/sites/$instance/koha-conf.xml" \
112
            KOHA_CONF="/etc/koha/sites/$instance/koha-conf.xml" \
113
            $KOHA_BINDIR/cronjobs/sitemap.pl \
113
            $KOHA_HOME/$KOHA_BINDIR/cronjobs/sitemap.pl \
114
                --dir $sitemapdir ; then
114
                --dir $sitemapdir ; then
115
            return 0
115
            return 0
116
        else
116
        else
Lines 171-190 while [ $# -gt 0 ]; do Link Here
171
171
172
done
172
done
173
173
174
# Optionally use alternative paths for a dev install
175
adjust_paths_git_install $1
176
if [ "$GIT_INSTALL" = "" ]; then
177
    KOHA_BINDIR=$KOHA_HOME/bin
178
else
179
    KOHA_BINDIR=$KOHA_HOME/misc
180
fi
181
182
if [ $# -gt 0 ]; then
174
if [ $# -gt 0 ]; then
183
    # We have at least one instance name
175
    # We have at least one instance name
184
    for name in "$@"; do
176
    for name in "$@"; do
185
177
186
        if is_instance $name; then
178
        if is_instance $name; then
187
179
180
            adjust_paths_git_install $name
181
188
            case $op in
182
            case $op in
189
                "generate")
183
                "generate")
190
                    generate_sitemap $name
184
                    generate_sitemap $name
(-)a/debian/scripts/koha-upgrade-schema (-8 / +8 lines)
Lines 29-45 else Link Here
29
    exit 1
29
    exit 1
30
fi
30
fi
31
31
32
# Optionally use alternative paths for a dev install
33
adjust_paths_git_install $1
34
if [ "$GIT_INSTALL" = "" ]; then
35
    CGI_PATH=$KOHA_HOME/intranet/cgi-bin
36
else
37
    CGI_PATH=$KOHA_HOME
38
fi
39
40
for name in "$@"
32
for name in "$@"
41
do
33
do
42
    if is_instance $name; then
34
    if is_instance $name; then
35
36
        adjust_paths_git_install $name
37
        if ! is_git_install $name; then
38
            CGI_PATH=$KOHA_HOME/intranet/cgi-bin
39
        else
40
            CGI_PATH=$KOHA_HOME
41
        fi
42
43
        echo "Upgrading database schema for $name"
43
        echo "Upgrading database schema for $name"
44
        if KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \
44
        if KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \
45
        PERL5LIB=$PERL5LIB \
45
        PERL5LIB=$PERL5LIB \
(-)a/debian/scripts/koha-worker (-12 / +4 lines)
Lines 211-234 while [ $# -gt 0 ]; do Link Here
211
211
212
done
212
done
213
213
214
# Optionally use alternative paths for a dev install
215
adjust_paths_git_install $1
216
217
if [ "$GIT_INSTALL" = "" ]; then
218
    worker_DAEMON="${KOHA_HOME}/bin/workers/background_jobs_worker.pl"
219
else
220
    worker_DAEMON="${KOHA_HOME}/misc/workers/background_jobs_worker.pl"
221
fi
222
223
# PERL5LIB has been read from etc/default
224
export PERL5LIB
225
226
if [ $# -gt 0 ]; then
214
if [ $# -gt 0 ]; then
227
    # We have at least one instance name
215
    # We have at least one instance name
228
    for name in "$@"; do
216
    for name in "$@"; do
229
217
230
        if is_instance $name; then
218
        if is_instance $name; then
231
219
220
            adjust_paths_git_install $name
221
            worker_DAEMON="${KOHA_HOME}/${KOHA_BINDIR}/workers/background_jobs_worker.pl"
222
            export PERL5LIB
223
232
            case $op in
224
            case $op in
233
                "start")
225
                "start")
234
                    start_worker $name $queue
226
                    start_worker $name $queue
(-)a/debian/scripts/koha-z3950-responder (-10 / +2 lines)
Lines 85-97 start_z3950() Link Here
85
    daemonize="-D -d ${instancename}-koha-z3950"
85
    daemonize="-D -d ${instancename}-koha-z3950"
86
    logging="-l /var/log/koha/${instancename}/z3950.log"
86
    logging="-l /var/log/koha/${instancename}/z3950.log"
87
87
88
    if [ "$GIT_INSTALL" = "1" ]; then
88
    Z3950RESPONDER="/usr/bin/perl $KOHA_HOME/$KOHA_BINDIR/z3950_responder.pl"
89
        MISCDIR=$KOHA_HOME/misc
90
    else
91
        MISCDIR=/usr/share/koha/bin
92
    fi
93
94
    Z3950RESPONDER="/usr/bin/perl $MISCDIR/z3950_responder.pl"
95
    if [ "$debug_mode" = "yes" ]; then
89
    if [ "$debug_mode" = "yes" ]; then
96
        if [ "$GIT_INSTALL" = "1" ]; then
90
        if [ "$GIT_INSTALL" = "1" ]; then
97
            warn "Not a dev install, disabling debug mode"
91
            warn "Not a dev install, disabling debug mode"
Lines 99-105 start_z3950() Link Here
99
            environment="development"
93
            environment="development"
100
            daemonize=""
94
            daemonize=""
101
            logging="" # remote debugger takes care
95
            logging="" # remote debugger takes care
102
            Z3950RESPONDER="/usr/bin/perl -d ${MISCDIR}/z3950_responder.pl"
96
            Z3950RESPONDER="/usr/bin/perl -d $KOHA_HOME/$KOHA_BINDIR/z3950_responder.pl"
103
        fi
97
        fi
104
    fi
98
    fi
105
99
Lines 317-323 if [ $# -gt 0 ]; then Link Here
317
                export DBGP_IDEKEY=${debugger_key}
311
                export DBGP_IDEKEY=${debugger_key}
318
                export PERL5OPT="-d"
312
                export PERL5OPT="-d"
319
            fi
313
            fi
320
321
            export PERL5LIB
314
            export PERL5LIB
322
315
323
            case $op in
316
            case $op in
324
- 

Return to bug 39740