Mail Archives: cygwin/2001/05/14/11:38:56
I have uploaded version 0.92 of my own implementation of a NT/W2K
service starter application called `cygrunsrv'.
It can completely substitute Microsoft's INSTSRV and SRVANY and is a
Cygwin application itself so it obviously supports Cygwin applications
better.
`cygrunsrv' will be installed into /bin. This is important so that it
finds cygwin1.dll even if the Windows %PATH% variable doesn't contain
the path to cygwin1.dll. `cygrunsrv' itself always adds "/bin" to
$PATH so that the started applications will find cygwin1.dll as well.
There's currently one caveat, though. If the application behaves as
a daemon and exits after forking a child, cygrunsrv does immediately
stop the service. That means, that you have to start the application
so that it doesn't fork a daemon but does everything by itself. sshd
for example has to be called with the -D option. Otherwise the sshd
daemon runs but is not stoppable through the service manager.
I want to use `cygrunsrv' in future ssh-host-config scripts to ease
the installation of sshd.
Usage:
======
Main options: Exactly one is required.
-I, --install <svc_name> Installes a new service named <svc_name>.
-R, --remove <svc_name> Removes a service named <svc_name>.
-S, --start <svc_name> Starts a service named <svc_name>.
-E, --stop <svc_name> Stops a service named <svc_name>.
Required install options:
-p, --path <app_path> Application path which is run as a service.
Miscellaneous install options:
-a, --args <args> Optional string with command line options which
is given to the service application on startup.
-e, --env <VAR=VALUE> Optional environment strings which are added
to the environment when service is started.
You can add up to 255 environment strings using
the `--env' option.
Note: /bin is always added to $PATH to allow all
started applications to find at least cygwin1.dll.
-d, --disp <display name> Optional string which contains the display name
of the service. Defaults to service name.
-t, --type [auto|manual] Optional start type of service. Defaults to `auto'.
-u, --user <user name> Optional user name to start service as.
Defaults to SYSTEM account.
-w, --passwd <password> Optional password for user. Only needed
if a user is given. If a user has an empty
password, enter `-w '. If a user is given but
no password, cygrunsrv will ask for a password
interactively.
Informative output:
-h, --help print this help, then exit.
-v, --version print cygrunsrv program version number, then exit.
Examples:
=========
To install the Cygwin application /bin/foo as service "foo" running under
LocalSystem account, no special options:
cygrunsrv -I foo -p /bin/foo
To install /bin/foo as a service "bar" which requires command line options:
cygrunsrv -I bar -p /bin/foo -a '--opt1 --opt2 -x'
To install /bin/foo as a service "baz" which requires a command line option
which contains spaces:
cygrunsrv -I baz -p /bin/foo -a "-x 'this has spaces inside'"
or
cygrunsrv -I baz -p /bin/foo -a '-x "this has spaces inside"'
To install /bin/foo as a service "foo bar" which doesn't automatically
startup when the system boots:
cygrunsrv -I "foo bar" -p /bin/foo -t manual
To install /bin/foo as a service "bongo" which requires settings for the
environment variables "ENV_VAR_1" and "ENV_VAR_2" to run correctly:
cygrunsrv -I bongo -p /bin/foo -e "ENV_VAR_1=important_1" \
-e "ENV_VAR_2=also_important"
To install sshd as service under user `joey' account:
cygrunsrv -I "Joey sshd" -p /usr/sbin/sshd -a '-d' -u joey
cygrunsrv asks for `joey's password interactively. If one wants
to give joey's password (say, "privy23") on the command line:
cygrunsrv -I "Joey sshd" -p /usr/sbin/sshd -a '-D' -u joey -w privy23
To start the service `foo':
cygrunsrv -S foo
To stop the service `foo':
cygrunsrv -E foo
To uninstall the service `foo':
cygrunsrv -R foo
To update your installation, click on the "Install Cygwin now" link on
the http://cygwin.com web page. This downloads setup.exe to your system.
Run setup and answer all of the questions. The mirrors below have the
latest version of this package:
ftp://linux.sarang.net/mirror/development/compiler/cygwin/ (Korea)
ftp://ftp.mirror.ac.uk/sites/sourceware.cygnus.com/pub/cygwin/ (UK)
ftp://ftp.sunsite.utk.edu/pub/cygwin/ (US)
Note that if this is the first time that you've run the new GUI version
of setup, it will currently download the whole cygwin net release again.
After this point it will only download what is needed.
If you have questions or comments, please send them to the Cygwin
mailing list at: cygwin AT cygwin DOT com . I would appreciate if you would
use this mailing list rather than emailing me directly. This includes
ideas and comments about the setup utility or Cygwin in general.
If you want to make a point or ask a question the Cygwin mailing list is
the appropriate place.
*** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***
If you want to unsubscribe to the cygwin-announce mailing list, look
at the "List-Unsubscribe: " tag in the email header of this message.
Send email to the address specified there. It will be in the format:
cygwin-announce-unsubscribe-you=yourdomain DOT com AT cygwin DOT com
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Developer mailto:cygwin AT cygwin DOT com
Red Hat, Inc.
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -