LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-30-2009, 05:46 AM   #1
alsharifhoussam
Member
 
Registered: Apr 2005
Distribution: Fedora 14
Posts: 109

Rep: Reputation: 15
execute scripts at startup


Hello, am newbie in Linux with servers

I had some command lines that I want to execute them with the server goes up.
how can I do that?
Thanks
 
Old 06-30-2009, 05:48 AM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
In almost all distros, put whatever you want executed at system boot into

/etc/rc.local
 
Old 06-30-2009, 05:54 AM   #3
alsharifhoussam
Member
 
Registered: Apr 2005
Distribution: Fedora 14
Posts: 109

Original Poster
Rep: Reputation: 15
in what form should I put them? (.sh)
 
Old 06-30-2009, 05:55 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
or you put the commands line by line, or you create a script and put the path to the script in /etc/rc.local
 
Old 06-30-2009, 05:58 AM   #5
alsharifhoussam
Member
 
Registered: Apr 2005
Distribution: Fedora 14
Posts: 109

Original Poster
Rep: Reputation: 15
this is the content of the rc.local
what is the execution bits?



#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0
 
Old 06-30-2009, 06:00 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
chmod +x /etc/rc.local
 
  


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
Mandriva startup scripts (need to add something to startup before X starts) thunderweasel Mandriva 3 01-01-2006 12:55 AM
execute shell-scripts at kde startup supersucker Linux - Newbie 10 10-28-2005 10:47 AM
Execute Shell Scripts on startup dragoroberto Linux - Software 9 02-28-2005 08:46 AM
Startup scripts not bothering to execute... systemparadox Slackware 3 01-26-2005 12:56 PM
cant execute any scripts Phonics3k Linux - Newbie 2 06-19-2002 08:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:47 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