Skip to content

Commit c2d9674

Browse files
author
Vladimir Kotal
committed
update SMF tools to use standard syncing script + webapp config address
1 parent 0ec9e9c commit c2d9674

File tree

4 files changed

+21
-92
lines changed

4 files changed

+21
-92
lines changed

tools/init.d/opengrok.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/ksh
1+
#!/bin/ksh
22
# CDDL HEADER START
33
#
44
# The contents of this file are subject to the terms of the
@@ -16,10 +16,6 @@
1616
#
1717
# CDDL HEADER END
1818

19-
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
20-
# Use is subject to license terms.
21-
22-
2319
# The root direction of this opengrok installation
2420
ROOT=/opengrok; export ROOT
2521
# How often should the source be updated (in seconds)
@@ -39,8 +35,8 @@ PATH=/usr/bin; export PATH
3935
# The name of the web servers that should be notified with the information
4036
# of the active configuration to use. Specify them with hostname:port and
4137
# separate multiple hosts by space.
42-
# WEBSERVERS="server1:2424 server2:2424"
43-
# WEBSERVERS="localhost:2424"
38+
# WEBSERVERS="http://server1:8080/source http://server2:8080/source"
39+
# WEBSERVERS="http://localhost:8080/source"
4440

4541
# The email address to send an email if the source update fails, or a fatal
4642
# error occurs while the index database is being updated.

tools/smf/indexer.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# CDDL HEADER START
33
#
44
# The contents of this file are subject to the terms of the
5-
# Common Development and Distribution License (the "License").
5+
# Common Development and Distribution License (the "License").
66
# You may not use this file except in compliance with the License.
77
#
88
# See LICENSE.txt included in this distribution for the specific
@@ -34,7 +34,7 @@ send_report()
3434
if [ -n "${ADMINISTRATOR}" ]
3535
then
3636
mailx -s "{OpenGrok update failed" ${ADMINISTRATOR} < ${output}
37-
fi
37+
fi
3838
}
3939

4040
PROGDIR=${ROOT}/bin
@@ -47,7 +47,7 @@ do
4747

4848
# update source code
4949
rm -f ${output}
50-
./smf/update_source.sh > ${output} 2>&1
50+
${PROGDIR}/sync.py -c ${SYNC_CONF} -d ${SRC_ROOT} > ${output} 2>&1
5151
if [ $? -ne 0 ]
5252
then
5353
send_report
@@ -92,7 +92,7 @@ do
9292

9393
done
9494
fi
95-
95+
9696
# update running configuration
9797
if [ "${stage}" = 1 ]
9898
then

tools/smf/opengrok.xml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ CDDL HEADER END
1919
-->
2020
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
2121
<!--
22-
Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
22+
Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
2323
-->
2424

2525
<service_bundle type="manifest" name="OSOLopengrok:opengrok">
@@ -68,14 +68,14 @@ CDDL HEADER END
6868
<propval name="action_authorization" type="astring" value="solaris.smf.manage.opengrok" />
6969
<propval name="value_authorization" type="astring" value="solaris.smf.value.opengrok" />
7070
</property_group>
71-
71+
7272
<property_group name="opengrok" type="application">
7373
<propval name="value_authorization" type="astring"
7474
value="solaris.smf.value.opengrok" />
7575
<propval name="action_authorization" type="astring"
7676
value="solaris.smf.manage.opengrok" />
77-
</property_group>
78-
77+
</property_group>
78+
7979
<instance name="opengrok" enabled="false">
8080
<exec_method
8181
type="method"
@@ -90,9 +90,8 @@ CDDL HEADER END
9090
<!-- The root direction of this opengrok
9191
installation -->
9292
<envvar name="ROOT" value="/opengrok"/>
93-
94-
<!-- How often should the source be updated (in
95-
seconds) -->
93+
94+
<!-- How often should the source be updated (in seconds) -->
9695
<envvar name="SLEEPTIME" value="1800"/>
9796

9897
<!-- The Java version to use -->
@@ -105,12 +104,15 @@ CDDL HEADER END
105104
<envvar name="SUBVERSION" value="/usr/bin/svn"/>
106105
<envvar name="MERCURIAL" value="/usr/bin/hg"/>
107106

108-
<!-- The name of the web servers that should be
107+
<!-- The URI of the web servers that should be
109108
notified with the information of the active
110109
configuration to use. Specify them with
111110
hostname:port and separate multiple hosts by space.
112-
ex: value="server1:2424 server2:2424" -->
113-
<envvar name="WEBSERVERS" value="localhost:2424"/>
111+
ex: value="http://server1:8080/source http://server2:8080" -->
112+
<envvar name="WEBSERVERS" value="http://localhost:8080/source"/>
113+
114+
<!-- path to sync.py configuration file -->
115+
<envvar name="SYNC_CONF" value="/opengrok/etc/sync.conf"/>
114116

115117
<!-- The email address to send an email if the
116118
source update fails, or a fatal error occurs while
@@ -124,7 +126,7 @@ CDDL HEADER END
124126
</method_environment>
125127
</method_context>
126128
</exec_method>
127-
129+
128130
<exec_method
129131
type="method"
130132
name="stop"
@@ -134,7 +136,7 @@ CDDL HEADER END
134136
</instance>
135137

136138
<stability value="Unstable" />
137-
139+
138140
<template>
139141
<common_name>
140142
<loctext xml:lang="C">OpenGrok indexing service</loctext>

tools/smf/update_source.sh

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)