SUMMARY: postremove script fails in pkgrm

From: js@cctechnol.com
Date: Wed Apr 10 1996 - 20:51:00 CDT


Thanks to all for the quick response.

My original post:

! I have the following script as a postremove script in a package I'm
! building:
!
! -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
! #!/bin/sh
! #
! # postremove script for smail
! # moves /usr/lib/sendmail.dist to /usr/lib/sendmail if it exists
! #
!
! test -L /usr/lib/sendmail
! if [ $? ]
! then
! rm -f /usr/lib/sendmail
! else
! exit 2
! fi
!
! test -f /usr/lib/sendmail.dist
! if [ $? ]
! then
! mv /usr/lib/sendmail.dist /usr/lib/sendmail
! f
! -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
!
! When I do a pkgrm it fails with the error:
!
! /var/sadm/pkg/NETsmail/install/postremove: test: argument expected
! pkgrm: ERROR: postremove script did not complete successfully
!
! But I can run this script from the command line and it works
! fine. Does anyone see something that I'm missing?

I received responses from

mike@trdlnk.com (Michael Sullivan)
Sean Skilton <seans@ctpm.uq.edu.au>
bismark@alta.jpl.nasa.gov (Bismark Espinoza)

It turns out to be a path problem. Either explicitly setting a PATH or
using absolute pathnames for all binaries solved the
problem. /usr/ucb/test was being executed instead of /usr/bin/test.

It was also suggested to use the -h option as this appears to work in
both versions.

        Johnie

==============================================================================
 Johnie Stafford, System Administrator * Phone: (318) 981-1442
 C & C Technologies, Inc. * Fax: (318) 988-1016
 500 Dover Blvd. * E-mail: js@cctechnol.com
 Lafayette, LA 70503 * URL: http://www.cctechnol.com
==============================================================================



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:57 CDT