Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Unix daemon conventions

Reply
Thread Tools

Unix daemon conventions

 
 
Robert K.
Guest
Posts: n/a
 
      02-20-2004
There might be better grouop, however I just finished writing a ruby
daemon script. The script, if called with uid==0, walks through all
useres homes. It tries to open a file each user and work according to
it's content. Rather like fetchmail.
It works.
Now what's wrong:

I reduced the search on Uids 0 and >=500. Is this good/OK ?
I do a test on the existence of a directory -- must be good.
For UID==0 I work the same as a normal user. I look for a ".file" in
root's home. Shall I better loock at /etc/file, or even both?
 
Reply With Quote
 
 
 
 
Mark Hubbart
Guest
Posts: n/a
 
      02-20-2004
Hi,

On Feb 20, 2004, at 9:34 AM, Robert K. wrote:

> There might be better grouop, however I just finished writing a ruby
> daemon script. The script, if called with uid==0, walks through all
> useres homes. It tries to open a file each user and work according to
> it's content. Rather like fetchmail.
> It works.
> Now what's wrong:
>
> I reduced the search on Uids 0 and >=500. Is this good/OK ?

I'm not exactly sure about other platforms, but under Darwin/MacOSX,
this would be appropriate. Any users that you miss are daemons anyway.
Is it this way on other unices?

> I do a test on the existence of a directory -- must be good.
> For UID==0 I work the same as a normal user. I look for a ".file" in
> root's home. Shall I better loock at /etc/file, or even both?

Hmm... In my experience, "~root/.file" would be a configuration file
specifically for the root user, whereas "/etc/file" (no dot) is a
system-wide file, for all users. It would seem to me that the proper
use for a "/etc/file" would be to load it first, before loading each
user's "~/.file". Configurations from the user's dotfile would
overwrite the ones from the system-wide one, as necessary.

for example, everyone, root included, can have their own .bashrc file,
but if there is a /etc/bashrc, it gets loaded before the dotfile, no
matter which user; root or otherwise.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: PEP 3143: Standard daemon process library (was: Writing awell-behaved daemon) Floris Bruynooghe Python 1 03-24-2009 02:58 PM
Re: PEP 3143: Standard daemon process library (was: Writing awell-behaved daemon) Jean-Paul Calderone Python 0 03-20-2009 01:02 PM
Daemon Win32::Daemon; ph1975@gmail.com Perl Misc 0 09-07-2006 10:58 AM
compile C programs with UNIX system calls (= Unix Programs??) jrefactors@hotmail.com C++ 12 01-10-2005 03:35 AM
running java program as daemon on Unix System Fatih Java 4 04-09-2004 09:40 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57