From owner-freebsd-ports Mon May 28 12:55:30 2001 Delivered-To: freebsd-ports@freebsd.org Received: from mail.noos.fr (lafontaine.noos.net [212.198.2.72]) by hub.freebsd.org (Postfix) with ESMTP id E279937B43C for ; Mon, 28 May 2001 12:55:26 -0700 (PDT) (envelope-from clefevre@redirect.to) Received: (qmail 17311924 invoked by uid 0); 28 May 2001 19:55:25 -0000 Received: from d165.dhcp212-198-231.noos.fr (HELO gits.dyndns.org) ([212.198.231.165]) (envelope-sender ) by lafontaine.noos.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 28 May 2001 19:55:25 -0000 Received: (from root@localhost) by gits.dyndns.org (8.11.3/8.11.3) id f4SJtNb63099; Mon, 28 May 2001 21:55:23 +0200 (CEST) (envelope-from clefevre@redirect.to) To: Ernst de Haan Cc: OKAZAKI Tetsurou , Peter Pentchev , ports@FreeBSD.ORG Subject: Re: No pre- or post-deinstall target? References: <20010528101937.A9039@c187104187.telekabel.chello.nl> <20010528113238.E8450@ringworld.oblivion.bg> <867kz1c1ln.wl@dolphin.be.to> <20010528110932.A9375@c187104187.telekabel.chello.nl> <20010528112524.A12023@c187104187.telekabel.chello.nl> X-Face: V|+c;4!|B?E%BE^{E6);aI.[<97Zd*>^#%Y5Cxv;%Y[PT-LW3;A:fRrJ8+^k"e7@+30g0YD0*^^3jgyShN7o?a]C la*Zv'5NA,=963bM%J^o]C Reply-To: Cyrille Lefevre In-Reply-To: <20010528112524.A12023@c187104187.telekabel.chello.nl> Mail-Copies-To: never From: Cyrille Lefevre Date: 28 May 2001 21:55:22 +0200 Message-ID: Lines: 32 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Ernst de Haan writes: > > Hmm, I will need to stop the Orion server *before* all files in pkg-plist are > > deleted, cause I will use the installed 'orionctl' script to stop the server. > > This will also delete the PID file (/var/run/orion.pid)... > > I just wrote a simple pkg-deinstall file: > > #!/bin/sh > PID_FILE=/var/run/orion.pid > if [ -e ${PID_FILE} ]; then > echo -n "Orion is still running." > /bin/kill `cat ${PID_FILE}` > rm -f ${PID_FILE} > echo " Stopped." > fi this could be done using @unexec at the beginning of the pkg-plist file such as : @unexec [ -e /var/run/orion.pid ] && { echo killing orion.; kill `cat /var/run/orion.pid`; rm -f /var/run/orion.pid; } an alternative would be to use killall such as : @unexec echo killing orion.; killall orion; rm -f /var/run/orion.pid FYI, the pkg-plist file is parsed and executed sequencially. Cyrille. -- home: mailto:clefevre@redirect.to UNIX is user-friendly; it's just particular work: mailto:Cyrille.Lefevre@edf.fr about who it chooses to be friends with. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message