From owner-freebsd-ports@FreeBSD.ORG Wed Jun 18 06:51:53 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44A79106564A; Wed, 18 Jun 2008 06:51:53 +0000 (UTC) (envelope-from yuri.pankov@gmail.com) Received: from mail.irbisnet.ru (mail.irbisnet.ru [194.186.18.2]) by mx1.freebsd.org (Postfix) with ESMTP id 876C78FC15; Wed, 18 Jun 2008 06:51:50 +0000 (UTC) (envelope-from yuri.pankov@gmail.com) Received: from [192.168.0.23] (igw.irbisnet.ru [194.186.18.4]) (authenticated bits=0) by mail.irbisnet.ru (8.14.2/8.14.2) with ESMTP id m5I6Zoe5015489 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Jun 2008 10:35:57 +0400 (MSD) (envelope-from yuri.pankov@gmail.com) Message-ID: <4858ACC4.4000304@gmail.com> Date: Wed, 18 Jun 2008 10:35:48 +0400 From: Yuri Pankov User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Pietro Cerutti References: <746214C8-3863-4B29-8B01-230579284C76@bitgravity.com> <4858428A.80502@FreeBSD.org> In-Reply-To: <4858428A.80502@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: David Hawthorne , freebsd-ports@freebsd.org Subject: Re: Question about ports adding cronjobs X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jun 2008 06:51:53 -0000 Pietro Cerutti wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > David Hawthorne wrote: > | I have a piece of software I've been working on that gathers stats about > | the local host and shoves them into rrd files, with an accompanying web > | front-end page that generates pretty graphs from the RRDs on demand. I > | have a package done up for it, and I'd like to add it to the ports tree > | eventually, but I'm stuck on how to get it to automagically add the > | cronjob to have the stats gathering script run every five minutes, and I > | don't know of any ports that add cronjobs off the top of my head to go > | look at. > | > | Is there an approved standard for doing this? It doesn't have to be as > | root, either, it can run under a different user. Any advice on how to > | get the port to add the user (and remove it properly when the port is > | deinstalled) properly and securely would be appreciated as well. > > The only port which comes to my mind which goes near to what you want to > achieve is sysutils/bsdstats, which installs a script in periodic/monthly. > If running daily is enough you may want to look at that. > > Another option would be to create a support script/daemon and place it > in rc.d. The script/daemon would then sit idle and wake up once every > and gather your statistics. > > Third option: instruct the user (via a message at post-install stage) on > how to setup the cron job. Sorry for chiming in, but pkg-message seems more appropriate - it can be checked later with pkg_info -D. > | > | Bonus points for providing the lines that would need to go into a > | CONTENTS file for the package, because that's what I'm working with > | right now for testing it on multiple machines. > | > | Thanks! > > > - -- > Pietro Cerutti > gahr@FreeBSD.org > > PGP Public Key: > http://gahr.ch/pgp > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.9 (FreeBSD) > > iEYEAREKAAYFAkhYQokACgkQwMJqmJVx945RwgCgqXsRvtIs4zUqp3zxo2Z7g25n > R3EAn2ZqcCxPsYwHnrNNq363bPQIK//o > =I8a4 > -----END PGP SIGNATURE----- Yuri