You are not logged in.
Pages: 1
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
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..
Offline
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
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
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
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
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
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
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
The /etc/rc.d/ folder! I understood now, thanks.
Offline
Pages: 1