You are not logged in.

#1 2008-12-16 19:59:11

atomopawn
Member
Registered: 2007-08-26
Posts: 71

rc.d versus init.d

Why does Arch place startup scripts into /etc/rc.d instead of /etc/init.d? 

I'm not complaining -- I really like the Arch init system.  And I realize that it is very different from the init scripts used by other distributions.  But is there a reason that the directory name has to be different?  While the FHS is silent about where init scripts have to go, it seems to me that almost every other distro puts the initialization stuff in /etc/init.d/

When I come home from work (we run Fedora in the lab and my desktop at work is openSuSE), I find myself typing /etc/init.d/blah instead of /etc/rc.d/blah all the time.  For awhile I just symlinked /etc/init.d to /etc/rc.d on my Arch box, but that seemed kind of hacky.  Is there any reason not to do this?

Offline

#2 2008-12-16 20:00:52

string
Member
Registered: 2008-11-03
Posts: 286

Re: rc.d versus init.d

Might want to read up on System-V vs BSD style INIT

Offline

#3 2008-12-16 20:02:35

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: rc.d versus init.d


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#4 2008-12-16 22:40:06

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: rc.d versus init.d

atomopawn wrote:

When I come home from work (we run Fedora in the lab and my desktop at work is openSuSE), I find myself typing /etc/init.d/blah instead of /etc/rc.d/blah all the time.  For awhile I just symlinked /etc/init.d to /etc/rc.d on my Arch box, but that seemed kind of hacky.  Is there any reason not to do this?

I always symlink the opposite when I have to maintain boxes that use init.d - I find myself typing /etc/rc.d/ too readily

Offline

#5 2008-12-16 23:27:43

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: rc.d versus init.d

phrakture wrote:
atomopawn wrote:

When I come home from work (we run Fedora in the lab and my desktop at work is openSuSE), I find myself typing /etc/init.d/blah instead of /etc/rc.d/blah all the time.  For awhile I just symlinked /etc/init.d to /etc/rc.d on my Arch box, but that seemed kind of hacky.  Is there any reason not to do this?

I always symlink the opposite when I have to maintain boxes that use init.d - I find myself typing /etc/rc.d/ too readily

Me too... But we have around 160 disparate Fedora-based boxes and symlinking on all of them just for me isn't practical. Gives me the $h!ts sad

(But I like rc.d too much. I refuse to link init.d to rc.d on my Arch machines tongue)

Last edited by fukawi2 (2008-12-16 23:29:13)

Offline

#6 2008-12-17 05:40:48

atomopawn
Member
Registered: 2007-08-26
Posts: 71

Re: rc.d versus init.d

Interesting.  I didn't realize we were using a BSD-style init system.  I'd assumed it was a custom one like Gentoo uses.  I guess it's been too long since FreeBSD was my main platform.....

It does seem a little . . .  dirty . . . to symlink things.  But it sounds like there is no practical reason not to do it, just historical ones.  Unfortunately for me the reverse symlink won't work on my gentoo boxes (they use BOTH rc.d and init.d). 

