🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.dev.c-programming
Article #1

Creating Daemons: Best Practice?

#1
From: Herr Fieldmarshall
Date: Tue, 21 Sep 2004 15:00
27 lines
2052 bytes
Hello,

I've created a program that runs as a daemon, but my question now is, what 
is the best practice concerning distributing and installing it.

The executable needs access to some config file, and some other data files. 
I assume it's best practice to place the executable in /usr/local/bin and 
all the rest in /usr/local/etc. My question now is, how can I assure that 
the executable will always find the config file? (I don't like hard-coding 
../etc/configfile.conf).

I've also read that it is for security reasons best to use chroot to run the 
deamon, but how do I do this in such a way that my data and config files 
remain accessible?

My last point is how do I get the daemon neatly installed in init.d ? Is 
there some script for it?



Briefly said, my question is: I've created a daemon application, but what 
now?


Greetz,

Arnout 
Technical Details
Message-ID: <cipfmi$9nm$1@snic.vub.ac.be>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!syros.belnet.be!ikaria.belnet.be!news.belnet.be!snic.vub.ac.be!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 1103af,b8ad6e866a257b4,start
X-Google-Thread: fc9ab,b8ad6e866a257b4,start
X-Google-Thread: faa64,b8ad6e866a257b4,start
X-Google-Thread: 100a19,b8ad6e866a257b4,start
X-Google-Attributes: gid1103af,gidfc9ab,gidfaa64,gid100a19,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!syros.belnet.be!ikaria.belnet.be!news.belnet.be!snic.vub.ac.be!not-for-mail
From: "Herr Fieldmarshall" <xjs678qr@hotmail.com>
Newsgroups: linux.dev.c-programming,comp.os.linux.misc,alt.comp.linux,alt.os.linux,be.comp.os.linux
Subject: Creating Daemons: Best Practice?
Date: Tue, 21 Sep 2004 17:00:34 +0200
Organization: VUB/ULB Computing Centre
Lines: 29
Message-ID: <cipfmi$9nm$1@snic.vub.ac.be>
NNTP-Posting-Host: etro1.vub.ac.be
X-Trace: snic.vub.ac.be 1095778834 9974 134.184.2.1 (21 Sep 2004 15:00:34 GMT)
X-Complaints-To: usenet@snic.vub.ac.be
NNTP-Posting-Date: 21 Sep 2004 15:00:34 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original