Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Sep 2010 20:10:55 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        jhell <jhell@DataIX.net>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: [ports/net/isc-dhcp*] Don't stop DHCP related daemons
Message-ID:  <4C8D25BF.3060705@infracaninophile.co.uk>
In-Reply-To: <4C8CE7BA.8070904@DataIX.net>
References:  <20100911222902.bb57444a.nork@FreeBSD.org>	<20100911173359.68d71af6@it.buh.tecnik93.com>	<AANLkTimxpLKmvZc%2Bybsav8Mrpjy_aopL2qT3m8cbYL-q@mail.gmail.com>	<20100911224547.GA35333@mail.hs.ntnu.edu.tw> <20100912094602.497f93c7@it.buh.tecnik93.com> <4C8CCF83.9010508@infracaninophile.co.uk> <4C8CE7BA.8070904@DataIX.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig94B218433D64D064A83C512C
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 12/09/2010 15:46:18, jhell wrote:
> On 09/12/2010 09:02, Matthew Seaman wrote:
>> On 12/09/2010 07:46:02, Ion-Mihai Tetcu wrote:
>>> And you can't really know if it's a new install or an upgrade.
>=20
>> An app like portmaster or portupgrade would be able to know that.  It'=
s
>> an oddity of the ports/pkg system that because 'upgrade' is implemente=
d
>> as 'delete' followed by 'install' that there is difficulty in making
>> that distinction.
>=20
>> In fact, portupgrade has a nifty feature you can enable which causes i=
t
>> to run '/usr/local/etc/rc.d/foo start' for any rc scripts installed by=
 a
>> port it is working on.  Which is almost, but not quite, exactly what i=
s
>> wanted; it should issue 'restart' for services already running, or
>> 'start' for services stopped during the upgrade process.
>=20
>=20
>=20
> If someone really wants to go for automation lets not leave it on the
> backs of every user that is involved with ports that offer network
> services but learn how to properly script out periodic(8) runs or a
> cron(8) job to check for the existence of that process.
>=20
> Line wrapage:
> */5 * * * * /usr/local/etc/rc.d/rcscript status \
> 		||/usr/local/etc/rc.d/rcscript start
>=20
> Or write your own periodic script that makes use of _enable etc... and
> put it in /usr/local/etc/periodic somewhere.

Heh.  BTDT.  Well, almost:

http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dbin/118325

That just reports on any services that should be running and aren't.  It
would be trivial to make it attempt to restart anything that needed
it.

> People may also be interested in this, that I use for personal cron job=
s
> that I need to schedule minutely hourly daily and such.
> http://bit.ly/9ODE56
>=20
> Perfectly fine that tools like portmaster or portupgrade offer these
> things but lets not forget that its also really easy to figure out what=

> services are going to be stopped before you start a upgrade and then
> restart them after using service(8) for example.
>=20
> Maybe it would not be such a bad idea to start a framework for a set of=

> periodic checks that the user can configure simple by
>=20
> # 5 Minute Service checks
> minutely_check_enable=3D"YES"	# Allow disabling all 5 minute checks.
> minutely_check_rcscript_enable=3D"YES" # Enable check for this rcscript=
=2E
>=20
> # Hourly checks				#
> hourly_check_enable=3D"YES"		# See above
> hourly_check_rcscript2_enable=3D"YES" 	#
> ...
>=20
> The rc.subr system should be able to handle this or service(8) by
> calling status and taking appropriate action for each script within an
> hourly_check_*_enable variable.

Hmmm... checking every 5 minutes and automatically restarting anything
not running sounds like a sorcerer's apprentice scenario...

You shouldn't need to check service status that frequently -- a report
once a day will do, unless you've just been fiddling with the system,
when you could just run the daily check by hand and deal with anything
that needs it.  If you've got a service where downtime cannot be
tolerated, that's why things like nagios and daemontools exist -- but
that's overkill much of the time.

	Cheers

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew@infracaninophile.co.uk               Kent, CT11 9PW


--------------enig94B218433D64D064A83C512C
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyNJcYACgkQ8Mjk52CukIx+rACeK/rvBJ0bVwAMk5ZDXldHsFPG
xnQAmwYWJHtYoTBXalPPmwckdQ2SjLp3
=S6Zj
-----END PGP SIGNATURE-----

--------------enig94B218433D64D064A83C512C--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C8D25BF.3060705>