Unix daemon conventions

R

Robert K.

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?
 
M

Mark Hubbart

Hi,

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top