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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-27-2017, 08:44 AM
|
#1
|
Member
Registered: Aug 2012
Posts: 789
Rep: 
|
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
|
|
|
04-27-2017, 08:54 AM
|
#2
|
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,331
|
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/
|
|
|
04-27-2017, 09:00 AM
|
#3
|
Member
Registered: Aug 2012
Posts: 789
Original Poster
Rep: 
|
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.
|
|
|
04-27-2017, 09:30 AM
|
#4
|
LQ Guru
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 6,207
|
Quote:
Originally Posted by NotionCommotion
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.
|
|
|
04-27-2017, 09:39 AM
|
#5
|
Senior Member
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375
|
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.
|
|
|
04-27-2017, 10:00 AM
|
#6
|
Member
Registered: Aug 2012
Posts: 789
Original Poster
Rep: 
|
Quote:
Originally Posted by r3sistance
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.
|
|
|
04-27-2017, 10:45 AM
|
#7
|
LQ Guru
Registered: Sep 2009
Location: Perth
Distribution: Arch
Posts: 10,037
|
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)
|
|
|
All times are GMT -5. The time now is 06:36 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|