Linux Daemon Writing HOWTO
This document shows how to write a daemon in Linux using GCC. Knowledge of Linux and a familiarity with C are necessary to use this document. This HOWTO is Copyright by Devin Watson, under the terms of the BSD License.
1. Introduction: What is a Daemon?
2. Getting Started
3. Planning Your Daemon
3.1 What Is It Going To Do?
3.2 How Much Interaction?
4. Basic Daemon Structure
4.1 Forking The Parent Process
4.2 Changing The File Mode Mask (Umask)
4.3 Opening Logs For Writing
4.4 Creating a Unique Session ID (SID)
4.5 Changing The Working Directory
4.6 Closing Standard File Descriptors
5. Writing the Daemon Code
5.1 Initialization
5.2 The Big Loop
6. Putting It All Together
6.1 Complete Sample
1. Introduction: What is a Daemon?
A daemon (or service) is a background process that is designed to run autonomously,with little or not user intervention. The Apache web server http daemon (httpd) is one such example of a daemon. It waits in the background listening on specific ports, and serves up pages or processes scripts, based on the type of request.
Creating a daemon in Linux uses a specific set of rules in a given order. Knowing how they work will help you understand how daemons operate in userland Linux, but can operate with calls to the kernel also. In fact, a few daemons interface with kernel modules that work with hardware devices, such as external controller boards, printers,and PDAs. They are one of the fundamental building blocks in Linux that give it incredible flexibility and power.
Throughout this HOWTO, a very simple daemon will be built in C. As we go along, more code will be added, showing the proper order of execution required to get a daemon up and running.
2. Getting Started
First off, you'll need the following packages installed on your Linux machine to develop daemons, specifically:
GCC 3.2.2 or higher
Linux Development headers and libraries
If your system does not already have these installed (not likely, but che
相关文档:
转自:http://www.linuxdiyf.com/bbs/viewthread.php?tid=106169
Linux下建议使用vsftp,安全简单实用
vsftp即Very Security FTP,顾名思义,非常安全的FTP服务器。
目录
1 vsFTP服务器的安装
1.1 匿名服务器的连接(独立的服务器)
1.2 开启匿名FTP服务器上传权限
1.3 开启匿名服务器下传的权限
1.4 ......
Unix Toolbox
This document is a collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users. This is a practical guide with concise explanations, however the reader is supposed to know what s/he is doing.
Unix Toolbox revision 14.2
The latest version of this ......
由于我的机器偶尔开发用,所以库比较全。
所以如果您安装的时候,缺啥补啥吧~~
careone 打deb包~~
下载页面:http://forum.ubuntu.org.cn/viewtopic.php?f=137&t=217474
下载地址:http://forum.ubuntu.org.cn/download/file.php?id=73080 ......
下载
飞信机器人Fetion ROBOT
地址:http://www.it-adv.net/index.php?action=downloads
安装
可以参考网页上的标准方法,有详细步骤,或者也可以看一下我的步骤,http://blog.csdn.net/newman0708/archive/2009/02/15/3891871.aspx
命令行用法
LD_LIBRARY_PATH=/home/newman0708/fetion_install/ /home/newman0708/f ......
Linux Find 命令精通指南
作者:Sheryl Calish
简单介绍这一无处不在的命令的强大的方面以及混乱的方面。
2008 年 7 月发布
Linux find 命令是所有 Linux 命令中最有用的一个,同时也是最混乱的一个。它很难,因为它的语法与其他 Linux 命令的标准语法不同。但是,它很强大,因为它允许您按文件名、文件类型、用户甚至 ......