-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

This may be useful for rc.d people so I've decided to post it here.  I
created these graphs with the NetBSD rcorder-visualize script with
some changes to adapt with our needs (e.g. some scripts would provide
multiple services, etc, attached).  I think the script is useful for
FreeBSD as well, should we import it?

Generated graph can be found at:

        http://people.freebsd.org/~delphij/misc/rcorder-r231173.svg

Or,
        https://www.delphij.net/rcorder-r231173.svg

(people.freebsd.org would serve the .svg as a download).

Cheers,
- -- 
Xin LI <[email protected]>    https://www.delphij.net/
FreeBSD - The Power to Serve!           Live free or die
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iQEcBAEBCAAGBQJPMd24AAoJEG80Jeu8UPuzflgIAKtj2mPkwQbdGRPV8ywBYLLa
faOacHpgJ0nmbLdfpjXFCx/gN4092MJ+xdYm8uOGH8H1S0ZjAE4NJSRdzpv8SGWE
I0hR0h2m9BvqxSJ5sPYHLSwJ32ro/DdlPrXYpYP0lzDt8eZjJpcCz2+5xQF1Iz/c
MX2jostyCDG5ShuT0R/FjT6UeWEdlHla1ZcBHZX+yYw7Lm5wij2rgLARG8v/qUj9
FvGzNVoGtEQpP5x2W1QYtX+dUaGxyN8yifGkOFKvuTZWwoaW77z0lGlsDrEEV15e
MCgatzlJIQRsF2zHZi15Gw8OYp60OgekpHrJvFIfespGIVwtXuu1MfGc2NQzE2c=
=xWxM
-----END PGP SIGNATURE-----
#!/bin/sh
# $NetBSD: rcorder-visualize.sh,v 1.5 2009/08/09 17:08:53 apb Exp $
#
# Written by Joerg Sonnenberger.  You may freely use and redistribute
# this script.
#
# Simple script to show the dependency graph for rc scripts.
# Output is in the dot(1) language and can be rendered using
#       sh rcorder-visualize | dot -T svg -o rcorder.svg
# dot(1) can be found in graphics/graphviz in pkgsrc.

rc_files=${*:-/etc/rc.d/*}

{
echo ' digraph {'
for f in $rc_files; do
< $f awk '
/# PROVIDE: /   { for (i = 3; i <= NF; i++) provides[$i] = $i }
/# REQUIRE: /   { for (i = 3; i <= NF; i++) requires[$i] = $i }
/# BEFORE: /    { for (i = 3; i <= NF; i++) befores[$i] = $i }

END {
        for (provide in provides) {
                print "    \"" provide "\";"
                        for (x in requires) print "    \"" x "\"->\"" provide 
"\";"
                        for (x in befores) print "    \"" provide "\"->\"" x 
"\";"
        }
}
'
done
echo '}'
}
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-rc
To unsubscribe, send any mail to "[email protected]"

Reply via email to