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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
slapos.package
Commits
36ac3ca0
Commit
36ac3ca0
authored
Jul 31, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add slapos prefix for slapos windows node
so that it could run multi-instances in one machine
parent
699b5f33
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
154 additions
and
132 deletions
+154
-132
windows/scripts/post-install.sh
windows/scripts/post-install.sh
+35
-33
windows/scripts/pre-uninstall.sh
windows/scripts/pre-uninstall.sh
+55
-42
windows/scripts/slapos-configure.sh
windows/scripts/slapos-configure.sh
+14
-16
windows/scripts/slapos-cron-config
windows/scripts/slapos-cron-config
+28
-27
windows/scripts/slapos-cygwin-bootstrip.sh
windows/scripts/slapos-cygwin-bootstrip.sh
+3
-2
windows/scripts/slapos-include.sh
windows/scripts/slapos-include.sh
+14
-7
windows/scripts/slapos-node.sh
windows/scripts/slapos-node.sh
+5
-5
No files found.
windows/scripts/post-install.sh
View file @
36ac3ca0
...
...
@@ -2,7 +2,7 @@
#
# When cygwin is installed, then call this script by Administrator:
#
# /bin/bash/ --login -i
init-cygwin.sh
# /bin/bash/ --login -i
post-install.sh PREFIX
#
# It will do:
#
...
...
@@ -14,28 +14,33 @@
#
# * Change readme.txt to dos format
#
# * Set prefix for this slapos node
#
function
show_error_exit
()
{
echo
Error:
${
1
-Run post-install script failed.
}
read
-n
1
-p
"Press any key to exit..."
exit
1
}
readonly
-f
show_error_exit
declare
-r
cyghome
=
$(
cygpath
-w
/
)
declare
-r
password_filename
=
/etc/passwd
declare
-r
slapos_prefix
=
$1
echo
Checking /etc/passwd ...
if
[[
!
-f
${
password_filename
}
]]
;
then
mkpasswd
-l
>
${
password_filename
}
||
show_error_exit
"Error: mkpasswd failed"
echo
File /etc/passwd has been generated.
_filename
=
/etc/passwd
echo
"Checking
${
_filename
}
..."
if
[[
!
-f
${
_filename
}
]]
;
then
mkpasswd
-l
>
${
_filename
}
||
show_error_exit
"Error: mkpasswd failed"
echo
"
${
_filename
}
has been generated."
else
echo
OK.
fi
echo
Checking /etc/group ...
if
[[
!
-f
/etc/group
]]
;
then
mkgroup
-l
>
/etc/group
||
show_error_exit
"Error: mkgroup failed"
echo
File /etc/group has been generated.
_filename
=
/etc/group
echo
"Checking
${
_filename
}
..."
if
[[
!
-f
${
_filename
}
]]
;
then
mkgroup
-l
>
${
_filename
}
||
show_error_exit
"Error: mkgroup failed"
echo
"
${
_filename
}
has been generated."
else
echo
OK.
fi
...
...
@@ -51,9 +56,8 @@ fi
# fi
# fi
echo
Checking Windows OEM Codepage ...
_charset
=
$(
ipwin codepage
)
||
_charset
=
""
echo
Windows OEM Codepage is
${
_charset
}
echo
"Windows OEM Codepage is
${
_charset
}
"
_filename
=
".minttyrc"
echo
Checking
${
_filename
}
...
...
...
@@ -66,7 +70,7 @@ Scrollbar=none
Locale=C
Charset=
${
_charset
}
EOF
echo
File
${
_filename
}
has been generated.
echo
"
${
_filename
}
has been generated."
else
echo
OK.
fi
...
...
@@ -83,7 +87,7 @@ chdir ${cyghome}\\bin
start mintty.exe -i /Cygwin-Terminal.ico -
EOF
chmod
+x
${
_filename
}
echo
File
${
_filename
}
has been generated.
echo
"
${
_filename
}
has been generated."
else
echo
OK.
fi
...
...
@@ -108,7 +112,7 @@ path .\bin;%path%
dash /bin/rebaseall -T /myfile.list -v
EOF
chmod
+x
${
_filename
}
echo
File
${
_filename
}
has been generated.
echo
"
${
_filename
}
has been generated."
else
echo
OK.
fi
...
...
@@ -116,60 +120,58 @@ fi
# Change format of readme.txt
_filename
=
$(
cygpath
-u
$(
cygpath
-m
/
)
/../readme.txt
)
if
[[
-f
${
_filename
}
]]
;
then
echo
Changing
$(
cygpath
-w
${
_filename
}
)
as dos format ...
echo
"Changing
$(
cygpath
-w
${
_filename
}
)
as dos format ..."
unix2dos
${
_filename
}
&&
echo
OK.
fi
# Remove cygwin services to be sure these services will be configured
# in this cygwin enviroments when there are many cygwin instances
# installed in this computer.
for
name
in
$(
cygrunsrv
--list
)
;
do
echo
Removing
$name
service
cygrunsrv
-R
$name
||
show_error_exit
echo
OK.
done
# Backup slap-runner.html
_filename
=
/etc/slapos/scripts/slap-runner.html
if
[[
-r
${
_filename
}
]]
;
then
echo
Backuping
${
_filename
}
as
${
_filename
}
.orig
echo
"Backuping
${
_filename
}
as
${
_filename
}
.orig"
cp
${
_filename
}
{
,.orig
}
&&
echo
OK.
else
echo
Warning: Missing
${
_filename
}
echo
"Warning: missing
${
_filename
}
"
fi
# Unzip slapos.tar.gz
_filename
=
/opt/downloads/slapos.tar.gz
if
[[
-r
${
_filename
}
]]
;
then
echo
Extracting
${
_filename
}
...
echo
"Extracting
${
_filename
}
..."
(
cd
/opt
;
tar
xzf
${
_filename
}
--no-same-owner
)
||
show_error_exit
echo
OK.
elif
[[
!
-d
/opt/slapos
]]
;
then
echo
Warning: Missing
${
_filename
}
echo
"Warning: missing
${
_filename
}
"
fi
# Patch cygport, so that we can specify package prefix by ourself.
_filename
=
/usr/bin/cygport
if
[[
-f
${
_filename
}
]]
;
then
echo
Patching
${
_filename
}
...
echo
"Patching
${
_filename
}
..."
sed
-i
-e
's/D="${workdir}\/inst"/D="${CYGCONF_PREFIX-${workdir}\/inst}"/g'
${
_filename
}
&&
echo
OK.
fi
_filename
=
/usr/share/cygport/cygclass/autotools.cygclass
if
[[
-f
${
_filename
}
]]
;
then
echo
Patching
${
_filename
}
...
echo
"Patching
${
_filename
}
..."
sed
-i
-e
's/prefix=$(__host_prefix)/prefix=${CYGCONF_PREFIX-$(__host_prefix)}/g'
${
_filename
}
&&
echo
OK.
fi
_filename
=
/usr/share/cygport/cygclass/cmake.cygclass
if
[[
-f
${
_filename
}
]]
;
then
echo
Patching
${
_filename
}
...
echo
"Patching
${
_filename
}
..."
sed
-i
-e
's/-DCMAKE_INSTALL_PREFIX=$(__host_prefix)/-DCMAKE_INSTALL_PREFIX=${CYGCONF_PREFIX-$(__host_prefix)}/g'
${
_filename
}
&&
echo
OK.
fi
# Set prefix for slapos
if
[[
-n
${
slapos_prefix
}
]]
;
then
echo
"Set slapos prefix as
${
slapos_prefix
}
"
sed
-i
-e
"s%slapos_prefix=.*
\$
%slapos_prefix=
${
slapos_prefix
}
"
\
/etc/slapos/scripts/pre-uninstall.sh /etc/slapos/scripts/slapos-include.sh
fi
echo
echo
Run post-install.sh script successfully.
echo
"Run post-install.sh script successfully."
echo
read
-n
1
-t
60
-p
"Press any key to exit..."
exit
0
windows/scripts/pre-uninstall.sh
View file @
36ac3ca0
...
...
@@ -15,18 +15,46 @@
#
# * Remove instance root /srv/slapgrid
#
# Required:
# grep gawk TASKKILL
#
export
PATH
=
/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:
$PATH
function
slapos_kill_process
()
{
name
=
$1
echo
"Try to kill all
$name
..."
for
pid
in
$(
ps |
grep
"
$name
"
| gawk
'{print $4}'
)
;
do
echo
"Kill pid
$pid
"
TASKKILL /F /T /PID
$pid
done
}
read
-f
slapos_kill_process
#
# Declare variables
#
declare
-r
slapos_prefix
=
declare
-r
slapos_administrator
=
${
slapos_prefix
:slap
}
root
declare
-r
slapos_user_basename
=
${
slapos_prefix
:slap
}
user
declare
-r
slapos_ifname
=
${
slapos_prefix
}
re6stnet-lo
declare
-r
re6stnet_service_name
=
${
slapos_prefix
}
re6stnet
declare
-r
cron_service_name
=
${
slapos_prefix
}
cron
declare
-r
ssh_service_name
=
${
slapos_prefix
}
ssh
declare
-r
syslog_service_name
=
${
slapos_prefix
}
syslog-ng
declare
-r
cygserver_service_name
=
${
slapos_prefix
}
cygserver
#
# Remove services installed by cygwin,
#
echo
Try to stop re6stnet service ...
if
!
net stop re6stnet
;
then
echo
Try to
kill
openvpn process ...
ps
-ef
|
grep
-q
"/usr/bin/openvpn"
&&
TASKKILL /IM openvpn.exe /F
&&
echo
OK.
fi
for
name
in
$(
cygrunsrv
--list
)
;
do
echo
Removing cygservice
$name
echo
"Try to stop service
${
re6stnet_service_name
}
..."
net stop
${
re6stnet_service_name
}
||
slapos_kill_process /usr/bin/openvpn
for
name
in
${
re6stnet_service_name
}
${
cron_service_name
}
\
${
ssh_service_name
}
${
syslog_service_name
}
\
${
cygserver_service_name
}
;
do
echo
"Removing ervice
$name
"
cygrunsrv
-R
$name
&&
echo
OK.
done
...
...
@@ -34,35 +62,27 @@ done
# Stop slapos
#
if
[[
-x
/opt/slapos/bin/slapos
]]
;
then
echo
Stoping slapos node ...
echo
"Stoping slapos node ..."
/opt/slapos/bin/slapos node stop all
&&
echo
OK.
fi
echo
Try to
kill
python2.7 process ...
ps
-ef
|
grep
-q
"/usr/bin/python2.7"
&&
TASKKILL /IM python2.7.exe /F
&&
echo
OK.
slapos_kill_process /usr/bin/python2.7
#
# Remove virtual netcard installed by
re6stnet
# Remove virtual netcard installed by
slapos
#
for
ifname
in
$(
netsh interface ipv6 show interface | gawk
'{ print $5 }'
)
;
do
if
[[
"
$ifname
"
==
"re6stnet-lo"
]]
;
then
echo
Removing network connection:
$ifname
ipwin remove
*
msloop re6stnet-lo
&&
echo
OK.
elif
[[
"
$ifname
"
==
re6stnet
*
]]
;
then
echo
Removing network connection:
$ifname
ipwin remove tap0901
$ifname
&&
echo
OK.
fi
done
echo
"Removing network connection
${
slapos_ifname
}
"
ipwin remove
*
msloop
${
slapos_ifname
}
&&
echo
OK.
#
# Remove users installed by slapos
node
# Remove users installed by slapos
#
for
name
in
$(
net user
)
;
do
if
[[
"
x
$name
"
==
x
\*
slapuser
*
]]
;
then
echo
Removing user:
$name
net user
$name
/delete
&&
echo
OK.
elif
echo
"
$
name
"
|
grep
-q
-E
"(sshd)|(cyg_server)|(slaproot
)"
;
then
echo
Removing user:
$name
net user
$name
/delete
&&
echo
OK.
for
_name
in
$(
NET USER
)
;
do
if
[[
"
${
_name
}
"
==
${
slapos_user_basename
}
*
]]
;
then
echo
"Removing user:
${
_name
}
"
NET USER
${
_name
}
/DELETE
&&
echo
OK.
elif
echo
"
$
{
_name
}
"
|
grep
-q
-E
"(sshd)|(cyg_server)|(
${
slapos_administrator
}
)"
;
then
echo
"Removing user:
${
_name
}
"
NET USER
${
_name
}
/DELETE
&&
echo
OK.
fi
done
echo
"Creating /etc/passwd ..."
...
...
@@ -71,10 +91,10 @@ mkpasswd -l > /etc/passwd && echo OK.
#
# Remove local group installed by slapos node
#
for
name
in
$(
net localgroup
|
sed
-n
-e
"s/^*//p"
|
sed
-e
"s/
\\
s//g"
)
;
do
if
[[
"
$
name
"
==
grp_slapuser
*
]]
;
then
echo
Removing localgroup:
$name
net localgroup
$name
/delete
&&
echo
OK.
for
_name
in
$(
NET LOCALGROUP
|
sed
-n
-e
"s/^*//p"
|
sed
-e
"s/
\\
s//g"
)
;
do
if
[[
"
$
{
_name
}
"
==
grp_
${
slapos_user_basename
}
*
]]
;
then
echo
"Removing localgroup:
${
_name
}
"
NET LOCALGROUP
${
_name
}
/DELETE
&&
echo
OK.
fi
done
echo
"Creating /etc/group ..."
...
...
@@ -91,16 +111,9 @@ rm -rf ~/.slapos && echo OK.
#
# Remove crontab
#
echo
Removing /var/cron/tabs/slaproot
rm
-rf
/var/cron/tabs/slaproot
&&
echo
OK.
#
# Remove slapos-configure from windows startup item
#
slapos_run_key
=
'\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
slapos_run_entry
=
slapos-configure
echo
Removing startup item
"
$slapos_run_key
\\
$slapos_run_entry
"
regtool
-q
unset
"
$slapos_run_key
\\
$slapos_run_entry
"
&&
echo
OK.
_filename
=
/var/cron/tabs/
${
slapos_administrator
}
echo
"Removing
${
_filename
}
"
rm
-rf
${
_filename
}
&&
echo
OK.
#
# Remove default instance root, because it belong to slapuser, and
...
...
windows/scripts/slapos-configure.sh
View file @
36ac3ca0
...
...
@@ -31,7 +31,6 @@ function show_usage()
echo
""
echo
" Availabe options:"
echo
""
echo
" -U, --user=XXX slapos administrator, default is slaproot"
echo
" -P, --password=XXX password of administrator"
echo
""
echo
" --computer-certificate=FILENAME"
...
...
@@ -65,7 +64,7 @@ echo ""
# -----------------------------------------------------------
# Local variable
# -----------------------------------------------------------
declare
_administrator
=
${
slapos_
use
r
}
declare
_administrator
=
${
slapos_
administrato
r
}
declare
_password
=
declare
_computer_certificate
=
declare
_computer_key
=
...
...
@@ -90,9 +89,6 @@ while test $# -gt 0; do
_password
=
$2
shift
;;
--user
=
*
)
_administrator
=
$optarg
;;
-P
)
_administrator
=
$2
shift
...
...
@@ -168,25 +164,25 @@ csih_error "failed to create account ${_administrator}."
# Configure cygwin services: cygserver syslog-ng sshd
# -----------------------------------------------------------
csih_inform
"Starting configure cygwin services ..."
if
!
cygrunsrv
--query
cygserver
>
/dev/null 2>&1
;
then
if
!
cygrunsrv
--query
${
cygserver_service_name
}
>
/dev/null 2>&1
;
then
csih_inform
"run cygserver-config ..."
/usr/bin/cygserver-config
--yes
||
\
csih_error
"failed to run cygserver-config"
else
csih_inform
"the cygserver service has been installed"
fi
check_cygwin_service
cygserver
check_cygwin_service
${
cygserver_service_name
}
if
!
cygrunsrv
--query
syslog-ng
>
/dev/null 2>&1
;
then
if
!
cygrunsrv
--query
${
syslog_service_name
}
>
/dev/null 2>&1
;
then
csih_inform
"run syslog-ng-config ..."
/usr/bin/syslog-ng-config
--yes
||
\
csih_error
"failed to run syslog-ng-config"
else
csih_inform
"the syslog-ng service has been installed"
fi
check_cygwin_service
syslog-ng
check_cygwin_service
${
syslog_service_name
}
if
!
cygrunsrv
--query
sshd
>
/dev/null 2>&1
;
then
if
!
cygrunsrv
--query
${
sshd_service_name
}
>
/dev/null 2>&1
;
then
if
csih_is_xp
&&
[[
-z
"
${
csih_PRIVILEGED_PASSWORD
}
"
]]
;
then
slapos_request_password
${
_administrator
}
"Install sshd service need the password of
${
_administrator
}
."
fi
...
...
@@ -197,10 +193,10 @@ if ! cygrunsrv --query sshd > /dev/null 2>&1 ; then
else
csih_inform
"the sshd service has been installed"
fi
check_cygwin_service
sshd
check_cygwin_service
${
sshd_service_name
}
# Use slapos-cron-config to configure slapos cron service.
if
!
cygrunsrv
--query
cron
>
/dev/null 2>&1
;
then
if
!
cygrunsrv
--query
${
cron_service_name
}
>
/dev/null 2>&1
;
then
[[
-x
${
slapos_cron_config
}
]]
||
csih_error
"Couldn't find slapos cron config script:
${
slapos_cron_config
}
"
...
...
@@ -214,7 +210,7 @@ if ! cygrunsrv --query cron > /dev/null 2>&1 ; then
else
csih_inform
"the cron service has been installed"
fi
check_cygwin_service
cron
check_cygwin_service
${
cron_service_name
}
csih_inform
"Configure cygwin services OK"
echo
""
...
...
@@ -314,9 +310,10 @@ csih_error "Invalid computer id '$computer_guid' specified."
csih_inform
"Computer configuration information:"
csih_inform
" interface name:
${
slapos_ifname
}
"
csih_inform
" GUID:
$interface_guid
"
csih_inform
" ipv4_local_network:
$ipv4_local_network
"
csih_inform
" computer_id:
$computer_guid
"
csih_inform
" GUID:
${
interface_guid
}
"
csih_inform
" ipv4_local_network:
${
ipv4_local_network
}
"
csih_inform
" computer_id:
${
computer_guid
}
"
csih_inform
" user_base_name:
${
slapos_user_basename
}
"
csih_inform
csih_inform
" If ipv4_local_network confilcts with your local network, change it"
csih_inform
" in the file:
${
node_configure_file
}
"
...
...
@@ -327,6 +324,7 @@ sed -i -e "s%^\\s*interface_name.*$%interface_name = $interface_guid%" \
-e
"s%^#
\?\\
s*ipv6_interface.*
$%
# ipv6_interface =%g"
\
-e
"s%^ipv4_local_network.*
$%
ipv4_local_network =
$ipv4_local_network
%"
\
-e
"s%^computer_id.*
$%
computer_id =
$computer_guid
%"
\
-e
"s%^user_base_name =.*
$%
user_base_name =
${
slapos_user_basename
}
%"
\
${
node_configure_file
}
if
[[
!
-f
${
client_certificate_file
}
]]
;
then
...
...
windows/scripts/slapos-cron-config
View file @
36ac3ca0
...
...
@@ -240,7 +240,7 @@ check_passwd_and_group() {
# ======================================================================
# Routine: check_user
# Check to see that the specified user exists once in /etc/passwd
# Check to see that the specified user exists once in /etc/passwd
# ======================================================================
check_user
()
{
count
=
$(
grep
-ic
"^
$1
:"
/etc/passwd
)
...
...
@@ -269,7 +269,7 @@ check_dir_perms() {
echo
"Your computer is missing
$1
"
.
echo
return
1
fi
fi
if
ls
-ld
"
$1
"
|
grep
-q
^
"
$2
"
;
then
true
...
...
@@ -396,8 +396,8 @@ check_cron_table() {
echo
[
"
$couldbeFAT
"
=
1
]
&&
echo
"This rule does not apply on FAT/FAT32 file systems."
echo
"This rule does not apply if the daemon runs with nontsec."
echo
echo
"This rule does not apply if the daemon runs with nontsec."
echo
echo
"You can change the group membership setting with:"
echo
" chgrp
$ADMINSGID
$cron_table
"
echo
"Please change your cron table's group membership."
...
...
@@ -474,7 +474,7 @@ get_temp_dir() {
echo
"ERROR: Cannot find a temporary directory."
TEMP_DIR
=
/tmp
}
# === End of get_temp_dir() === #
# ======================================================================
# Routine: cron_diagnose
# Checks the environment.
...
...
@@ -511,9 +511,9 @@ cron_diagnose() {
check_dir_perms /var d..x..x..x
||
ret
=
1
# There is no reason to have t on /var/cron,
# but it used to be set that way.
# but it used to be set that way.
check_dir_perms /var/cron d..x..x..[xt]
||
ret
=
1
check_dir_perms /var/cron/tabs drwxrwxrwt
||
ret
=
1
# Check write access to /var/run, to create cron_pid
...
...
@@ -525,7 +525,7 @@ cron_diagnose() {
# Check x access to /usr/sbin/cron
check_access /usr/sbin/cron ..x
||
ret
=
1
if
[
!
-f
"/usr/sbin/sendmail"
]
;
then
if
[
!
-f
"/usr/sbin/sendmail"
]
;
then
echo
"WARNING: /usr/sbin/sendmail does not point to an executable mailer"
;
echo
" such as ssmtp or exim, or /usr/bin/cronlog."
echo
" If the cron job produces any output on stdout or stderr,"
...
...
@@ -559,7 +559,7 @@ create_user() {
echo
echo
"Attempting to find or create a privileged user."
for
username
in
slaproot
cyg_server cron_server sshd_server
for
username
in
${
slapos_administrator
}
cyg_server cron_server sshd_server
do
if
net user
"
${
username
}
"
1> /dev/null 2>&1
;
then
[
-z
"
${
first_account
}
"
]
&&
first_account
=
"
${
username
}
"
...
...
@@ -690,15 +690,15 @@ install_service() {
echo
"WARNING: Download the cygrunsrv package to start the cron daemon as a service."
servtest
=
no
else
cygrunsrv
-Q
cron
>
/dev/null 2>&1
cygrunsrv
-Q
${
cron_service_name
}
>
/dev/null 2>&1
servtest
=
$?
fi
if
[
"
${
servtest
}
"
=
"0"
]
;
then
cronusername
=
"
$(
cygrunsrv
-VQ
cron
|
sed
-n
-e
's/^Account[ :]*//p'
)
"
cronusername
=
"
$(
cygrunsrv
-VQ
${
cron_service_name
}
|
sed
-n
-e
's/^Account[ :]*//p'
)
"
echo
"Cron is already installed as a service under account
${
cronusername
}
."
if
request
"Do you want to remove or reinstall it?"
;
then
if
cygrunsrv
-R
cron
;
then
if
cygrunsrv
-R
${
cron_service_name
}
;
then
echo
"OK. The cron service was removed."
echo
fi
...
...
@@ -714,9 +714,9 @@ install_service() {
true
else
getcygenv
" "
getcygenv
" "
echo
echo
echo
"You must decide under what account the cron daemon will run."
echo
"If you are the only user on this machine, the daemon can run as yourself."
echo
" This gives access to all network drives but only allows you as user."
...
...
@@ -741,7 +741,7 @@ install_service() {
else
echo
"WARNING: Make sure you have the privilege to logon as a service."
fi
else
else
echo
username
=
"
$1
"
_password
=
"
$2
"
...
...
@@ -755,8 +755,8 @@ install_service() {
fi
fi
echo
if
[
-n
"
${
username
}
"
]
;
then
if
[
-n
"
${
username
}
"
]
;
then
check_user
"
${
username
}
"
if
[
-z
"
${
_password
}
"
]
...
...
@@ -765,7 +765,7 @@ install_service() {
_password
=
"
${
value
}
"
fi
if
cygrunsrv
-I
cron
-p
/usr/sbin/cron
-e
CYGWIN
=
"
${
cygenv
}
"
\
if
cygrunsrv
-I
${
cron_service_name
}
-p
/usr/sbin/cron
-e
CYGWIN
=
"
${
cygenv
}
"
\
-a
"-n"
-d
"Cron daemon"
-u
"
$username
"
-w
"
$_password
"
then
service
=
"service"
...
...
@@ -773,7 +773,7 @@ install_service() {
service
=
"off"
fi
else
if
cygrunsrv
-I
cron
-p
/usr/sbin/cron
-e
CYGWIN
=
"
${
cygenv
}
"
\
if
cygrunsrv
-I
${
cron_service_name
}
-p
/usr/sbin/cron
-e
CYGWIN
=
"
${
cygenv
}
"
\
-a
"-n"
-d
"Cron daemon"
then
service
=
"service"
...
...
@@ -815,7 +815,7 @@ install_service() {
echo
" To avoid that, launch cron as a service (using cygrunsrv)."
/usr/sbin/cron
else
cygrunsrv
-S
cron
cygrunsrv
-S
${
cron_service_name
}
fi
[
$?
-eq
0
]
&&
echo
"OK. The cron daemon is now running."
elif
[
"
${
service
}
"
=
"job"
]
;
then
...
...
@@ -835,17 +835,17 @@ install_service() {
fi
echo
"for information about the problem cron is having."
echo
ls
-l
/usr/sbin/sendmail | fgrep
-q
cronlog
&&
echo
-e
"Examine also any cron.log file in the HOME directory
\n
(or the file specified in MAILTO) and cron related files in /tmp.
\n
"
echo
-e
"Examine also any cron.log file in the HOME directory
\n
(or the file specified in MAILTO) and cron related files in /tmp.
\n
"
echo
"If you cannot fix the problem, then report it to cygwin@cygwin.com."
echo
"Please run the script /usr/bin/cronbug and ATTACH its output"
echo
"(the file cronbug.txt) to your e-mail."
echo
"(the file cronbug.txt) to your e-mail."
echo
echo
"WARNING: PATH may be set differently under cron than in interactive shells."
echo
" Names such as
\"
find
\"
and
\"
date
\"
may refer to Windows programs."
echo
echo
}
# === End of install_service() === #
...
...
@@ -858,7 +858,7 @@ PATH=/usr/bin:$PATH
USER
=
"
$(
id
-un
)
"
get_temp_dir
# Take care of obsolete cron_diagnose.sh
# Take care of obsolete cron_diagnose.sh
if
expr
"
$0
"
:
'.*cron_diagnose.sh'
>
/dev/null
;
then
echo
-e
"
\n
INFO: cron_diagnose.sh is now included in cron-config.
\n
"
fi
...
...
@@ -867,7 +867,8 @@ sanity_check || exit 1
get_NT
||
exit
1
slapos_administrator
=
${
1
:slaproot
}
cron_service_name
=
${
2
:cron
}
install_service
$*
exit
$?
windows/scripts/slapos-cygwin-bootstrip.sh
View file @
36ac3ca0
...
...
@@ -52,9 +52,10 @@ declare -r node_certificate_file=/etc/opt/slapos/ssl/computer.crt
declare
-r
node_key_file
=
/etc/opt/slapos/ssl/computer.key
declare
-r
node_configure_file
=
/etc/opt/slapos/slapos.cfg
declare
-r
slapos_ifname
=
re6stnet-boot
declare
-r
slapos_ifname
=
slapboot-re6stnet-lo
declare
-r
ipv4_local_network
=
10.202.29.0/24
declare
-r
ipv6_local_address
=
2001:67c:1254:e:32::1
declare
-r
slapos_user_basename
=
slapboot-user
declare
-r
slapos_installer_software
=
http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-share:/software/slapos-windows-installer/software.cfg
...
...
@@ -245,7 +246,7 @@ sed -i -e "s%^\\s*interface_name.*$%interface_name = ${interface_guid}%" \
-e
"s%^#
\?\\
s*ipv6_interface.*
$%
# ipv6_interface =%g"
\
-e
"s%^ipv4_local_network.*
$%
ipv4_local_network =
${
ipv4_local_network
}
%"
\
-e
"s%^computer_id.*
$%
computer_id =
${
computer_guid
}
%"
\
-e
"s%^user_base_name =.*
$%
user_base_name =
slapguider
%"
\
-e
"s%^user_base_name =.*
$%
user_base_name =
${
slapos_user_basename
}
%"
\
${
node_configure_file
}
csih_inform
"type
${
node_configure_file
}
:"
csih_inform
"************************************************************"
...
...
windows/scripts/slapos-include.sh
View file @
36ac3ca0
#! /bin/bash
export
PATH
=
/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:
$PATH
if
!
source
/usr/share/csih/cygwin-service-installation-helper.sh
;
then
echo
"
Error: Download the csih package at first, I need this file:
"
echo
"
Download the csih package at first, to run this script requires
"
echo
" /usr/share/csih/cygwin-service-installation-helper.sh"
exit
1
fi
...
...
@@ -20,6 +20,8 @@ fi
# ======================================================================
# Constants
# ======================================================================
declare
-r
slapos_prefix
=
declare
-r
slapos_client_home
=
~/.slapos
declare
-r
client_configure_file
=
$slapos_client_home
/slapos.cfg
declare
-r
client_certificate_file
=
$slapos_client_home
/certificate
...
...
@@ -31,7 +33,6 @@ declare -r node_key_file=/etc/opt/slapos/ssl/computer.key
declare
-r
node_configure_file
=
/etc/opt/slapos/slapos.cfg
declare
-r
node_template_file
=
/etc/slapos/slapos.cfg.example
declare
-r
slapos_ifname
=
re6stnet-lo
# Change it if it confilcts with your local network
declare
-r
ipv4_local_network
=
10.201.67.0/24
...
...
@@ -39,14 +40,20 @@ declare -r openvpn_tap_driver_inf=/etc/slapos/driver/OemWin2k.inf
declare
-r
openvpn_tap_driver_hwid
=
tap0901
declare
-r
re6stnet_configure_file
=
/etc/re6stnet/re6stnet.conf
declare
-r
re6stnet_service_name
=
re6stnet
declare
-r
slapos_cron_config
=
/usr/bin/slapos-cron-config
declare
-r
slaprunner_startup_file
=
/etc/slapos/scripts/slap-runner.html
declare
-r
slapos_run_key
=
'\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
declare
-r
slapos_run_entry
=
slapos-configure
declare
-r
slapos_user
=
slaproot
declare
-r
slapos_run_entry
=
${
slapos_prefix
:slapos
}
-configure
declare
-r
slapos_administrator
=
${
slapos_prefix
:slap
}
root
declare
-r
slapos_user_basename
=
${
slapos_prefix
:slap
}
user
declare
-r
slapos_ifname
=
${
slapos_prefix
}
re6stnet-lo
declare
-r
re6stnet_service_name
=
${
slapos_prefix
}
re6stnet
declare
-r
cron_service_name
=
${
slapos_prefix
}
cron
declare
-r
sshd_service_name
=
${
slapos_prefix
}
sshd
declare
-r
syslog_service_name
=
${
slapos_prefix
}
syslog-ng
declare
-r
cygserver_service_name
=
${
slapos_prefix
}
cygserver
# ======================================================================
# Routine: check_cygwin_service
...
...
windows/scripts/slapos-node.sh
View file @
36ac3ca0
...
...
@@ -16,11 +16,11 @@ check_re6stnet_configure
# -----------------------------------------------------------
# Check cygwin services used by slapos
# -----------------------------------------------------------
check_cygwin_service
cygserver
check_cygwin_service
syslog-ng
check_cygwin_service
sshd
check_cygwin_service
cron
check_re6stnet_needed
&&
check_cygwin_service
re6stnet
check_cygwin_service
${
cygserver_service_name
}
check_cygwin_service
${
syslog_service_name
}
check_cygwin_service
${
sshd_service_name
}
check_cygwin_service
${
cron_service_name
}
check_re6stnet_needed
&&
check_cygwin_service
${
re6stnet_service_name
}
# -----------------------------------------------------------
# Get computer reference and re6stnet network
...
...
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