This is the mail archive of the cygwin-apps mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Tue, Nov 04 2014, Florian Friesdorf wrote: > On Tue, Nov 04 2014, Achim Gratz wrote: >> Shouldn't $service_name default to "sshd" perhaps so that invocations >> without the new switch continue to work? > > Good point - will send an updated patch. Updated version defaulting to old value for service name and using non-colliding -N. And along the same lines a patch for cygserver-config. As I started this on cygwin-apps, I'm replying here, but will use cygwin@ in the future.
From f230cc5a1eeb6919e8ee7450ac7b1980d1fde5c5 Mon Sep 17 00:00:00 2001 From: Florian Friesdorf <flo@chaoflow.net> Date: Wed, 5 Nov 2014 13:48:02 +0100 Subject: [PATCH 1/2] ssh-host-config: configurable sshd service name --- bootstrap-development-cygwin/skel/bin/ssh-host-config | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/bootstrap-development-cygwin/skel/bin/ssh-host-config b/bootstrap-development-cygwin/skel/bin/ssh-host-config index a7ea3e0..adeaa80 100755 --- a/bootstrap-development-cygwin/skel/bin/ssh-host-config +++ b/bootstrap-development-cygwin/skel/bin/ssh-host-config @@ -61,6 +61,7 @@ LOCALSTATEDIR=/var sshd_config_configured=no port_number=22 +service_name=sshd strictmodes=yes privsep_used=yes cygwin_value="" @@ -410,7 +411,7 @@ install_service() { local ret=0 echo - if /usr/bin/cygrunsrv -Q sshd >/dev/null 2>&1 + if /usr/bin/cygrunsrv -Q ${service_name} >/dev/null 2>&1 then csih_inform "Sshd service is already installed." check_service_files_ownership "" || let ret+=$? @@ -466,7 +467,7 @@ install_service() { fi if [ -z "${password}" ] then - if /usr/bin/cygrunsrv -I sshd -d "CYGWIN sshd" -p /usr/sbin/sshd \ + if /usr/bin/cygrunsrv -I ${service_name} -d "CYGWIN ${service_name}" -p /usr/sbin/sshd \ -a "-D" -y tcpip "${cygwin_env[@]}" then echo @@ -476,20 +477,20 @@ install_service() { csih_inform "will start automatically after the next reboot." fi else - if /usr/bin/cygrunsrv -I sshd -d "CYGWIN sshd" -p /usr/sbin/sshd \ + if /usr/bin/cygrunsrv -I ${service_name} -d "CYGWIN ${service_name}" -p /usr/sbin/sshd \ -a "-D" -y tcpip "${cygwin_env[@]}" \ -u "${run_service_as}" -w "${password}" then /usr/bin/editrights -u "${run_service_as}" -a SeServiceLogonRight echo csih_inform "The sshd service has been installed under the '${run_service_as}'" - csih_inform "account. To start the service now, call \`net start sshd' or" - csih_inform "\`cygrunsrv -S sshd'. Otherwise, it will start automatically" + csih_inform "account. To start the service now, call \`net start ${service_name}' or" + csih_inform "\`cygrunsrv -S ${service_name}'. Otherwise, it will start automatically" csih_inform "after the next reboot." fi fi - if /usr/bin/cygrunsrv -Q sshd >/dev/null 2>&1 + if /usr/bin/cygrunsrv -Q ${service_name} >/dev/null 2>&1 then check_service_files_ownership "${run_service_as}" || let ret+=$? else @@ -563,6 +564,11 @@ do shift ;; + -N | --name ) + service_name=$1 + shift + ;; + -p | --port ) port_number=$1 shift @@ -592,6 +598,7 @@ do echo " --yes -y Answer all questions with \"yes\" automatically." echo " --no -n Answer all questions with \"no\" automatically." echo " --cygwin -c <options> Use \"options\" as value for CYGWIN environment var." + echo " --name -N <name> sshd windows service name." echo " --port -p <n> sshd listens on port n." echo " --user -u <account> privileged user for service, default 'cyg_server'." echo " --pwd -w <passwd> Use \"pwd\" as password for privileged user." -- 2.1.1
From cada6fb8631d44fd7fc509fa71cd4b44ebcf6327 Mon Sep 17 00:00:00 2001 From: Florian Friesdorf <flo@chaoflow.net> Date: Wed, 5 Nov 2014 13:54:28 +0100 Subject: [PATCH 2/2] cygserver-config: configurable cygserver service name --- bootstrap-development-cygwin/skel/bin/cygserver-config | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/bootstrap-development-cygwin/skel/bin/cygserver-config b/bootstrap-development-cygwin/skel/bin/cygserver-config index b8f441c..abe943c 100755 --- a/bootstrap-development-cygwin/skel/bin/cygserver-config +++ b/bootstrap-development-cygwin/skel/bin/cygserver-config @@ -10,6 +10,7 @@ LOCALSTATEDIR=/var progname=$0 auto_answer="" +service_name=cygserver request() { @@ -63,6 +64,11 @@ do auto_answer=no ;; + -N | --name ) + service_name=$1 + shift + ;; + *) echo "usage: ${progname} [OPTION]..." echo @@ -72,6 +78,7 @@ do echo " --debug -d Enable shell's debug output." echo " --yes -y Answer all questions with \"yes\" automatically." echo " --no -n Answer all questions with \"no\" automatically." + echo " --name -N <name> cygserver windows service name." echo exit 1 ;; @@ -84,10 +91,10 @@ _sys="`uname`" _nt=`expr "${_sys}" : "CYGWIN_NT"` # Check for running cygserver processes first. -if ps -ef | grep -v grep | grep -q cygserver +if ps -ef | grep -v grep | grep -q ${service_name} then echo - echo "There is a cygserver already running. Nothing to do, apparently." + echo "There is a cygserver (${service_name}) already running. Nothing to do, apparently." echo exit 1 fi @@ -164,7 +171,7 @@ fi if [ ${_nt} -gt 0 ] then # But only if it is not already installed - if ! cygrunsrv -Q cygserver > /dev/null 2>&1 + if ! cygrunsrv -Q ${service_name} > /dev/null 2>&1 then echo echo @@ -173,7 +180,7 @@ then echo "Do you want to install cygserver as service?" if request "(Say \"no\" if it's already installed as service)" then - if ! cygrunsrv -I cygserver -d "CYGWIN cygserver" -p /usr/sbin/cygserver + if ! cygrunsrv -I ${service_name} -d "CYGWIN cygserver" -p /usr/sbin/cygserver then echo echo "Installation of cygserver as service failed. Please check the" @@ -186,7 +193,7 @@ then fi echo echo "The service has been installed under LocalSystem account." - echo "To start it, call \`net start cygserver' or \`cygrunsrv -S cygserver'." + echo "To start it, call \`net start ${service_name}' or \`cygrunsrv -S ${service_name}'." fi touch "${LOCALSTATEDIR}/log/cygserver.log" chown 18.544 "${LOCALSTATEDIR}/log/cygserver.log" -- 2.1.1
-- Florian Friesdorf <flo@chaoflow.net> GPG FPR: 7A13 5EEE 1421 9FC2 108D BAAF 38F8 99A3 0C45 F083 Jabber/XMPP: flo@chaoflow.net IRC: chaoflow on freenode,ircnet,blafasel,OFTC
Attachment:
pgpmfG3BJOQ8W.pgp
Description: PGP signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |