Question about ports adding cronjobs

Pietro Cerutti gahr at FreeBSD.org
Tue Jun 17 23:59:31 UTC 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Jeremy Chadwick wrote:
| On Wed, Jun 18, 2008 at 01:02:34AM +0200, 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
|> <your preferred time here> and gather your statistics.
|>
|> Third option: instruct the user (via a message at post-install stage) on
|> how to setup the cron job.
|
| Or a fourth option: do what mail/postfix does, and prompt you
| interactively during the install phase whether or not you want <thing>
| done to your system.  In the case of mail/postfix, it prompts you to
| permit modification of /etc/mail/mailer.conf.

Thought that as well, but it complicates package building and doesn't
bring much. I mean, to echo "add xx yy to your crontab" is not a big deal..

|
| Automatic modification of cronjobs, system files, etc. == generally
| shunned.  I don't mind if the port asks me for permission to do such,
| but I do mind if it blindly starts modifying things on my system without
| my approval.
|


- --
Pietro Cerutti
gahr at FreeBSD.org

PGP Public Key:
http://gahr.ch/pgp

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)

iEYEAREKAAYFAkhYT9gACgkQwMJqmJVx947y6gCgw8EPXi4iyaQuKHB4E0nAMCDX
4YYAoJ6LHH3zgki6D4LFb3oa2fUv3g3q
=SByC
-----END PGP SIGNATURE-----


More information about the freebsd-ports mailing list