You are not logged in.

#1 2006-09-09 17:31:02

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Setting daemons arguments.

I'd like starting a program as a daemon in the startup.
I usually alter the /etc/rc.conf file adding in the DEAMONS=() part the program I want, but since it is a space separed list how can I using arguments?

E.g.
amule's daemon starts with 'amuled -f'
freepops's daemon stats with 'freepops -d'
ect...


thanks

Offline

#2 2006-09-09 17:38:01

Ole Erik
Member
Registered: 2006-08-06
Posts: 85

Re: Setting daemons arguments.

Hmm... Do not trust me on this.. But i think that it understands itself how to start it as daemon.. I had to do that with tor and provixy.. smile

Offline

#3 2006-09-09 17:43:22

chrismortimore
Member
From: Edinburgh, UK
Registered: 2006-07-15
Posts: 655

Re: Setting daemons arguments.

It depends on how the init script is written.  Normally, if you can pass arguments to the daemon through the init script, there will be a file in /etc/conf.d/.  Example, in openntpd, /etc/conf.d/openntpd has a variable that lets you pass arguments.


Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 2x160GB Maxtor DiamondMax 10, 2x320GB WD Caviar RE, Nvidia 6600GT 256MB
Laptop: Intel Pentium M, 512MB PC2700, 60GB IBM TravelStar, Nvidia 5200Go 64MB

Offline

#4 2006-09-09 18:52:31

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Setting daemons arguments.

As chrismortimore said, /etc/conf.d is the way to go. The exception would be where a daemon always uses the same arguments, in which case they can be hardcoded into the init script.

If an app doesn't use /etc/conf.d and you think it should, submit a feature request, and optionally, appropriate files.

<edit>
Just checked out amule and freepops - amule doesn't even have an init script, let alone /etc/conf.d support, but freepops has both.

Offline

#5 2006-09-09 21:21:16

noriko
Member
From: In My Mind
Registered: 2006-06-09
Posts: 535
Website

Re: Setting daemons arguments.

simply create a script to run the app / command full with arguments as you need, then drop it in /etc/rc.d you should be set to go...


The.Revolution.Is.Coming - - To fight, To hunger, To Resist!

Offline

#6 2006-09-10 07:55:02

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: Setting daemons arguments.

when you speak of init script you are speaking of /etc/rc.local, am I right?

about /etc/conf.d the setting file inside (like the freepops one) it is automagically read if I start a program from DAEMON=() in rc.conf?

Sorry, I am a little confused.

Offline

#7 2006-09-10 09:08:02

chrismortimore
Member
From: Edinburgh, UK
Registered: 2006-07-15
Posts: 655

Re: Setting daemons arguments.

He means write a script in /etc/rc.d/ for the daemons you want.  You can also just use /etc/rc.local if you can't be bothered writing an init script, I'd do that personally tongue

The setting file in /etc/conf.d is automatically sourced by the init file (the one in /etc/rc.d/), so whether you start it using DAEMON=() in rc.conf, or manually on the shell using "/etc/rc.d/[DAEMON] start", the settings will be used.  Replace [DAEMON] with the one in question wink


Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 2x160GB Maxtor DiamondMax 10, 2x320GB WD Caviar RE, Nvidia 6600GT 256MB
Laptop: Intel Pentium M, 512MB PC2700, 60GB IBM TravelStar, Nvidia 5200Go 64MB

Offline

#8 2006-09-10 10:05:07

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: Setting daemons arguments.

The /etc/rc.d/ folder! I understood now, thanks.

Offline

Board footer

Powered by FluxBB