Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package.keep
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Tyagov
slapos.package.keep
Commits
683ae427
Commit
683ae427
authored
May 08, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change slapos node init behaviour
parent
dfd6872f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
58 deletions
+44
-58
windows/scripts/init-slapos-node.sh
windows/scripts/init-slapos-node.sh
+22
-51
windows/scripts/slapos-node-config.sh
windows/scripts/slapos-node-config.sh
+22
-7
No files found.
windows/scripts/init-slapos-node.sh
View file @
683ae427
...
@@ -4,65 +4,36 @@
...
@@ -4,65 +4,36 @@
#
#
# 1. Start re6stnet,
# 1. Start re6stnet,
#
#
# 2.
Check whether IPv6 connection is availabe
# 2.
Run slapformat to synchornize information with master
#
#
# 3.
Run slapformat to synchornize information with master
# 3.
Start slapproxy
#
#
# 4.
Start slapproxy, it will used by slapos desktop and node manager
# 4.
#
#
# Get connection name by GUID name, for example
ifname
=
re6stnet-lo
#
# $ guid2name {C8D7F065-AD35-4777-A768-122451282533}
#
function
guid2name
()
{
if
[[
"
$1
"
==
""
]]
;
then
echo
else
netsh interface ipv6 show interface
level
=
verbose |
\
grep
-B
1
"
$1
"
|
\
grep
"^Connection"
|
\
sed
-e
"s/^Connection Name
\\
s*:
\\
s*//g"
fi
}
# Default node configure filename
# Run re6stnet
cfilename
=
${
1
-/etc/opt/slapos/slapos.cfg
}
echo
"Start re6stnet ..."
(
cd
/etc/re6stnet
;
re6stnet @re6stnet.conf
-I
$ifname
-i
$ifname
&
)
echo
"Start re6stent (pid:
$!
)in the background OK."
if
[[
!
-f
$cfilename
]]
;
then
# echo "Waiting re6stent network work ..."
echo
"Error: no found configure file
$cfilename
, the computer "
# while true ; do
echo
"need register as a SlapOS Node first."
# ping6 slap.vifib.com > /dev/null && break
exit
1
# done
fi
# echo "re6stnet network OK."
interface
=
$(
grep
"^interface_name
\\
s*="
$cfilename
|
\
# Run slapformat
sed
-e
"s/^interface_name
\\
s*=
\\
s*//g"
)
echo
"Initializing SlapOS Node ..."
if
((
$?
==
0
))
;
then
/bin/bash
--login
-i
/opt/slapos/bin/slapos node format
-c
--now
ifname
=
$(
guid2name
$interface
)
if
((
$?
))
;
then
echo
"Initialize SlapOS Node failed."
else
else
echo
"Error: no interface found in the configure file
$cfilename
"
echo
"Initialize SlapOS Node OK."
exit
1
fi
if
[[
"
$ifname
"
==
""
]]
;
then
echo
"Error: no ipv6 interface found in the configure file
$cfilename
"
exit
1
fi
fi
# Run re6stnet, waiting until it works
cd
/etc/re6stnet
re6stnet @re6stnet.conf
-I
$ifname
-i
$ifname
echo
"Waiting re6stent network work ..."
while
true
;
do
ping6 slap.vifib.com
>
/dev/null
&&
break
done
echo
"re6stnet network OK."
# Run slapformat
/opt/slapos/bin/slapos node format
-cv
--now
||
\
(
echo
"Initialize SlapOS Node failed."
;
exit
1
)
echo
"Initialize SlapOS Node OK."
# Run slapproxy
# Run slapproxy
/opt/slapos/bin/slapproxy
||
echo
"Start slapproxy failed."
# /opt/slapos/bin/slapproxy || echo "Start slapproxy failed."
exit
0
windows/scripts/slapos-node-config.sh
View file @
683ae427
...
@@ -259,16 +259,31 @@ grep -q "^table " re6stnet.conf || echo "table 0" >> re6stnet.conf
...
@@ -259,16 +259,31 @@ grep -q "^table " re6stnet.conf || echo "table 0" >> re6stnet.conf
# Add run item when windows startup
# Add run item when windows startup
#
#
init_script
=
/etc/slapos/scripts/init-slapos-node
init_script
=
/etc/slapos/scripts/init-slapos-node
password_file
=
/etc/passwd
password_orig
=
/etc/slapos-format-passwd.orig
cygroot
=
$(
cygpath
-w
-a
/
)
echo
"Add
${
init_script
}
.sh as Windows startup item."
echo
"Add
${
init_script
}
.sh as Windows startup item."
# if [[ ! -f ${init_script}.bat ]] ; then
[[
-f
${
init_script
}
.bat
]]
&&
cat
<<
EOF
>
${
init_script
}
.bat
# cat <<EOF > ${init_script}.bat
@ECHO OFF
# "$(cygpath -w /usr/bin/bash)" --login -i ${init_script}.sh
SETLOCAL
# EXIT 0
# EOF
# fi
${
cygroot
:0:2
}
CD "
$(
cygpath
-w
/usr/bin
)
"
.
\c
p
$password_file
$password_orig
.
\s
ed -i -e "s/^Administrator:unused:500:513/Administrator:unused:0:513/"
$password_file
START /B bash --login -i "
${
init_script
}
.sh"
.
\s
leep 3
.
\c
p
$password_orig
$password_file
ENDLOCAL
EXIT 0
EOF
# regtool -q set "$run_key\\$slapos_run_entry" \
# "\"$(cygpath -w /usr/bin/bash)\" --login -i ${init_script}.sh" || \
# show_error_exit "Add startup item failed."
regtool
-q
set
"
$run_key
\\
$slapos_run_entry
"
\
regtool
-q
set
"
$run_key
\\
$slapos_run_entry
"
\
"
\"
$(
cygpath
-w
/usr/bin/bash
)
\"
--login -i
${
init_script
}
.sh
"
||
\
"
\"
$(
cygpath
-w
${
init_script
}
.bat
)
\"
"
||
\
show_error_exit
"Add startup item failed."
show_error_exit
"Add startup item failed."
echo
SlapOS Node configure successfully.
echo
SlapOS Node configure successfully.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment