SuperMike
January 15th, 2006, 08:20 PM
I've had a couple people tell me that in *nix, "everything is a file". However, the way that Linux (and whatever *nix) does daemons does not compute along these same lines. For instance, here's a fantasy:
* Daemons usually have 6 things you usually want to know or do with them:
1. Is it loaded right now in my current run level?
2. Does it usually load in my current run level?
3. Does it usually load in a particular run level?
4. What is the description of the daemon?
5. Can I load, unload, or bounce it now?
6. How can I create my own daemon and execute it at a certain run level?
* For each of these things, it seems these could be easily translated into the file metaphor:
1. Is it loaded right now in my current run level?
ls /dmon/current
-or-
ls /dmon/current | grep -i "<my daemon I'm interested in>"
2. Does it usually load in my current run level?
ls /dmon/load/current
3. Does it usually load in a particular run level?
ls /dmon/load/rl?
(where ? is a # 1-5)
4. What is the description of the daemon?
cat /dmon/load/rl?/desc/*
5. Can I load/reload, unload, or bounce it now?
dload /dmon/load/rl?/<daemon>
dunload /dmon/load/rl?/<daemon>
dbounce /dmon/load/rl?/<daemon>
6. How can I create my own daemon and execute it at a certain run level?
a. Edit a Bash script to load your daemon. No special code needs to be inside. Give the script a name without a file extension on the end.
b. chmod a+x <script file>
c. Copy it to /dmon/load/rl?
d. Edit a small description file by the same name as the script file. It should be in the format, and in human-readable form without <>:
<daemon short name> <daemon long name>
<tab><short description>
<tab><author(s)>
<tab><version>
<tab><special rules, comments, etc.>
<tab><more special rules, comments, etc.>
e. Copy this description file to /dmon/load/rl?/desc/<file name>
f. Reboot or telinit to a run level and watch your daemon loaded automatically.
P.S. And you probably want to know if the daemon loaded with errors and which daemons loaded and did not load with errors.
This is all speculation. Perhaps one day someone high up in the Linux food chain will say, "Hey, that's a great idea!" and make it happen.
* Daemons usually have 6 things you usually want to know or do with them:
1. Is it loaded right now in my current run level?
2. Does it usually load in my current run level?
3. Does it usually load in a particular run level?
4. What is the description of the daemon?
5. Can I load, unload, or bounce it now?
6. How can I create my own daemon and execute it at a certain run level?
* For each of these things, it seems these could be easily translated into the file metaphor:
1. Is it loaded right now in my current run level?
ls /dmon/current
-or-
ls /dmon/current | grep -i "<my daemon I'm interested in>"
2. Does it usually load in my current run level?
ls /dmon/load/current
3. Does it usually load in a particular run level?
ls /dmon/load/rl?
(where ? is a # 1-5)
4. What is the description of the daemon?
cat /dmon/load/rl?/desc/*
5. Can I load/reload, unload, or bounce it now?
dload /dmon/load/rl?/<daemon>
dunload /dmon/load/rl?/<daemon>
dbounce /dmon/load/rl?/<daemon>
6. How can I create my own daemon and execute it at a certain run level?
a. Edit a Bash script to load your daemon. No special code needs to be inside. Give the script a name without a file extension on the end.
b. chmod a+x <script file>
c. Copy it to /dmon/load/rl?
d. Edit a small description file by the same name as the script file. It should be in the format, and in human-readable form without <>:
<daemon short name> <daemon long name>
<tab><short description>
<tab><author(s)>
<tab><version>
<tab><special rules, comments, etc.>
<tab><more special rules, comments, etc.>
e. Copy this description file to /dmon/load/rl?/desc/<file name>
f. Reboot or telinit to a run level and watch your daemon loaded automatically.
P.S. And you probably want to know if the daemon loaded with errors and which daemons loaded and did not load with errors.
This is all speculation. Perhaps one day someone high up in the Linux food chain will say, "Hey, that's a great idea!" and make it happen.