LinuxQuestions.org
Help answer threads with 0 replies.
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,227

Rep: Reputation: 86
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: Bremerton, WA
Distribution: Arch, Debian, Ubuntu, Ubuntu-Server, CentOS, OSX Lion
Posts: 352

Rep: Reputation: 47
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: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,482

Rep: Reputation: 421Reputation: 421Reputation: 421Reputation: 421Reputation: 421
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: 5,235

Rep: Reputation: Disabled
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,227

Original Poster
Rep: Reputation: 86
Perfect ! Thanks ^^.
 
Old 02-26-2012, 12:44 PM   #6
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,482

Rep: Reputation: 421Reputation: 421Reputation: 421Reputation: 421Reputation: 421
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,227

Original Poster
Rep: Reputation: 86
Ok.

Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 11:15 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration