templates/bin/reconfig.template

Wed, 05 Jun 2024 19:50:44 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 05 Jun 2024 19:50:44 +0200
changeset 537
ad44e72fbf50
parent 175
9823770ba4ee
permissions
-rw-r--r--

add extra nullptr check in the event loop to handle the case when the finish ptr is set to NULL after it was already scheduled

33
96dbfe4f91e5 improved configuration loading
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 #!/bin/sh
96dbfe4f91e5 improved configuration loading
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2
175
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
3 #
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
5 #
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
6 # Copyright 2017 Olaf Wintermann. All rights reserved.
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
7 #
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
8 # Redistribution and use in source and binary forms, with or without
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
9 # modification, are permitted provided that the following conditions are met:
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
10 #
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
11 # 1. Redistributions of source code must retain the above copyright
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
12 # notice, this list of conditions and the following disclaimer.
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
13 #
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
14 # 2. Redistributions in binary form must reproduce the above copyright
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
15 # notice, this list of conditions and the following disclaimer in the
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
16 # documentation and/or other materials provided with the distribution.
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
17 #
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
19 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
20 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
21 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
22 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
23 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
24 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
25 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
26 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
27 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
28 # POSSIBILITY OF SUCH DAMAGE.
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
29 #
33
96dbfe4f91e5 improved configuration loading
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30
175
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
31 WS_INSTALL_DIR=%%WS_INSTALL_DIR%%
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
32
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
33 cd $WS_INSTALL_DIR
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
34
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
35 WS_TMP_DIR=`bin/wstool -t config/server.conf`
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
36 if [ $? -ne 0 ]; then
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
37 exit 1
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
38 fi
33
96dbfe4f91e5 improved configuration loading
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39
175
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
40 WS_PID=`cat $WS_TMP_DIR/pid 2> /dev/null`
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
41 if [ $? -ne 0 ]; then
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
42 echo "cannot get server pid"
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
43 exit 1
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
44 fi
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
45 if [ -z $WS_PID ]; then
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
46 echo "cannot get server pid"
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
47 exit 1
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
48 fi
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
49
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
50 kill -0 $WS_PID 2> /dev/null
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
51 if [ $? -ne 0 ]; then
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
52 echo "server not running"
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
53 exit 1
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
54 fi
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
55
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
56 bin/wstool -s $WS_TMP_DIR/private/srvctrl.sock reconfig
9823770ba4ee using wstool in server control scripts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 61
diff changeset
57

mercurial