LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-20-2005, 07:09 PM   #1
vicious_pucca
LQ Newbie
 
Registered: Aug 2005
Posts: 10

Rep: Reputation: 0
run APF at boot


I am trying to run APF at the boot, but I can't seem to config it right. help please?
 
Old 08-20-2005, 07:59 PM   #2
saman007uk
Member
 
Registered: Dec 2003
Location: ~root
Distribution: Debian
Posts: 364

Rep: Reputation: 33
Give me the command to start/stop it and I will create the init.d script for you.
 
Old 08-20-2005, 10:10 PM   #3
vicious_pucca
LQ Newbie
 
Registered: Aug 2005
Posts: 10

Original Poster
Rep: Reputation: 0
start: /usr/local/sbin/apf -s
stop: /usr/local/sbin/apf -f

thanks in advance.

Last edited by vicious_pucca; 08-20-2005 at 10:11 PM.
 
Old 08-21-2005, 06:13 AM   #4
saman007uk
Member
 
Registered: Dec 2003
Location: ~root
Distribution: Debian
Posts: 364

Rep: Reputation: 33
I haven't got apf, so I haven't tested this but it *should* work. Everything has to be done as root.

Create an executable file file called /etc/init.d/apf, copy and paste this in:
Code:
#!/bin/sh
# /etc/init.d/apf
#
# Written by Saman Ghannadzadeh <saman@meninpc.co.uk>

set -e

DAEMON="/usr/local/sbin/apf -s"
NAME=apf

case "$1" in
  start)
    echo -n "Starting APF: $NAME"
    start-stop-daemon --start --background -m --pidfile /var/run/apf.pid --exec $DAEMON
    echo "."
    ;;
  stop)
    echo -n "Stopping SPF: $NAME"
    start-stop-daemon --stop --pidfile /var/run/apf.pid --oknodo --exec $DAEMON
    echo "."
      ;;
  restart)
    echo -n "Restarting APF: $NAME"
    start-stop-daemon --stop --pidfile /var/run/apf.pid --oknodo --exec $DAEMON
    start-stop-daemon --start --background -m --pidfile /var/run/vsftpd/vsftpd.pid --exec $DAEMON
    echo "."
    ;;
  reload|force-reload)
    echo "Reloading $NAME configuration files"
    start-stop-daemon --stop --pidfile /var/run/apf.pid --signal 1 --exec $DAEMON
    echo "."
    ;;
  *)
    echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload}"
    exit 1
    ;;
esac

exit 0
Then do following (as root):
Code:
 update-rc.d apf defaults

Last edited by saman007uk; 08-21-2005 at 06:15 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
APF how to use FILTERED latino Linux - Security 1 09-05-2005 02:22 AM
apf questions UnforgotteN Linux - Newbie 3 05-29-2005 06:09 PM
APF firewall binumvk Linux - Security 2 10-14-2004 06:12 AM
apf and nfs engnet Linux - Security 1 12-04-2003 01:30 PM
APF Firewall BlackRain Linux - Security 2 06-12-2003 09:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration