LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-27-2017, 08:44 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 761

Rep: Reputation: Disabled
Adding files to /etc/init.d


Startup scripts can be added to /etc/init.d/.

I see some with a .sh extension, and others with no extension.

Does it matter? If so, why one over the other? If not, which is considered more proper?

Also, update-rc.d allows me to add and remove them to init. Is there a way to display those which have been added, or should I just use ls /etc/rc*.d?

Thanks

PS. Relates to a Raspberry Pi
 
Old 04-27-2017, 08:54 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 & 7
Posts: 3,209

Rep: Reputation: 871Reputation: 871Reputation: 871Reputation: 871Reputation: 871Reputation: 871Reputation: 871
Extensions are a human-readable mnemonic. Code should never depend on the presence or absence of an extension. It makes gzip a pain to use. Use chkconfig --list to show the configuration of files in /etc/init.d/
 
Old 04-27-2017, 09:00 AM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 761

Original Poster
Rep: Reputation: Disabled
Is the best practice not to use them, or to use them, or to use them just when you want to make it more obvious to a human?

Also, chkconfig doesn't exist. I started with Centos which I did use, but with debian, I thought update-rc was the tool.
 
Old 04-27-2017, 09:30 AM   #4
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,046

Rep: Reputation: 1332Reputation: 1332Reputation: 1332Reputation: 1332Reputation: 1332Reputation: 1332Reputation: 1332Reputation: 1332Reputation: 1332Reputation: 1332
Quote:
Originally Posted by NotionCommotion View Post
Is the best practice not to use them, or to use them, or to use them just when you want to make it more obvious to a human?

Also, chkconfig doesn't exist. I started with Centos which I did use, but with debian, I thought update-rc was the tool.
init.d is one of the "special" folders that should only hold one type of file (a script) or a link to that kind of file. Nothing in that folder should require an extension, but I would not obsess over it one way or another.

chkconfig is somewhat specific to the Red Hat family of distributions. Moving between a dozen distributions, I use the tools, but often look for myself. That is easy on a system that uses the traditional tools, but I have not fully adjusted to the systemd world just yet and still need the tools on those.
 
Old 04-27-2017, 09:39 AM   #5
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
what version of debian are you using? if it is an up-to-date version then it will be using systemd rather than sysvinit which maybe a consideration on how to implement things.
 
Old 04-27-2017, 10:00 AM   #6
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 761

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by r3sistance View Post
what version of debian are you using? if it is an up-to-date version then it will be using systemd rather than sysvinit which maybe a consideration on how to implement things.
Raspbian Jessie which is a debian derivative.
 
Old 04-27-2017, 10:45 AM   #7
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,719

Rep: Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034
Not sure where that version sits in the scheme of things. According to distrowatch the latest version (2017-04-10) is using systemd, so you would be looking to run systemctl --list-units.
The previous listed version (2015-02-16) is still sysvinit. Of course if it is anything like Oracle linux, they decided to mix the 2 together (sheesh)
 
  


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
What type of connection is between files in /etc/init.d and /etc/rc.d/init.d? Rodnower Linux - General 2 08-07-2010 03:32 AM
Adding a script to /etc/init.d neoAKiRAz Ubuntu 13 02-03-2008 09:58 AM
Adding service in /etc/init.d ukkaapie SUSE / openSUSE 2 07-09-2007 08:45 AM
adding applications to /etc/init.d/rc.n dragunu Linux - Newbie 3 11-11-2006 11:35 AM
Adding to init script djgblz Linux - Newbie 4 07-28-2005 10:12 AM

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

All times are GMT -5. The time now is 06:09 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration