adding default web page to show some information, adding option to disable copy binary, change image docker
This commit is contained in:
parent
f1cf31924e
commit
c552aa5fd7
15 changed files with 302 additions and 61 deletions
|
@ -48,6 +48,8 @@ Linux server build:
|
|||
- cp $WORKDIR/server/debian/common/servercontainer_function.sh /opt/
|
||||
- cp $WORKDIR/server/debian/common/* /opt/ext
|
||||
- cp $WORKDIR/server/debian/common/khaganat.cfg /opt/ext
|
||||
- mkdir -p /opt/rootweb
|
||||
- cp $WORKDIR/server/common/rootweb/* /opt/rootweb/
|
||||
- echo -e 'export KHANAT_CLIENT_VERSION="1"\nexport UIDGAMESERVER=1000\nexport GIDGAMESERVER=1000\nexport DIRCLIENT="/opt/opennel_data"\nexport PACKAGECLIENT="smokey_linux64"' > /opt/khanat_config.sh
|
||||
- /opt/servercontainer_init_create_account.sh
|
||||
- mkdir -p /var/run/mysqld
|
||||
|
|
|
@ -18,8 +18,10 @@
|
|||
#
|
||||
|
||||
declare DIRBUILD="/opt/build/"
|
||||
declare DIRCODEUSE="/opt/build/opennel-code"
|
||||
declare DIRCODE="/opt/ref/opennel-code"
|
||||
declare CXXFLAGS=""
|
||||
declare -i DONTCOPYSOURCE=0
|
||||
|
||||
function usage()
|
||||
{
|
||||
|
@ -35,15 +37,17 @@ options:
|
|||
--add-opts-cmake="string" : add option use on command cmake (generate Makefile)
|
||||
--add-opts-make="string" : add option use on command make
|
||||
--cxxflags=[String] : adding cxx flags when generate Makefile (and build)
|
||||
--dont-copy-source : disable copy source, work directly on source (apply patch)
|
||||
EOF
|
||||
}
|
||||
|
||||
function chrashed()
|
||||
{
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") ERROR - BUILD FAILED (code:$?)"
|
||||
local code=$?
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") ERROR - BUILD (under docker) FAILED (code:$code)"
|
||||
if [ -n "$LOGFILE" ]
|
||||
then
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") ERROR - BUILD FAILED (code:$?)" >> $LOGFILE
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") ERROR - BUILD (under docker) FAILED (code:$code)" >> $LOGFILE
|
||||
fi
|
||||
exit 2
|
||||
}
|
||||
|
@ -78,6 +82,17 @@ function msg_debug()
|
|||
fi
|
||||
}
|
||||
|
||||
function patch_onlyifnotapply()
|
||||
{
|
||||
# Check path is apply or not (if not apply patch)
|
||||
msg_debug "check patch $1"
|
||||
if ! patch -Z -t -R -s -f --dry-run -p 1 -i $1 1>/dev/null
|
||||
then
|
||||
msg_debug "patch $1"
|
||||
patch -f -Z -t -p 1 -i $1 || exit 2
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# MAIN
|
||||
#
|
||||
|
@ -115,6 +130,11 @@ do
|
|||
CXXFLAGS="$CXXFLAGS ${1#*=}"
|
||||
shift
|
||||
;;
|
||||
--dont-copy-source)
|
||||
DONTCOPYSOURCE=1
|
||||
DIRCODEUSE="$DIRCODE"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
msg_error "options '$1' not recognize"
|
||||
usage
|
||||
|
@ -131,19 +151,24 @@ msg_debug "CMAKEOPTS:$CMAKEOPTS"
|
|||
msg_debug "MAKEOPTS:$MAKEOPTS"
|
||||
msg_debug "LOGFILE:$LOGFILE"
|
||||
msg_debug "CXXFLAGS:$CXXFLAGS"
|
||||
msg_debug "DONTCOPYSOURCE:$DONTCOPYSOURCE"
|
||||
|
||||
msg_info "CREATE BUILD DIRECTORY"
|
||||
mkdir -p ${DIRBUILD}/ || exit 2
|
||||
|
||||
msg_info "COPY CODE"
|
||||
mkdir -p ${DIRBUILD}/opennel-code
|
||||
cp -pr $DIRCODE/* ${DIRBUILD}/opennel-code
|
||||
if [[ $DONTCOPYSOURCE -eq 0 ]]
|
||||
then
|
||||
msg_info "COPY CODE"
|
||||
mkdir -p ${DIRBUILD}/opennel-code
|
||||
cp -pr $DIRCODE/* ${DIRBUILD}/opennel-code
|
||||
fi
|
||||
|
||||
msg_info "PATCH CODE"
|
||||
cd ${DIRBUILD}/opennel-code/code
|
||||
patch -Z -t -i ${DIRBUILD}/opennel-code/patch/libcrypto.patch || exit 2
|
||||
patch -Z -t -i ${DIRBUILD}/opennel-code/patch/libicuuc.patch || exit 2
|
||||
patch -Z -t -i ${DIRBUILD}/opennel-code/patch/01_ryzom_debug_callNativeCallBack.patch -p 1 || exit 2
|
||||
for patchfile in $(cat ${DIRCODEUSE}/patch/series)
|
||||
do
|
||||
cd ${DIRCODEUSE}
|
||||
patch_onlyifnotapply ${DIRCODEUSE}/patch/$patchfile
|
||||
done
|
||||
|
||||
msg_info "PREPARE BUILD"
|
||||
msg_debug "cmake option : -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_SYMBOLS=ON -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=ON -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON ${CMAKEOPTS}"
|
||||
|
@ -156,14 +181,11 @@ cd ${DIRBUILD}; CXXFLAGS="$CXXFLAGS" cmake -DWITH_NEL=ON \
|
|||
-DWITH_RYZOM_PATCH=ON \
|
||||
-DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON \
|
||||
${CMAKEOPTS} \
|
||||
${DIRBUILD}/opennel-code/code 1>>$LOGFILE 2>&1 || exit 2
|
||||
${DIRCODEUSE}/code 1>>$LOGFILE 2>&1 || exit 2
|
||||
|
||||
msg_info "BUILD START"
|
||||
msg_debug "make option : $MAKEOPTS"
|
||||
cd ${DIRBUILD}; VERBOSE=1 make $MAKEOPTS 1>>$LOGFILE 2>&1 || exit 2
|
||||
|
||||
msg_info "GENERATE PACKAGE"
|
||||
cd ${DIRBUILD}; make package 1>>$LOGFILE 2>&1 || exit 2
|
||||
|
||||
trap '' EXIT
|
||||
msg_info "BUILD END"
|
||||
|
|
|
@ -31,8 +31,9 @@ declare -i CLEANIMAGENONE=0
|
|||
declare -i AUTODETEC=1
|
||||
declare DOCKERBUILDOPT=""
|
||||
declare OPTION=""
|
||||
declare -i DONTCOPYSOURCE=0
|
||||
|
||||
declare IMAGEDOCKER="builder_khanat_debian_stretch_x86_64"
|
||||
declare IMAGEDOCKER="opennel/builder_debian_stretch_x86_64"
|
||||
declare LOCALBUILDDIR="build/$IMAGEDOCKER"
|
||||
declare LOCALSRC="debian/stretch/x86_64"
|
||||
declare DIRPACKAGE="output/opennel_debian_stretch_x86_64/package"
|
||||
|
@ -66,11 +67,13 @@ options:
|
|||
-m OPTS, --add-opts-docker=OPTS : Adding options on docker command (when build)
|
||||
--only-build-server : adding option to build only server
|
||||
--opennel-code-dir=<Directory> : localization code khanat (khanat-opennel-code)
|
||||
--dont-copy-source : disable copy source, work directly on source (apply patch)
|
||||
|
||||
Example :
|
||||
cd [root Khanat directory]
|
||||
./build.sh -c -r -m '-m 20g'
|
||||
./build.sh -c -r -j 4 -a '-DWITH_SYMBOLS=ON' -a '-DWITH_RYZOM_TOOLS=OFF' -a '-DWITH_NEL_TOOLS=OFF' -m '-m 20g' -d
|
||||
$0 -c -r -m '-m 20g'
|
||||
$0 -c -r -j 4 -a '-DWITH_SYMBOLS=ON' -a '-DWITH_RYZOM_TOOLS=OFF' -a '-DWITH_NEL_TOOLS=OFF' -m '-m 20g' -d
|
||||
$0 -a '-DCMAKE_BUILD_TYPE=Debug -DWITH_SYMBOLS=ON -DFINAL_VERSION=OFF' -f
|
||||
|
||||
EOF
|
||||
}
|
||||
|
@ -190,6 +193,11 @@ do
|
|||
CLEANIMAGENONE=1
|
||||
shift
|
||||
;;
|
||||
--dont-copy-source)
|
||||
DONTCOPYSOURCE=1
|
||||
OPTION="$OPTION --dont-copy-source"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
msg_error "options '$1' not recognize"
|
||||
usage
|
||||
|
@ -288,7 +296,7 @@ then
|
|||
--hostname=builder \
|
||||
-u "$(id -u $USERNAME):$(id -g $USERNAME)" \
|
||||
-v $rootdir/builder:/opt/ref/builder:ro \
|
||||
-v $codedir:/opt/ref/opennel-code:ro \
|
||||
-v $codedir:/opt/ref/opennel-code:rw \
|
||||
-v $rootdir/build:/opt/build \
|
||||
-v /etc/localtime:/etc/localtime:ro \
|
||||
${DOCKEROPTS} \
|
||||
|
@ -296,19 +304,6 @@ then
|
|||
/opt/ref/builder/${LOCALSRC}/build-under-docker.sh --add-opts-make="$MAKEOPTS" --add-opts-cmake="$CMAKEOPTS" --build-dir="/opt/${LOCALBUILDDIR}" --code-dir="/opt/ref/opennel-code" $OPTION || exit 2
|
||||
fi
|
||||
|
||||
if [[ $BUILD -ne 0 ]]
|
||||
then
|
||||
msg_info "COPY PACKAGES"
|
||||
mkdir -p "$rootdir/$DIRPACKAGE"
|
||||
cd ${rootdir}; tar czf ${PACKAGEREF} \
|
||||
$codedir/code/ryzom/server/shard.screen.rc \
|
||||
$codedir/code/ryzom/common/* \
|
||||
$codedir/code/ryzom/client/* \
|
||||
$codedir/code/ryzom/server/* \
|
||||
$codedir/code/web/* || exit 2
|
||||
cp ${rootdir}/${LOCALBUILDDIR}/ryzomcore-*.tar.gz ${PACKAGEBIN} || exit 2
|
||||
fi
|
||||
|
||||
if [[ $CLEANDOCKER -ne 0 ]]
|
||||
then
|
||||
msg_info "CLEAN CONTAINER"
|
||||
|
|
133
server/common/rootweb/index.php
Normal file
133
server/common/rootweb/index.php
Normal file
|
@ -0,0 +1,133 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>DOCKER KHANAT</title>
|
||||
</head>
|
||||
|
||||
<style>
|
||||
#command_shell{
|
||||
background: #F3E2A9;
|
||||
border:3px solid #151515;
|
||||
color: #000000;
|
||||
margin:10px;
|
||||
padding:3px;
|
||||
top:40px;left:3%;right:3%;
|
||||
text-align:left;
|
||||
max-width:100vw;
|
||||
}
|
||||
#title_info{
|
||||
background: #00FFFF;
|
||||
border:3px solid #8A0808;
|
||||
color: #000000;
|
||||
font-size:20px;
|
||||
font-weight:500;
|
||||
margin:50px;
|
||||
padding:3px;
|
||||
top:40px;left:3%;right:3%;
|
||||
text-align:center;
|
||||
}
|
||||
#important_info{
|
||||
background: #A9E2F3;
|
||||
border:3px solid #088A08;
|
||||
color: #000000;
|
||||
font-size:15px;
|
||||
font-weight:500;
|
||||
margin:30px;
|
||||
padding:3px;
|
||||
top:40px;left:3%;right:3%;
|
||||
text-align:left;
|
||||
}
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
#alert_javascript{
|
||||
background: #F3F781;
|
||||
border:3px solid #610B0B;
|
||||
color: #DF0101;
|
||||
font-size:20px;
|
||||
font-weight:700;
|
||||
margin:0;
|
||||
padding:3px;
|
||||
top:40px;left:3%;right:3%;
|
||||
text-align:center;
|
||||
max-width:100vw;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function setHref() {
|
||||
document.getElementById('admin-href').href = window.location.protocol + "//" + window.location.hostname + ":40916/ams/";
|
||||
}
|
||||
</script>
|
||||
<noscript>
|
||||
<div id='alert_javascript'>
|
||||
This website need Javascript.<br>
|
||||
Could you please enable Javascript?
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<body onload="setHref()">
|
||||
<p>
|
||||
<div id='title_info'>KHANAT DOCKER ENVIRONMENT (TEST)</div>
|
||||
<div id='important_info'>
|
||||
<?php
|
||||
print "SERVER IP: ". getHostByName(gethostname());
|
||||
?>
|
||||
</div>
|
||||
<a href="/EnableJavascript" id="admin-href" >Administration</a>
|
||||
<br/>
|
||||
<a href="/phpmyadmin/">phpmyadmin</a>
|
||||
<br/>
|
||||
<a href="/patch/">patch</a>
|
||||
<br/>
|
||||
<br/>
|
||||
</div>
|
||||
<div>
|
||||
script to download and convert launcher on our instance:
|
||||
<a href="/prepare_environment_container_64.sh">prepare_environment_container_64.sh</a>
|
||||
</div>
|
||||
<div>
|
||||
Account / Password
|
||||
<table>
|
||||
<tr>
|
||||
<th>Account</th>
|
||||
<th>Password</th>
|
||||
<th>Where</th>
|
||||
<th>Comment</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>gameserver</td>
|
||||
<td>khanat</td>
|
||||
<td>ssh</td>
|
||||
<td>server access</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>root</td>
|
||||
<td></td>
|
||||
<td>phpmyadmin</td>
|
||||
<td>(no password)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>admin</td>
|
||||
<td>admin</td>
|
||||
<td>khanat</td>
|
||||
<td>account (administration)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>tester</td>
|
||||
<td>tester</td>
|
||||
<td>khanat</td>
|
||||
<td>account (player)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
Command to connect on khanat 'server' :
|
||||
<div id='command_shell'>ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no gameserver@<?php print getHostByName(gethostname());?></div>
|
||||
Use sudo to switch on root account
|
||||
<div id='command_shell'>sudo bash</div>
|
||||
</div>
|
||||
<p>PHP : <?php echo 'PHP version : ' . phpversion(); ?></p>
|
||||
</body>
|
||||
</html>
|
33
server/common/rootweb/prepare_environment_container_64.sh
Normal file
33
server/common/rootweb/prepare_environment_container_64.sh
Normal file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
|
||||
declare IMAGEKHANATSERVER="opennel/servercontainer_debian_stretch_x86_64"
|
||||
|
||||
mkdir -p $HOME/Public
|
||||
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") Get ip address server khanat"
|
||||
listcontainer="$(docker ps -qf 'status=running' -f 'ancestor='"${IMAGEKHANATSERVER}"'')"
|
||||
if [[ ${#listcontainer[@]} -eq 1 ]]
|
||||
then
|
||||
ipaddress=$(docker inspect --format="{{ .NetworkSettings.IPAddress }}" ${listcontainer[@]})
|
||||
fi
|
||||
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") get client package"
|
||||
wget http://$ipaddress/client/smokey_linux64.tar.gz -O smokey_linux64.tar.gz
|
||||
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") clean old client"
|
||||
if [[ -d Khanat_Linux64 ]]
|
||||
then
|
||||
rm -rf Khanat_Linux64 || exit 2
|
||||
fi
|
||||
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") install new client"
|
||||
#7z x -y $SRCKHANATCLIENT || exit 2
|
||||
#7z x -y -oKhanat_Linux64 $SRCKHANATCLIENTDEBUG || exit 2
|
||||
tar xvzf smokey_linux64.tar.gz || exit 2
|
||||
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") configure client"
|
||||
sed -i 's/lirria.khaganat.net/'$ipaddress'/g' Khanat_Linux64/client_default.cfg
|
||||
echo -en "Client khanat installed & configured\nGo to Khanat_Linux64 directory and launch client\n"
|
||||
echo -en "(cd Khanat_Linux64;./khanat_client)\n"
|
||||
|
||||
|
|
@ -97,7 +97,6 @@ chown_gameserver '/home/gameserver/log/apache2/error.log' || exit 2
|
|||
touch /home/gameserver/log/apache2/other_vhosts_access.log || exit 2
|
||||
chown_gameserver '/home/gameserver/log/apache2/other_vhosts_access.log' || exit 2
|
||||
|
||||
|
||||
#####################
|
||||
# Start & Stop apache2
|
||||
#####################
|
||||
|
|
|
@ -237,6 +237,11 @@ wait_all_job || exit 2
|
|||
####################################
|
||||
msg_info "[$(basename $0):$LINENO] Prepare Patch"
|
||||
|
||||
# TODO - if ryzom.xml exist what's command to update (replace patch_gen createNewProduct)
|
||||
if [ -f $PATCH_CLIENT_SYSTEM/patch_game/ryzom.xml ]
|
||||
then
|
||||
mv $PATCH_CLIENT_SYSTEM/patch_game/ryzom.xml $PATCH_CLIENT_SYSTEM/patch_game/ryzom.xml.old || exit 2
|
||||
fi
|
||||
cd $PATCH_CLIENT_SYSTEM;patch_gen createNewProduct patch_game/ryzom.xml 2>$KHANAT_HOME/log/configure/patch_createNewProduct.err 1>$KHANAT_HOME/log/configure/patch_createNewProduct.out || exit 2
|
||||
cd $PATCH_CLIENT_SYSTEM;touch patch_game/Lirria.version || exit 2
|
||||
sed -i -r 's/value="main"/value="khanat_lirria"/g' $PATCH_CLIENT_SYSTEM/patch_game/ryzom.xml || exit 2
|
||||
|
|
|
@ -86,6 +86,13 @@ cp /etc/phpmyadmin/config.inc.php /etc/phpmyadmin/config.inc.php.ref || exit 2
|
|||
awk '{if($0 ~ /AllowNoPassword/){$1="";}; print $0;}' /etc/phpmyadmin/config.inc.php.ref > /etc/phpmyadmin/config.inc.php || exit 2
|
||||
|
||||
|
||||
####################################
|
||||
# Configure 1st page
|
||||
####################################
|
||||
msg_debug "Configure 1st page"
|
||||
create_dir_gameserver '/home/gameserver/rootweb'
|
||||
cp /opt/rootweb/* /home/gameserver/rootweb/ || exit 2
|
||||
|
||||
####################################
|
||||
# configure phpmyadmin
|
||||
####################################
|
||||
|
@ -94,7 +101,7 @@ msg_debug "configure apache"
|
|||
cat << EOF > /etc/apache2/sites-available/000-default.conf
|
||||
# Default
|
||||
<VirtualHost *:80>
|
||||
<Directory "/home/gameserver/khanat/khanatweb/">
|
||||
<Directory "/home/gameserver/rootweb/">
|
||||
Options Indexes FollowSymLinks
|
||||
AllowOverride None
|
||||
Require all granted
|
||||
|
@ -103,13 +110,13 @@ cat << EOF > /etc/apache2/sites-available/000-default.conf
|
|||
AddHandler application/x-httpd-php .php
|
||||
AddHandler application/x-httpd-php-source .phps
|
||||
</Directory>
|
||||
ServerName lirria.khaganat.net
|
||||
ServerName lirria.khaganat.net
|
||||
|
||||
ServerAdmin webmaster@localhost
|
||||
DocumentRoot /home/gameserver/khanat/khanatweb/public_php/
|
||||
ServerAdmin webmaster@localhost
|
||||
DocumentRoot /home/gameserver/rootweb/
|
||||
|
||||
ErrorLog \${APACHE_LOG_DIR}/error.log
|
||||
CustomLog \${APACHE_LOG_DIR}/access.log combined
|
||||
ErrorLog \${APACHE_LOG_DIR}/error.log
|
||||
CustomLog \${APACHE_LOG_DIR}/access.log combined
|
||||
</VirtualHost>
|
||||
|
||||
# Khanat Server Web
|
||||
|
@ -119,13 +126,13 @@ cat << EOF > /etc/apache2/sites-available/000-default.conf
|
|||
AllowOverride None
|
||||
Require all granted
|
||||
</Directory>
|
||||
ServerName lirria.khaganat.net
|
||||
ServerName lirria.khaganat.net
|
||||
|
||||
ServerAdmin admin@localhost
|
||||
DocumentRoot /home/gameserver/khanat/khanatweb/public_php
|
||||
ServerAdmin admin@localhost
|
||||
DocumentRoot /home/gameserver/khanat/khanatweb/public_php
|
||||
|
||||
ErrorLog \${APACHE_LOG_DIR}/error.log
|
||||
CustomLog \${APACHE_LOG_DIR}/access.log combined
|
||||
ErrorLog \${APACHE_LOG_DIR}/error.log
|
||||
CustomLog \${APACHE_LOG_DIR}/access.log combined
|
||||
</VirtualHost>
|
||||
|
||||
# Patch Server
|
||||
|
@ -133,11 +140,11 @@ cat << EOF > /etc/apache2/sites-available/000-default.conf
|
|||
ServerName lirria.khaganat.net
|
||||
DocumentRoot /home/gameserver/khanat/patch_service/patch_game/patch/
|
||||
|
||||
<Directory "/home/gameserver/khanat/patch_service/patch_game/patch">
|
||||
<Directory "/home/gameserver/khanat/patch_service/patch_game/patch">
|
||||
Options -Indexes
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
EOF
|
||||
|
||||
|
|
|
@ -124,9 +124,9 @@ alias l='ls \$LS_OPTIONS -lA'
|
|||
# alias mv='mv -i'
|
||||
|
||||
# Autocompletion
|
||||
if [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
#if [ -f /etc/bash_completion ]; then
|
||||
# . /etc/bash_completion
|
||||
#fi
|
||||
|
||||
export KHANAT_HOME=/home/gameserver
|
||||
export KHANAT_PATH=/home/gameserver/khanat
|
||||
|
|
|
@ -75,6 +75,7 @@ msg_debug "group : $(id -g -n gameserver)"
|
|||
|
||||
create_dir_gameserver '/home/gameserver/ext'
|
||||
create_dir_gameserver '/home/gameserver/khanat'
|
||||
create_dir_gameserver '/home/gameserver/khanat/rootweb'
|
||||
|
||||
####################################
|
||||
# End
|
||||
|
|
|
@ -34,7 +34,7 @@ function start_stop()
|
|||
nameservice=$1
|
||||
printf RUNNING > /home/gameserver/khanat/server/${nameservice}/${nameservice}.state
|
||||
chown_gameserver /home/gameserver/khanat/server/${nameservice}/${nameservice}.state
|
||||
nohup $2
|
||||
(cd $3; nohup $2)
|
||||
printf STOPPED > /home/gameserver/khanat/server/${nameservice}/${nameservice}.state
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ function launch_service()
|
|||
create_file_gameserver "/home/gameserver/log/khanat/$nameservice.out"
|
||||
create_file_gameserver "/home/gameserver/log/khanat/$nameservice.err"
|
||||
|
||||
start_stop "$1" "$2" 1>/home/gameserver/log/khanat/$nameservice.out 2>/home/gameserver/log/khanat/$nameservice.err &
|
||||
start_stop "$1" "$2" "/home/gameserver/khanat/server/$1" 1>/home/gameserver/log/khanat/$nameservice.out 2>/home/gameserver/log/khanat/$nameservice.err &
|
||||
echo "$!" > /home/gameserver/khanat/server/$1/$1.pid
|
||||
#nohup $2 1>/dev/null 2>&1 &
|
||||
#echo "$!" > /home/gameserver/khanat/server/$1.pid
|
||||
|
|
|
@ -16,12 +16,49 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
/opt/ext/servercontainer_configure_link.sh || exit 2
|
||||
declare DIRFUNCTION="$(dirname $0)/servercontainer_function.sh"
|
||||
|
||||
usage()
|
||||
{
|
||||
cat << EOF
|
||||
usage:$0 [options]
|
||||
Launch update
|
||||
|
||||
options:
|
||||
-h, --help : Show this help
|
||||
-d, --debug : Show debug message
|
||||
EOF
|
||||
}
|
||||
|
||||
source $DIRFUNCTION
|
||||
msg_info "[$(basename $0):$LINENO] => START"
|
||||
|
||||
while test $# -gt 0
|
||||
do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
-d|--debug)
|
||||
set_debug 1
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
msg_error "[$(basename $0):$LINENO] options '$1' not recognize"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
/opt/ext/servercontainer_configure_link.sh $OPTION || msg_critical "[$(basename $0):$LINENO] Issue when create link"
|
||||
#/opt/ext/servercontainer_configure_mysql.sh || exit 2
|
||||
#/opt/ext/servercontainer_configure_apache.sh || exit 2
|
||||
#/opt/ext/servercontainer_configure_world.sh || exit 2
|
||||
su -c '/opt/ext/servercontainer_configure_khanat.sh' gameserver || exit 2
|
||||
su -c '/opt/ext/servercontainer_configure_patch.sh -d' gameserver || exit 2
|
||||
su -c "/opt/ext/servercontainer_configure_khanat.sh $OPTION" gameserver || msg_critical "[$(basename $0):$LINENO] Issue when configure khanat"
|
||||
su -c "/opt/ext/servercontainer_configure_patch.sh $OPTION" gameserver || msg_critical "[$(basename $0):$LINENO] Issue when configure patch"
|
||||
|
||||
msg_info "[$(basename $0):$LINENO] => END"
|
||||
exit 0
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ ENV HOSTNAME basic_server
|
|||
|
||||
RUN apt-get update ; \
|
||||
apt-get dist-upgrade -y ; \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y curl nano vim less bash-completion cron logrotate bsd-mailx openssh-server sudo net-tools lzma xdelta p7zip p7zip-full mysql-server apache2 php libapache2-mod-php php-mysql apache2-utils php-gd php-imagick rrdtool screen mcrypt php-mcrypt python3 phpmyadmin gdb
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y curl nano vim less bash-completion cron logrotate bsd-mailx openssh-server sudo net-tools lzma xdelta p7zip p7zip-full mysql-server apache2 php libapache2-mod-php php-mysql apache2-utils php-gd php-imagick rrdtool screen mcrypt php-mcrypt python3 phpmyadmin gdb valgrind electric-fence
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ COPY server/debian/common/servercontainer_function.sh /opt/
|
|||
COPY server/debian/common/servercontainer_init_* /opt/
|
||||
|
||||
COPY output/opennel_debian_stretch_x86_64/khanat_config.sh /opt/khanat_config.sh
|
||||
COPY server/common/rootweb/* /opt/rootweb/
|
||||
|
||||
RUN /opt/servercontainer_init_create_account.sh
|
||||
RUN /opt/servercontainer_init_mysql.sh
|
||||
|
|
|
@ -36,10 +36,12 @@ declare -i SHOWIPKHANATSERVER=0
|
|||
declare METHODSTARTSERVER="--start-khanat-with-screen"
|
||||
declare -i CLEANIMAGENONE=0
|
||||
declare DOCKERBUILDOPT=""
|
||||
declare CONFIGUREAUTO=""
|
||||
declare UPDATEAUTO=""
|
||||
|
||||
declare IMAGEGENERICSERVER="opennel/server_generic_debian_stretch_x86_64"
|
||||
declare IMAGEKHANATSERVER="opennel/servercontainer_debian_stretch_x86_64"
|
||||
declare LOCALBUILDDIR="build/builder_khanat_debian_stretch_x86_64"
|
||||
declare LOCALBUILDDIR="build/opennel/builder_debian_stretch_x86_64"
|
||||
declare DIROUTPUT="output/opennel_debian_stretch_x86_64"
|
||||
declare ROOTDATAKHANAT="$DIROUTPUT/gameserver"
|
||||
declare DIRLOG="$ROOTDATAKHANAT/log"
|
||||
|
@ -139,6 +141,8 @@ do
|
|||
;;
|
||||
-d|--debug)
|
||||
DEBUG=1
|
||||
CONFIGUREAUTO="$CONFIGUREAUTO -d"
|
||||
UPDATEAUTO="$UPDATEAUTO -d"
|
||||
shift
|
||||
;;
|
||||
--ssh)
|
||||
|
@ -230,7 +234,7 @@ do
|
|||
UPDATEDATA=1
|
||||
shift
|
||||
;;
|
||||
--option-docker-build)
|
||||
--option-docker-build=*)
|
||||
DOCKERBUILDOPT="$DOCKERBUILDOPT ${1#*=}"
|
||||
shift
|
||||
;;
|
||||
|
@ -483,7 +487,7 @@ then
|
|||
-v ${rootdir}/$DIRDATABASE:/home/gameserver/database:rw \
|
||||
-v ${rootdir}/$DIRKHANAT:/home/gameserver/khanat:rw \
|
||||
-v ${rootdir}/server/debian/common/:/opt/ext:ro \
|
||||
${IMAGEKHANATSERVER} /opt/ext/servercontainer_configure_auto.sh || exit 2
|
||||
${IMAGEKHANATSERVER} /opt/ext/servercontainer_configure_auto.sh $CONFIGUREAUTO || exit 2
|
||||
fi
|
||||
|
||||
if [[ $UPDATEDATA -ne 0 ]]
|
||||
|
@ -500,7 +504,7 @@ then
|
|||
-v ${rootdir}/$DIRDATABASE:/home/gameserver/database:rw \
|
||||
-v ${rootdir}/$DIRKHANAT:/home/gameserver/khanat:rw \
|
||||
-v ${rootdir}/server/debian/common/:/opt/ext:ro \
|
||||
${IMAGEKHANATSERVER} /opt/ext/servercontainer_update_auto.sh"
|
||||
${IMAGEKHANATSERVER} /opt/ext/servercontainer_update_auto.sh $UPDATEAUTO"
|
||||
cd $rootdir; docker run -it --hostname=khanat \
|
||||
-v /etc/localtime:/etc/localtime:ro \
|
||||
-v ${rootdir}/${LOCALBUILDDIR}/bin:/usr/local/bin:ro \
|
||||
|
@ -512,7 +516,7 @@ then
|
|||
-v ${rootdir}/$DIRDATABASE:/home/gameserver/database:rw \
|
||||
-v ${rootdir}/$DIRKHANAT:/home/gameserver/khanat:rw \
|
||||
-v ${rootdir}/server/debian/common/:/opt/ext:ro \
|
||||
${IMAGEKHANATSERVER} /opt/ext/servercontainer_update_auto.sh
|
||||
${IMAGEKHANATSERVER} /opt/ext/servercontainer_update_auto.sh $UPDATEAUTO || exit 2
|
||||
fi
|
||||
|
||||
if [[ $LAUNCHKHANAT -ne 0 ]]
|
||||
|
@ -530,12 +534,14 @@ then
|
|||
-v ${rootdir}/$DIRDATABASE:/home/gameserver/database:rw \
|
||||
-v ${rootdir}/$DIRKHANAT:/home/gameserver/khanat:rw \
|
||||
-v ${rootdir}/server/debian/common/:/opt/ext:ro \
|
||||
-v $rootdir/build:/opt/build:ro \
|
||||
-v ${OPENNEL_CODE_DIR}:/opt/ref/opennel-code:ro \
|
||||
${IMAGEKHANATSERVER} /opt/ext/servercontainer_launch_auto.sh $METHODSTARTSERVER -d
|
||||
msg_info "[$(basename $0):$LINENO] CLEAR TERMINAL"
|
||||
clear
|
||||
tput clear
|
||||
fi
|
||||
|
||||
trap '' EXIT
|
||||
msg_info "[$(basename $0):$LINENO] CLEAR TERMINAL"
|
||||
clear
|
||||
tput clear
|
||||
msg_info "[$(basename $0):$LINENO] END"
|
||||
|
||||
|
|
Loading…
Reference in a new issue