LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-19-2004, 08:18 PM   #1
jax8
Member
 
Registered: Feb 2004
Location: Australia
Distribution: Ubuntu, Fedora 10
Posts: 632

Rep: Reputation: 31
starting a script on boot


Hi

How do you start a script on boot.

I placed the script name in rc.local like this
------------------------------------------------------------------------------------------------


#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

./rc.firewall




------------------------------------------------------------------------------------------------
but it did not load, rc.firewall is in the same directory as rc.local.
 
Old 03-19-2004, 10:38 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
You might have better luck using the full path. I have mine in /etc/sysconfig so the path statement in /etc/rc.d/rc.local looks like this.../etc/sysconfig/firewall

Also, it's important to set the permissions for root to read, write and exec. Also, read and exec for group and others.
Something like chmod 755 /etc/sysconfig/firewall aught to do it.


Well, dag nab it, here are the complete set of notes...

Do this while logged in as Root
Save the firewall script as /etc/sysconfig/firewall.
Important: Set the permissions for root to read, write and exec. Also, read and exec for group and others.
Something like chmod 755 /etc/sysconfig/firewall aught to do it.

Edit the /etc/rc.d/rc.local file with a path to the script. /etc/sysconfig/firewall
Run the command: service iptables stop
Type: source /etc/sysconfig/firewall
Type: iptables-save > /etc/sysconfig/iptables
Run the command: service iptables restart

The following seems to work ok for Debian based systems like Knoppix or Feather:
Save the firewall script as /etc/init.d/firewall.
Important: Set the permissions for root to read, write and exec. Also, read and exec for group and others.
Something like chmod 755 /etc/init.d/firewall aught to do it.
Type: update-rc.d firewall defaults 99
 
  


Reply



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
starting script on startup darklandz Linux - Newbie 4 06-05-2005 02:51 AM
starting the script at boot time hudy_rob Mandriva 4 12-09-2004 10:29 AM
Starting Script Jakeh2k1 Linux - General 1 11-13-2004 02:02 PM
Won't Boot - Starting Printer Service - Starting CUPS jeansond Linux - Newbie 0 10-11-2004 06:39 PM
Starting Script on startup chrisfirestar Linux - General 5 12-02-2003 12:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:55 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
Open Source Consulting | Domain Registration