LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-25-2012, 08:34 PM   #1
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
Question What will happens if i put scripts inside /etc/init.d ?


Hi !

Will they be executed at boot ?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-26-2012, 12:33 AM   #2
kasl33
Member
 
Registered: Oct 2004
Location: USA
Distribution: Ubuntu-Server, Mac OS X, Arch Linux
Posts: 356

Rep: Reputation: 48
Why not give it a shot and find out? Create this file:

init_test
Code:
#!/bin/bash
touch ~/init_file
Put it in /etc/init.d/
 
Old 02-26-2012, 03:22 AM   #3
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by Linux.tar.gz View Post
Hi !

Will they be executed at boot ?
Not unless they are called by another script that's part of the init chain. See /etc/inittab
 
Old 02-26-2012, 05:57 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
The init.d directory (in Slackware, "/etc/init.d" is a symlink to "/etc/rc.d/init.d") has nothing to do with "/etc/inittab".

If you add scripts to init.d they will have to be called with a "start" or "stop" parameter by start- and kill commands which you place in the runlevel directories like "/etc/rc.d/rc3.d" or "/etc/rc.d/rc4.d".
This is all initiated by th SysV rc script "/etc/rc.d/rc.sysvinit".

Eric
 
4 members found this post helpful.
Old 02-26-2012, 08:05 AM   #5
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Original Poster
Rep: Reputation: 100Reputation: 100
Perfect ! Thanks ^^.
 
Old 02-26-2012, 12:44 PM   #6
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by Alien Bob View Post
The init.d directory (in Slackware, "/etc/init.d" is a symlink to "/etc/rc.d/init.d") has nothing to do with "/etc/inittab".

If you add scripts to init.d they will have to be called with a "start" or "stop" parameter by start- and kill commands which you place in the runlevel directories like "/etc/rc.d/rc3.d" or "/etc/rc.d/rc4.d".
This is all initiated by th SysV rc script "/etc/rc.d/rc.sysvinit".

Eric
Which is called by /etc/rc.d/rc.S, /etc/rc.d/rc.K, /etc/rc.d/rc.M, /etc/rc.d/rc.0, and /etc/rc.d/rc.6, all of which are called by the appropriate entries in /etc/inittab.

Plus nothing prevents you from placing a script in /etc/rc.d/init.d and calling it directly from one of the "normal" init scripts.
 
Old 03-06-2012, 07:51 PM   #7
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Original Poster
Rep: Reputation: 100Reputation: 100
Ok.

Thanks.
 
  


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
Where to put startup scripts? susja Linux - Newbie 8 02-05-2012 04:40 AM
[SOLVED] How to monitor init scripts in /etc/init.d/ in rhel 5 me_spearhead Red Hat 2 02-09-2011 10:41 PM
Diffrence /etc/init.d and /etc/init.d/rc?.d scripts veeruhs Linux - Server 3 07-29-2010 04:42 AM
[SOLVED] init scripts, variables in INIT INFO section catkin Linux - General 1 08-18-2009 02:02 PM
put x509 certificate inside a file feedback Linux - Security 0 04-28-2006 04:08 AM

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

All times are GMT -5. The time now is 09:39 PM.

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