diff options
author | yar <yar@FreeBSD.org> | 2006-12-31 10:37:18 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2006-12-31 10:37:18 +0000 |
commit | dc9f8423c3772111565181a8568c60c4da0a1689 (patch) | |
tree | 7ed36d4fe8965c59b37bcccfa387cf77469cbeef /etc/rc.d/pfsync | |
parent | 58a4c67f05bc56e76c61ca19ed42f2e412cfd55f (diff) | |
download | FreeBSD-src-dc9f8423c3772111565181a8568c60c4da0a1689.zip FreeBSD-src-dc9f8423c3772111565181a8568c60c4da0a1689.tar.gz |
Use $required_modules wherever suitable. Use load_kld() in special
cases. So we get rid of quite a few lines of duplicated code.
Diffstat (limited to 'etc/rc.d/pfsync')
-rw-r--r-- | etc/rc.d/pfsync | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/etc/rc.d/pfsync b/etc/rc.d/pfsync index 8d49042..e7a0664 100644 --- a/etc/rc.d/pfsync +++ b/etc/rc.d/pfsync @@ -14,26 +14,23 @@ rcvar=`set_rcvar` start_precmd="pfsync_prestart" start_cmd="pfsync_start" stop_cmd="pfsync_stop" +required_modules="pf" pfsync_prestart() { + # XXX Currently pfsync cannot be a module as it must register + # a network protocol in a static kernel table. + if ! kldstat -q -m pfsync; then + warn "pfsync(4) must be statically compiled in the kernel." + return 1 + fi + case "$pfsync_syncdev" in '') warn "pfsync_syncdev is not set." return 1 ;; esac - - # load pf kernel module if needed - if ! kldstat -q -m pf ; then - if kldload pf ; then - info "pf module loaded." - else - warn "pf module failed to load." - return 1 - fi - fi - return 0 } |