This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
Re: keychain service
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Karl M <karlm30 at hotmail dot com>
- Cc: cygwin-apps at cygwin dot com
- Date: Sun, 6 Mar 2005 20:48:30 -0500 (EST)
- Subject: Re: keychain service
- References: <BAY19-F21AADD0B58B57F244A899FB55E0@phx.gbl>
- Reply-to: cygwin-apps at cygwin dot com
On Sun, 6 Mar 2005, Karl M wrote:
> Hi All...
>
> The latest keychain (2.5.1) from gentoo works fine OOB on win2k, winxp and
> win98. I tested it in a multi-user environment on win2k and winxp. The win98
> testing was limited.
> Launching keychain (ssh-agent) from a service allows it to survive log
> off/on.
Karl,
I don't use keychain, but I imagine this would be quite useful. Thanks
for doing this.
> I have migrated all of my cygwin specific work to the service script to
> minimize support hassle. The files are attached.
Again, can't test the functionality, but I do have some general packaging
comments... Looks like your work can be packaged separately, as a
"keychain-service" package, for example, that depends on "keychain" (when
Hack updates it to the latest).
> keychain-service-install is a script used to install/reinstall the
> keychain-service for each user that desires it. It simplifies use and
> documents the parameters to cygrunsrv.
The "tradition" set by other packages/programs (e.g., cygserver, sshd,
exim, cron) call this script "*-config", so "keychain-config" sounds like
a more uniform name for this one. This should go into /usr/bin.
> keychain-service is the script that runs under cygrunsrv for each user
> that desires the service. It behaves well when stopped and started from
> the services panel, net commands and cygrunsrv commands. It also behaves
> well during system shutdown.
I imagine this one goes to /usr/sbin. You could even call it "keychaind".
:-)
> .profile is an example of what to include in ones profile to work with the
> keychain service.
Umm, this one should probably be named "sample.profile" (or
"example.profile") and go under /usr/share/doc/keychain-service.
Alternatively, you can install this script as
/etc/defaults/etc/profile.d/keychain.sh, and have keychain-config copy it
to /etc/profile.d/keychain.sh. Or, as a third possibility, always install
this as /etc/profile.d/keychain.sh, but have it check whether the current
userid is in some file (e.g., /var/keychaind/users), and make the
keychain-config script add the user's id to that file.
(Actually, looks like you're already checking for something being present
in the user's ~/.keychain directory, so you can just always run this
snippet from an /etc/profile.d script).
> example.bat is an example of what to include in a Windows shell script
> to make the ssh-agent available. This is handy when using programs that
> use ssh from within a Windows shell. Without the () form of the if, it
> works in win98 as well.
Another candidate for the /usr/share/doc tree.
So, to summarize, I would suggest creating a "keychain-service"
binary-only package (keychain-service-1.0.tar.bz2) with the following
contents (your old names after '#' signs):
usr/bin/keychain-config # keychain-service-install
usr/sbin/keychaind # keychain-service
usr/share/doc/keychain-service/sample.profile # .profile
usr/share/doc/keychain-service/example.bat # example.bat
etc/profile.d/keychain.sh # .profile
Did I mention that I think this is pretty cool and can be quite useful?
:-)
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT