Discuss Daemon fun in the BSD Help forum on Dev Shed. Daemon fun BSD Help forum discussing all BSD based operating systems including FreeBSD, OpenBSD, NetBSD, and more. BSD refers to the distribution of UNIX originally developed by the University of California at Berkeley.
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month! Download and Activate to enter!
Intel® Graphics Performance Analyzers is a powerful tool suite for analyzing and optimizing your games, media, and graphics-intensive applications. Used by some of the best developers on the planet, Intel GPA lets you maximize your app’s performance.
Posts: 104
Time spent in forums: 1 Day 5 h 47 m 55 sec
Reputation Power: 9
Daemon fun
Ok, so I've been playing aroud with BSD for a little bit, and would like to start modifying some stuff so it'll run on an embedded device.
Can anyone point me to a good resource to get me going on how to strip down a daemon so its as lean as possible. I know that's kinda vague, but I'm kinda new
Location: Woodland Hills, Los Angeles County, California, USA
Posts: 8,978
Time spent in forums: 1 Month 2 Weeks 6 Days 22 h 14 m 39 sec
Reputation Power: 3561
Read the pages for:
man 3 daemon
The following code prints "BOO!" every 60 seconds to your terminal.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(void) {
daemon(0, 1);
while (1) {
printf("BOO!\n");
sleep(60);
}
return 0;
}
__________________ Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne Diary of a first time dog owner <-- my cousin's blog
Location: Woodland Hills, Los Angeles County, California, USA
Posts: 8,978
Time spent in forums: 1 Month 2 Weeks 6 Days 22 h 14 m 39 sec
Reputation Power: 3561
Quote:
Originally Posted by stevengs
Hi Scorpions,
can you elaborate on that a bit please? Who's computers and what types of daemons do you mean?
Thanks
-STeven
Try writing your own daemon on a computer that is owned by an ISP or a college network. It doesn't really matter what the daemon does, the sysadmins will kill the daemon first and ask questions later. Most good sysadmins that I know hate seeing any long running processes that they don't know anything about. Heck, I would probably do that myself, if I see a mysterious process that has been running for a few days on my computer. Wouldn't you?
The solution to the original poster would be: If you're going to run a long running daemon on someone else's computer, let the sysadmins know in advance .