Thanks for all the input folks.  Reading about BSD-style init has been interesting.  (I personally can't see why anyone would use anything else!)

Offline

#7 2008-12-17 18:18:40

stefan1975
Member
From: 53 6e 65 65 6b
Registered: 2007-04-16
Posts: 195

Re: rc.d versus init.d

well being a RHEL and CentOS sysadmin i constantly find myself typing "service bla start" or "chkconfig bla on" and get really frustrated when that doesnt work, from what I read Ubuntu is starting to understand those typo's and in 8.10 they have added the "service" command. Although i do not use it for my desktop i really love the RHEL way of administering things. I must admit that canonicals 'upstart' as an init replacement also shows a lot of promise, if onyl it were used properly and not in bacwards compatibility mode.

stefan

Last edited by stefan1975 (2008-12-17 18:19:56)


"root# su - bofh"
OS: F10_x64, Arch, Centos5.3, RHEL4.7, RHEL5.3
Desktop Hardware: Dell Precision M65 laptop, core2duo, 2gb, 80gb 7200rpm
Registered linux user #459910 since 1998

Offline

#8 2008-12-17 19:22:42

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: rc.d versus init.d

stefan1975 wrote:

well being a RHEL and CentOS sysadmin i constantly find myself typing "service bla start" or "chkconfig bla on" and get really frustrated when that doesnt work...
stefan

Just add /etc/rc.d/ to your $PATH on your Arch boxes.
..how often this simple solution eludes us... wink

Offline

#9 2008-12-17 21:29:51

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: rc.d versus init.d

Misfit138 wrote:

Just add /etc/rc.d/ to your $PATH on your Arch boxes.
..how often this simple solution eludes us... wink

But there's still no service command...?

I put this in to my global bashrc file when I first moved from being familiar with RHEL / Fedora

service() {
        sudo /etc/rc.d/$1 $2
}

Offline

#10 2008-12-17 21:32:43

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: rc.d versus init.d

Hmm, I am a bit puzzled.
If the 'service' command is used in the context cited above, like

service hal start

just add /etc/rc.d/ to $PATH and do

hal start

or

network restart

etc
?

Offline

#11 2008-12-17 21:35:26

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: rc.d versus init.d

Yes, that will work too... Depending on what order you path is in (ie, sshd is in /usr/sbin/sshd and /etc/rc.d/sshd)

/etc/rc.d would need to be before /usr/sbin which might break things...

They both work - I was just including the `service` part to mimic RH / Fedora verbatim smile

Offline

#12 2008-12-17 21:36:34

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: rc.d versus init.d

fukawi2 wrote:

Yes, that will work too... Depending on what order you path is in (ie, sshd is in /usr/sbin/sshd and /etc/rc.d/sshd)

/etc/rc.d would need to be before /usr/sbin which might break things...

They both work - I was just including the `service` part to mimic RH / Fedora verbatim smile

Ah.
Well, one less word to type. tongue

Offline

#13 2008-12-17 22:00:05

fflarex
Member
Registered: 2007-09-15
Posts: 466

Re: rc.d versus init.d

I add 3 aliases to .bashrc: start, stop, and restart. So I would type something like 'restart mpd'. It requires less typing fukawi2's solution and less hacks than Misfit138's. It's also closer to natural English. I may have gotten this from another archer's bashrc, I don't remember who, but the credit isn't mine.

Last edited by fflarex (2008-12-17 22:00:46)

Offline

#14 2008-12-17 22:11:01

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: rc.d versus init.d

For you Red Hat'ers and you CentOS'ers try this:

function service() { /etc/rc.d/$1 $2 }

in your dot shell rc

nvm. someone already suggested.

Last edited by rson451 (2008-12-17 22:12:31)


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#15 2008-12-18 22:41:02

thisllub
Member
From: Northern NSW Australia
Registered: 2007-12-28
Posts: 231

Re: rc.d versus init.d

fflarex wrote:

I add 3 aliases to .bashrc: start, stop, and restart. So I would type something like 'restart mpd'. It requires less typing fukawi2's solution and less hacks than Misfit138's. It's also closer to natural English. I may have gotten this from another archer's bashrc, I don't remember who, but the credit isn't mine.

I like this.
Thanks, I would never have considered it.

Offline

#16 2011-06-26 10:02:21

Biowaste
Member
From: Denmark
Registered: 2010-06-22
Posts: 14
Website

Re: rc.d versus init.d

fflarex wrote:

I add 3 aliases to .bashrc: start, stop, and restart. So I would type something like 'restart mpd'. It requires less typing fukawi2's solution and less hacks than Misfit138's. It's also closer to natural English. I may have gotten this from another archer's bashrc, I don't remember who, but the credit isn't mine.

I'm not sure how I'm supposed to do this?
alias start=/etc/rc.d/
alias stop=/etc/rc.d/
alias restart=/etc/rc.d/
? If you're supposed to be able to write simply "stop mpd", how do you alias it so it understands that the second word should be inserted between "rc.d/" and " stop", effectively translating it to "/etc/rc.d/mpd stop"?

Offline

#17 2011-06-26 10:28:33

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: rc.d versus init.d

Biowaste wrote:
fflarex wrote:

I add 3 aliases to .bashrc: start, stop, and restart. So I would type something like 'restart mpd'. It requires less typing fukawi2's solution and less hacks than Misfit138's. It's also closer to natural English. I may have gotten this from another archer's bashrc, I don't remember who, but the credit isn't mine.

I'm not sure how I'm supposed to do this?
alias start=/etc/rc.d/
alias stop=/etc/rc.d/
alias restart=/etc/rc.d/
? If you're supposed to be able to write simply "stop mpd", how do you alias it so it understands that the second word should be inserted between "rc.d/" and " stop", effectively translating it to "/etc/rc.d/mpd stop"?

Don't necrobump: https://wiki.archlinux.org/index.php/Fo … Bumping.27

Closed.


ᶘ ᵒᴥᵒᶅ

Offline

Board footer

Powered by FluxBB