You are not logged in.

#1 2008-01-10 00:11:51

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

init script startup

How does the init script system on Arch work? Coming from Ubuntu, if I wanted to add a startup script I just added it to /etc/init.d and ran update-init.d to create the necessary symlinks.

I've looked on the wiki and searched the forum, but not found much on it. If I wanted to add a startup script, what's the best approach? It seems like the recommended way is to add the script to rc.d and to add a line to execute it in rc.local.

Offline

#2 2008-01-10 00:19:28

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: init script startup

create your script in /etc/rc.d/ (look at the scripts there how there are made), and add it to the daemons array in /etc/rc.conf

Offline

#3 2008-01-10 04:54:47

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

Re: init script startup

It's not a daemon, though, just a script that does a bit of stuff for me. Is the daemons array in rc.conf the only script that runs anything from rc.d?

Offline

#4 2008-01-10 10:12:43

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: init script startup

Sorry I did misunderstood you than. In that case you should put in in /usr/local/bin (for system wide scripts) and call it from /etc/rc.local

Offline

#5 2008-01-10 11:37:24

PJ
Member
From: Sweden
Registered: 2005-10-11
Posts: 602

Re: init script startup

It doesn't matter if it's a daemon or not, look for example at the /etc/rc.d/alsa script. It sure isn't a daemon but it's still in /etc/rc.d/ and it's still called from the daemons array in rc.conf . No, there are no symlinks, which simply means there isn't a program neither.

Offline

#6 2008-01-10 12:03:34

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: init script startup

As said above though, if it's just some random stuff on boot, and rc.d daemon isnt really needed, rc.local is fine.

Offline

#7 2008-01-11 08:19:34

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

Re: init script startup

OK, thanks for advice guys.

Offline

Board footer

Powered by FluxBB