[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: boot scripts



On Tue, Jul 30, 2002 at 11:17:43AM -0400, R. Bradley Tilley wrote:
> This adds the script nicely, but it fails to start the script with a
> "Unable to start /usr/bin/firewall.sh: Exec format error"

Sounds like you need to put a line like this as the first line of your
script:

  #! /bin/sh

You might also want to put locally written scripts in /usr/local/bin
rather than /usr/bin to guarantee that the packaging system won't
overwrite them.

> The script can be started manually from the command line with
> "firewall.sh start" I should point out that this is just a plain text
> file with iptable rules. It has no code.

iptables rules *are* code - they constitute a shell script. When you're
running it from an interactive shell, the shell guesses that it's a
shell script if it can't execute it any other way, which is why it works
when you run it by hand. To make it work properly when started in other
ways, though, you need the #! line above.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: