List Info

Thread: How should I kill a daemon from an ebuild file?




How should I kill a daemon from an ebuild file?
country flaguser name
Denmark
2007-07-27 07:54:56
Hi,

I have an ebuild (see below) for a small keyring daemon. I
would like to
kill the daemon process, if it is running, whenever it is
emerged again
to ensure that no running daemon process refers to an old
install.

Is there a clean and recommended way of doing this in an
ebuild or
should I just use killall in pkg_postinst()?

Thanks,
  jules



#  
# Ebuild file for the Brutus Keyring.
# Copyright (C) 2007 OMC Denmark ApS
#
# This program is free software; you can redistribute it
and/or modify
# it under the terms of the GNU General Public License as
published by
# the Free Software Foundation; either version 2 of the
License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be
useful,
# but WITHOUT ANY WARRANTY; without even the implied
warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
License
# along with this program; if not, write to the Free
Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
# MA 02111-1307 USA
#
# Please see http://gentoo-wiki.com/HOWTO_Installing_3rd_Party_Ebuil
ds
# on how to use this ebuild file.
#
# $Header: $

inherit eutils

DESCRIPTION="Brutus Keyring daemon"
HOMEPAGE="http://www.omesc.com/&quo
t;
SRC_URI="h
ttp://www.omesc.com/sites/default/files/downloads/dist/brutu
s-keyring/Gentoo/brutus-keyring-0.9.3.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64"

IUSE="debug"
RESTRICT="nomirror"

DEPEND=">=gnome-base/orbit-2.14.1
	>=dev-libs/libIDL-0.8.5
	>=dev-util/pkgconfig-0.20
	>=dev-libs/libgcrypt-1.2.2
	gnome-base/gnome-common"

DOCS="COPYING README INSTALL docs/brutus-keyring-guide
docs/brutus-keyring-devel-guide"

src_compile() {
	BRUTUS_ECONF="--enable-brutus-dist=yes 
		--enable-brutus-devel=yes 
		--enable-brutus-target=gentoo 
		$(use_enable debug brutus-debug yes)"

	econf $ || die "econf failed"
	emake || die "emake failed"
}

src_install() {
	emake DESTDIR="$" install || die "emake
install failed"
	dodoc $
}


pkg_postinst() {
	elog "brutus-keyring has been installed"
}


-- 
gentoo-usergentoo.org mailing list


Re: How should I kill a daemon from an ebuild file?
country flaguser name
United States
2007-07-27 08:45:24
On Fri, 2007-07-27 at 14:54 +0200, Jules Colding wrote:
> Hi,
> 
> I have an ebuild (see below) for a small keyring
daemon. I would like
> to
> kill the daemon process, if it is running, whenever it
is emerged
> again
> to ensure that no running daemon process refers to an
old install.
> 
> Is there a clean and recommended way of doing this in
an ebuild or
> should I just use killall in pkg_postinst()?

You might wanna check the -dev mailing list to be sure, but
I'm almost
certain that they'll tell you this is a no-no.  Generally
speaking
ebuilds should build/install packages and not affect the
system in ways
like starting/killing processes. A simple ELOG message is
the preferred
method.

Nevertheless, the -dev list is probably the better forum to
answer your
question.

--
Albert W. Hopkins

-- 
gentoo-usergentoo.org mailing list


Re: How should I kill a daemon from an ebuild file?
country flaguser name
Denmark
2007-07-27 08:47:31
On Fri, 2007-07-27 at 08:45 -0500, Albert Hopkins wrote:
> On Fri, 2007-07-27 at 14:54 +0200, Jules Colding
wrote:
> > Hi,
> > 
> > I have an ebuild (see below) for a small keyring
daemon. I would like
> > to
> > kill the daemon process, if it is running,
whenever it is emerged
> > again
> > to ensure that no running daemon process refers to
an old install.
> > 
> > Is there a clean and recommended way of doing this
in an ebuild or
> > should I just use killall in pkg_postinst()?
> 
> You might wanna check the -dev mailing list to be sure,
but I'm almost
> certain that they'll tell you this is a no-no. 
Generally speaking
> ebuilds should build/install packages and not affect
the system in ways
> like starting/killing processes. A simple ELOG message
is the preferred
> method.
> 
> Nevertheless, the -dev list is probably the better
forum to answer your
> question.

OK - thanks,
  jules


-- 
gentoo-usergentoo.org mailing list


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )