Commit 53f1d59f authored by Jondy Zhao's avatar Jondy Zhao

Fix slapwebrunner couldn't be released in the slapos-configure.

Remove users and groups added by slapos when unininstall slapos node
parent b5b0464f
......@@ -110,6 +110,11 @@ Be sure the configure scrip report successfully, otherwise fix the problem and r
<section><title>User Guide</title>
<para>It just showes this documnet in the web browser.</para>
</section>
<section><title>Background Jobs</title>
<para>After run Configure SlapOS, then a cron job will run in the background which used to release software and create instance periodically.</para>
</section>
</chapter>
<chapter id="ch_generate_window_installer"><title>Generating windows installer from sources</title>
......@@ -213,26 +218,21 @@ After exit cygwin, double click autorebase.bat in the Windows explorer. If the c
<programlisting>
mkdir -p /opt/git
cd /opt/git
(cd slapos.core ; git pull) || git clone -b cygwin http://git.erp5.org/repos/slapos.core.git
(cd slapos.package ; git pull) || git clone -b cygwin http://git.erp5.org/repos/slapos.package.git
cp /opt/git/slapos.package/windows/scripts/* /usr/local/bin
cd /opt
tar czf slapos.tar.gz slapos/
mv slapos.tar.gz slapos/
</programlisting>
Then build babeld and openvpn for cygwin, we need use the sources in the slapos.package.git, they are patched for cygwin:
Then build babeld for cygwin, we need use the sources in the slapos.package.git, they are patched for cygwin:
<programlisting>
cd /opt/git/slapos.package/windows/babeld
make WINVER=XP
cp babeld.exe /usr/local/bin
cd /opt/git/slapos.package/windows/openvpn
libtoolize
aclocal -I m4
autoheader
automake --add-missing
autoreconf
ac_cv_type_socklen_t=yes IFCONFIG="C:/WINDOWS/system32" LDFLAGS="-liphlpapi -lws2_32" CFLAGS="-DWIN32 -DCYGWIN -D__USE_W32_SOCKETS -D__INSIDE_CYGWIN_NET__ -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0503 -g" OPENSSL_CRYPTO_CFLAGS=-I/usr/include OPENSSL_CRYPTO_LIBS="-L/usr/lib -lcrypto" OPENSSL_SSL_CFLAGS=-I/usr/include OPENSSL_SSL_LIBS="-L/usr/lib -lssl" ./configure --disable-lzo --disable-pkcs11 --disable-plugin-auth-pam --disable-plugin-down-root
make
cp src/openvpn/.libs/openvpn.exe /usr/local/bin
cp babeld.exe /usr/bin
</programlisting>
Now downlaod openvpn 2.3 for your window version, and install it.
</para>
<para>
Then generate user-guide.html from using-slapos-in-windows.xml, generally you need not do this, just copy this file (you're looking now) to /opt/git/slapos.package/windows/docs. If you require want to generate the document by your self, make sure docbook-utils package installed in the Cygwin. Refer to <xref linkend="package-docbook-utils"/> to know what about docbook-utils.
<programlisting>
cd /opt/git/slapos.package/windows/docs
......@@ -296,7 +296,6 @@ Assum SourceDir in the section "Setup" is "D:\slapos", the builder will find "D:
<programlisting>
(cd /opt/downloads; cp pyOpenSSL-0.13.tar.gz miniupnpc-1.8.tar.gz /)
mkdir -p /etc/slapos/scripts
cp /opt/git/slapos.core/slapos*.cfg.example /etc/slapos
/usr/local/bin/slapos-configure.sh
/usr/local/bin/slapos-node.sh
</programlisting>
......
......@@ -35,6 +35,29 @@ for x in $(cygrunsrv --list) ; do
cygrunsrv -R $x
done
#
# Remove users installed by slapos node
#
for name in $(net user) ; do
if [[ "x$name" == x\*slapuser* ]] ; then
echo Remove user: $name
net user $name /delete
elif [[ "$name" == "sshd" ]] ; then
echo Remove user: $name
net user $name /delete
fi
done
#
# Remove local group installed by slapos node
#
for name in $(net localgroup) ; do
if [[ "x$name" == x\*grp_slapuser* ]] ; then
echo Remove localgroup: $name
net localgroup $name /delete
fi
done
#
# Remove slapos-configure from windows startup item
#
......
......@@ -56,6 +56,9 @@ if [[ ! ":$PATH" == :/opt/slapos/bin: ]] ; then
fi
# cygrunsrv
# cron-config
# ssh-host-config
# syslog-ng-config
# devcon
# openssl
# export WINDIR
......@@ -93,6 +96,15 @@ else
fi
check_cygwin_service syslog-ng
if ! cygrunsrv --query sshd > /dev/null 2>&1 ; then
echo Run ssh-host-config ...
/usr/bin/ssh-host-config --yes --cygwin ntsec || \
show_error_exit "Failed to run ssh-host-config"
else
echo The sshd service has been installed.
fi
check_cygwin_service sshd
echo
echo Configure cygwin services OK.
echo
......@@ -417,8 +429,8 @@ if ! grep -q -F "$feature_code" $slaprunner_startup_file ; then
/opt/slapos/bin/slapos node format -cv --now || \
show_error_exit "Failed to run slapos format."
echo "Supply $slaprunner_cfg in the computer $computer_guid"
/opt/slapos/bin/slapos supply $slaprunner_cfg $computer_guid
echo "Supply slapwebrunner in the computer $computer_guid"
/opt/slapos/bin/slapos supply slaposwebrunner $computer_guid
echo "Request an instance $slaprunner_title ..."
patch_file=/etc/slapos/patches/slapos-cookbook-inotifyx.patch
......@@ -436,7 +448,7 @@ if ! grep -q -F "$feature_code" $slaprunner_startup_file ; then
/opt/slapos/bin/slapos node instance --verbose
/opt/slapos/bin/slapos node report --verbose
/opt/slapos/bin/slapos request $client_config_file $slaprunner_title \
$slaprunner_cfg --node computer_guid=$computer_guid && break
slaposwebrunner --node computer_guid=$computer_guid && break
sleep 3
done
# Connection parameters of instance are:
......@@ -446,7 +458,7 @@ if ! grep -q -F "$feature_code" $slaprunner_startup_file ; then
# 'ssh_command': 'ssh 2001:67c:1254:45::c5d5 -p 2222',
# 'url': 'http://softinst39090.host.vifib.net/'}
slaprunner_url=$(/opt/slapos/bin/slapos request $client_config_file \
$slaprunner_title $slaprunner_cfg --node computer_guid=$computer_guid | \
$slaprunner_title slaposwebrunner --node computer_guid=$computer_guid | \
grep backend_url | sed -e "s/^.*': '//g" -e "s/',.*$//g")
echo "SlapOS Web Runner URL: $slaprunner_url"
[[ -z $slaprunner_url ]] && \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment