Commit 21b9c087 authored by Jondy Zhao's avatar Jondy Zhao

change cygwin service name to support multi-instances

parent 36ac3ca0
...@@ -168,6 +168,9 @@ if ! cygrunsrv --query ${cygserver_service_name} > /dev/null 2>&1 ; then ...@@ -168,6 +168,9 @@ if ! cygrunsrv --query ${cygserver_service_name} > /dev/null 2>&1 ; then
csih_inform "run cygserver-config ..." csih_inform "run cygserver-config ..."
/usr/bin/cygserver-config --yes || \ /usr/bin/cygserver-config --yes || \
csih_error "failed to run cygserver-config" csih_error "failed to run cygserver-config"
[[ ${cygserver_service_name} == cygserver ]] ||
cygrunsrv -I ${cygserver_service_name} -d "CYGWIN ${cygserver_service_name}" -p /usr/sbin/cygserver ||
csih_error "failed to install service ${cygserver_service_name}"
else else
csih_inform "the cygserver service has been installed" csih_inform "the cygserver service has been installed"
fi fi
...@@ -177,19 +180,34 @@ if ! cygrunsrv --query ${syslog_service_name} > /dev/null 2>&1 ; then ...@@ -177,19 +180,34 @@ if ! cygrunsrv --query ${syslog_service_name} > /dev/null 2>&1 ; then
csih_inform "run syslog-ng-config ..." csih_inform "run syslog-ng-config ..."
/usr/bin/syslog-ng-config --yes || \ /usr/bin/syslog-ng-config --yes || \
csih_error "failed to run syslog-ng-config" csih_error "failed to run syslog-ng-config"
[[ ${syslog_service_name} == "syslog-ng" ]] ||
cygrunsrv -I ${syslog_service_name} -d "CYGWIN ${syslog_service_name}" -p /usr/sbin/syslog-ng -a "-F" ||
csih_error "failed to install service ${syslog_service_name}"
else else
csih_inform "the syslog-ng service has been installed" csih_inform "the syslog-ng service has been installed"
fi fi
check_cygwin_service ${syslog_service_name} check_cygwin_service ${syslog_service_name}
if ! cygrunsrv --query ${sshd_service_name} > /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 if csih_is_vista && [[ -z "${csih_PRIVILEGED_PASSWORD}" ]] ; then
slapos_request_password ${_administrator} "Install sshd service need the password of ${_administrator}." slapos_request_password ${_administrator} "Install sshd service need the password of ${_administrator}."
fi fi
csih_inform "run ssh-host-config ..." csih_inform "run ssh-host-config ..."
/usr/bin/ssh-host-config --yes --cygwin ntsec --port 22002 \ /usr/bin/ssh-host-config --yes --cygwin ntsec --port 22002 \
--user ${_administrator} --pwd ${csih_PRIVILEGED_PASSWORD} || --user ${_administrator} --pwd ${csih_PRIVILEGED_PASSWORD} ||
csih_error "Failed to run ssh-host-config" csih_error "Failed to run ssh-host-config"
if csih_is_vista ; then
[[ ${sshd_service_name} == "sshd" ]] ||
cygrunsrv -I ${sshd_service_name} -d "CYGWIN ${sshd_service_name}" -p /usr/sbin/sshd \
-a "-D" -y tcpip -e "CYGWIN=ntsec" -u "${_administrator}" -w "${csih_PRIVILEGED_PASSWORD}" ||
csih_error "failed to install service ${sshd_service_name}"
else
[[ ${sshd_service_name} == "sshd" ]] ||
cygrunsrv -I ${sshd_service_name} -d "CYGWIN ${sshd_service_name}" -p /usr/sbin/sshd \
-a "-D" -y tcpip -e "CYGWIN=ntsec" ||
csih_error "failed to install service ${sshd_service_name}"
fi
else else
csih_inform "the sshd service has been installed" csih_inform "the sshd service has been installed"
fi fi
...@@ -205,7 +223,7 @@ if ! cygrunsrv --query ${cron_service_name} > /dev/null 2>&1 ; then ...@@ -205,7 +223,7 @@ if ! cygrunsrv --query ${cron_service_name} > /dev/null 2>&1 ; then
fi fi
csih_inform "run slapos-cron-config ..." csih_inform "run slapos-cron-config ..."
${slapos_cron_config} ${_administrator} ${csih_PRIVILEGED_PASSWORD} || ${slapos_cron_config} ${cron_service_name} ${_administrator} ${csih_PRIVILEGED_PASSWORD} ||
csih_error "Failed to run ${slapos_cron_config}" csih_error "Failed to run ${slapos_cron_config}"
else else
csih_inform "the cron service has been installed" csih_inform "the cron service has been installed"
......
...@@ -867,8 +867,9 @@ sanity_check || exit 1 ...@@ -867,8 +867,9 @@ sanity_check || exit 1
get_NT || exit 1 get_NT || exit 1
slapos_administrator=${1:slaproot} cron_service_name=${1:cron}
cron_service_name=${2:cron} slapos_administrator=${2:slaproot}
install_service $* _password=$3
install_service ${slapos_administrator} ${_password}
exit $? exit $?
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