Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
151 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,74 @@ | |||
<?xml version='1.0'?> | |||
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> | |||
<!-- | |||
Hanno 'Rince' Wagner 03 2007 | |||
Service manifest for fail2ban | |||
E-Mail: wagner@rince.de | |||
--> | |||
|
|||
<service_bundle type='manifest' name='fail2ban:fail2ban'> | |||
|
|||
<service | |||
name='network/fail2ban' | |||
type='service' | |||
version='1'> | |||
<create_default_instance enabled='false' /> | |||
<single_instance /> | |||
|
|||
<dependency name='fs' | |||
grouping='require_all' | |||
restart_on='none' | |||
type='service'> | |||
<service_fmri value='svc:/system/filesystem/local' /> | |||
</dependency> | |||
|
|||
<dependency name='net' | |||
grouping='require_all' | |||
restart_on='none' | |||
type='service'> | |||
<service_fmri value='svc:/network/loopback' /> | |||
</dependency> | |||
|
|||
|
|||
<exec_method | |||
type='method' | |||
name='start' | |||
exec='/lib/svc/method/svc-fail2ban start' | |||
timeout_seconds='-1'> | |||
<method_context> | |||
<method_credential user='root' group='root' /> | |||
</method_context> | |||
</exec_method> | |||
|
|||
<exec_method | |||
type='method' | |||
name='stop' | |||
exec='/lib/svc/method/svc-fail2ban stop' | |||
timeout_seconds='-1'> | |||
</exec_method> | |||
|
|||
<exec_method | |||
type='method' | |||
name='reload' | |||
exec='/lib/svc/method/svc-fail2ban reload' | |||
timeout_seconds='-1'> | |||
</exec_method> | |||
|
|||
<exec_method | |||
type='method' | |||
name='refresh' | |||
exec='/lib/svc/method/svc-fail2ban refresh' | |||
timeout_seconds='-1'> | |||
</exec_method> | |||
|
|||
|
|||
<exec_method | |||
type='method' | |||
name='restart' | |||
exec='/lib/svc/method/svc-fail2ban restart' | |||
timeout_seconds='-1'> | |||
</exec_method> | |||
|
|||
</service> | |||
|
|||
</service_bundle> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,47 @@ | |||
#!/usr/bin/bash -e | |||
# | |||
# fail2ban This init.d script is used to start fail2ban. | |||
# (C) by Hanno Wagner <wagner@rince.de>, License is GPL | |||
|
|||
#set -x | |||
|
|||
. /lib/svc/share/smf_include.sh | |||
|
|||
set -e | |||
|
|||
|
|||
F2B_CONF="/etc/fail2ban/fail2ban.conf" | |||
if [ -n "$2" ] && [ -f "$F2B_CONF" ]; then | |||
F2B_CONF="$2" | |||
fi | |||
|
|||
ENV="/usr/bin/env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin:/opt/sfw/bin:/usr/sfw/bin" | |||
|
|||
case $1 in | |||
start) | |||
[ -f /etc/fail2ban.conf ] || touch /etc/fail2ban.conf | |||
echo "Starting fail2ban-server with $F2B_CONF" | |||
eval $ENV /usr/local/bin/fail2ban-client start & | |||
;; | |||
stop) | |||
echo "Stopping fail2ban-server with $F2B_CONF" | |||
eval $ENV /usr/local/bin/fail2ban-client stop & | |||
;; | |||
reload | refresh ) | |||
echo "Reloading fail2ban-server with $F2B_CONF" | |||
eval $ENV /usr/local/bin/fail2ban-client reload & | |||
;; | |||
restart | force-reload) | |||
echo "Forcing reload of fail2ban-server with $F2B_CONF" | |||
eval $ENV /usr/local/bin/fail2ban-client stop & | |||
sleep 2 | |||
eval $ENV /usr/local/bin/fail2ban-client start & | |||
;; | |||
status) | |||
/usr/local/bin/fail2ban-client status & | |||
;; | |||
*) | |||
echo "Usage: /lib/svc/method/svc-fail2ban start|stop|status|refresh|restart|reload|force-reload" >&2 | |||
exit 2 | |||
;; | |||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters