AFP548 Changing the world one server at a time.

cron / ipfw Scripts Fail :(

Home › Forums › OS X Server and Client Discussion › Questions and Answers › cron / ipfw Scripts Fail :(

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #381159
    l008com
    Participant

    My server is running 10.5. I use some various scripts to automatically add firewall rules. All the rules get added to ruleset 17.
    So on the flip side, every night, I had a launchd that would delete set 17, resetting all of these temporary firewall rules. This worked great for over a year.

    Then after a weird crash, launchd started acting weird. My server is offsite, so I just took the easy solution and replaced all of my launchdeamons with crons. I have lots of scripts that run at various times, doing things like updating site content, creating backups, and so on. So they all run, but I can’t get the firewall to reset.

    So the way the old launchd was setup, was that I had my own bash script wrapper which contained the following command only:
    ipfw delete set 17;

    But for some reason, with CRON (the cron is owned by root), my script wouldn’t actually delete the ruleset.
    Then I changed the cron so it was actually running the command directly “ipfw delete set 17”, but it still won’t work.
    I also added a ‘touch’ command after the delete set command, so I can clearly see that this cron is running every night at the proper time. But for some reason, it’s doing nothing.

    This really is causing some problems on my server, any ideas what’s going on?

    #381171
    l008com
    Participant

    *ping*

    Any ideas, anyone?

    #381190
    l008com
    Participant

    Solution was to use the full path to ipfw in the shell script, /sbin/ipfw
    Now everything runs great, and my firewall is reset every day right when it should be.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.