[ic] gpg encryptor FAQ problem. Problem Solution included but also a new question.

Boyd Lynn Gerber gerberb@zenez.com
Fri, 16 Feb 2001 10:11:23 -0700 (MST)


On Fri, 16 Feb 2001, Cameron B. Prince wrote:
> Give this a try:
>
> /usr/bin/gpg -e -a -q --batch --no-tty -r key@domain.com 2>encrypt.error
>
> If you have problems, cat the encrypt.error file in the catroot and you
> should be
> able to see gpg's output. This came from a working catalog.

Thanks, I guess I was really tired at 4:00 A.M.  I had 2>/dev/null and I
could not figure out why I was not dumping the errors to a file.  Below is
what I have to use.

ENCRYPTOR       /usr/local/bin/gpg -e -a -q --batch --no-tty --always-trust -r people@signaturebooks.com 2>encrypt.error        Payment

and it give me an error if interchange is started by root using

su interch -c "/usr/local/interchange/bin/interchange -r -u"

A ps -ef shows interch is the interchange user, but I get this message.

gpg: //.gnupg/secring.gpg: can't create keyring: Permission denied
gpg: keyblock resource `//.gnupg/secring.gpg': file open error
gpg: people@signaturebooks.com: skipped: public key not found
gpg: [stdin]: encryption failed: public key not found

but if I start interchange after I have logged in as interch not su, it
works.

su - interch -c "/usr/local/interchange/bin/interchange -r -u"

Does not work.  It does not read/use the .profile of the interch.  I get
errors about DBI that do not show if I start interchange after I have
logged in.

The solution was to login as the interch user and start interchange.  Now
I just have to figure out how to get this to work when I restart the
machine.  My normal /etc/rc2.d/S99interchange does not work.

----------------------------S99interchange------------------------------
#!/bin/sh
# interchange deamon start/stop script.

# Usually this is put in /etc/rc2.d
# When this is done the interchange server will be started when the
# machine is started.

LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/ccs/lib:/usr/local/mysql/lib/mysql:/usr/local/BerkeleyDB3.2:;export LD_LIBRARY_PATH
PATH=/sbin:/usr/bin:/usr/sbin:/bin
basedir=/usr/local/interchange
bindir=/usr/local/interchange/bin
export PATH

mode=$1

# Safeguard (relative paths, core dumps..)
cd $basedir

case "$mode" in
  'start')
    # Start deamon

    if test -x $bindir/interchange
    then
      # -l means start with log.
	/bin/su interch -c "$bindir/interchange"
    else
      echo "Can't execute $bindir/interchange"
    fi
    ;;

  'stop')
    # Stop deamon
    $bindir/interchange --kill 9
    ;;

  *)
    # usage
    echo "usage: $0 start|stop"
    exit 1
    ;;
esac
------------------------------cut here----------------------------------

Any ideas on how to change the above to fix the problem or restart
interchange without logging in as user interch?

Thanks,

--
Boyd Gerber <gerberb@zenez.com>
ZENEZ	3748 Valley Forge Road, Magna Utah  84044
Office 801-250-0795 FAX 801-250-7975