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
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
Lisa Casino
slapos.package
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
Show 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 @@
#
# 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
#
# $ 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
}
ifname
=
re6stnet-lo
# Default node configure filename
cfilename
=
${
1
-/etc/opt/slapos/slapos.cfg
}
# Run re6stnet
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
"Error: no found configure file
$cfilename
, the computer "
echo
"need register as a SlapOS Node first."
exit
1
fi
# echo "Waiting re6stent network work ..."
# while true ; do
# ping6 slap.vifib.com > /dev/null && break
# done
# echo "re6stnet network OK."
interface
=
$(
grep
"^interface_name
\\
s*="
$cfilename
|
\
sed
-e
"s/^interface_name
\\
s*=
\\
s*//g"
)
if
((
$?
==
0
))
;
then
ifname
=
$(
guid2name
$interface
)
# Run slapformat
echo
"Initializing SlapOS Node ..."
/bin/bash
--login
-i
/opt/slapos/bin/slapos node format
-c
--now
if
((
$?
))
;
then
echo
"Initialize SlapOS Node failed."
else
echo
"Error: no interface found in the configure file
$cfilename
"
exit
1
fi
if
[[
"
$ifname
"
==
""
]]
;
then
echo
"Error: no ipv6 interface found in the configure file
$cfilename
"
exit
1
echo
"Initialize SlapOS Node OK."
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
/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
# Add run item when windows startup
#
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."
# if [[ ! -f ${init_script}.bat ]] ; then
# cat <<EOF > ${init_script}.bat
# "$(cygpath -w /usr/bin/bash)" --login -i ${init_script}.sh
# EXIT 0
# EOF
# fi
[[
-f
${
init_script
}
.bat
]]
&&
cat
<<
EOF
>
${
init_script
}
.bat
@ECHO OFF
SETLOCAL
${
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
"
\
"
\"
$(
cygpath
-w
/usr/bin/bash
)
\"
--login -i
${
init_script
}
.sh
"
||
\
"
\"
$(
cygpath
-w
${
init_script
}
.bat
)
\"
"
||
\
show_error_exit
"Add startup item failed."
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