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
csih_inform "run cygserver-config ..."
/usr/bin/cygserver-config --yes || \
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
csih_inform "the cygserver service has been installed"
fi
......@@ -177,19 +180,34 @@ 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"
[[ ${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
csih_inform "the syslog-ng service has been installed"
fi
check_cygwin_service ${syslog_service_name}
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}."
fi
csih_inform "run ssh-host-config ..."
/usr/bin/ssh-host-config --yes --cygwin ntsec --port 22002 \
--user ${_administrator} --pwd ${csih_PRIVILEGED_PASSWORD} ||
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
csih_inform "the sshd service has been installed"
fi
......@@ -205,7 +223,7 @@ if ! cygrunsrv --query ${cron_service_name} > /dev/null 2>&1 ; then
fi
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}"
else
csih_inform "the cron service has been installed"
......
......@@ -867,8 +867,9 @@ sanity_check || exit 1
get_NT || exit 1
slapos_administrator=${1:slaproot}
cron_service_name=${2:cron}
install_service $*
cron_service_name=${1:cron}
slapos_administrator=${2:slaproot}
_password=$3
install_service ${slapos_administrator} ${_password}
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