linux daemon() Ó÷¨
Ãû³Æ
daemon-ÔËÐÐÓÚºǫ́
¸ÅÒª
#include <unistd.h>
int daemon(int nochdir, int noclose);
ÃèÊö
daemon()º¯Êý£¬Ö÷ÒªÓÃÓÚijЩ³ÌÐòÏ£Íû×Ô¼ºÍÑÀëÖն˵ĿØÖƶøÔËÐÐÓÚºǫ́µÄÇé¿ö¡£
³ý·ÇnochdirΪ·ÇÁãÖµ£¬Èç¹ûnochdirΪ0£¬ÄÇôdaemon»á´Óµ±Ç°Ä¿Â¼£¬¸ü¸Äµ½¸ùĿ¼£¨“/”£©ÏÂÔËÐС£
³ý·ÇnocloseΪ·ÇÁãÖµ£¬Èç¹ûnocloseΪ0£¬ÄÇôdaemon»á½«±ê×¼ÊäÈ룬±ê×¼Êä³ö£¬±ê×¼´íÎóÊä³öÖض¨Ïòµ½/dev/null¡£
·µ»ØÖµ
³É¹¦·µ»Ø0£¬Ê§°Ü·µ»Ø-1¡£
NAME
daemon - run in the background
SYNOPSIS
#include <unistd.h>
int daemon(int nochdir, int noclose);
DESCRIPTION
The daemon() function is for programs wishing to detach themselves
from the controlling terminal and run in the background as system
daemons.
Unless the argument nochdir is non-zero, daemon() changes the current
working directory to the root ("/").
Unless the argument noclose is non-zero, daemon() will redirect stan-
dard input, standard output and standard error to /dev/null.
RETURN VALUE
(This function forks, and if the fork() succeeds, the parent does
_exit(0), so that further errors are seen by the child only.) On
success zero will be returned. If an error occurs, daemon() returns
&nb
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
ÎÒ¾ÍÊÇÒ»¸öСÐÂÊÖ+С²ËÄñ£¬ÕýÔÚ·¢·Üѧϰlinux£¬³õÓÐÐĵÃËì¾ö¶¨¼Ç¼ÏÂÀ´£¬Ò²Ðí¶ÔÓÐЩÈËÀ´ËµÎÒдµÄ¶¼Ì«Ç³ÏÔ£¬µ«ÊǶԳõѧÕßÀ´Ëµ¾ø¶ÔÊÇÓÐÓõģ¬¿ÉÒÔÈÃÄãÉÙ×ߺܶàÍä·£¬¿öÇÒÎÒ»áÓÉdzÈëÉîµÄ£¬ÑØ×ÅÎÒµÄ×ã¼£Ò»Æðѧϰ°É£¬¼ÓÓÍ£¡
±¾À´ÏëÏÈдϵͳ°²×°£¬È»ºó»·¾³ÅäÖ㬠......
linuxÄÚºËinit½ø³Ìº¯ÊýµÄ²¿·Ö´úÂëÈçÏ£º 01 if (execute_command)
02 run_init_process(execute_command);
03
04 run_init_process("/sbin/init");
05 run_init_process("/etc/init");
06 run_init_process("/bin/init");
07 run_init_process("/ ......
ÔÚ¿ØÖÆ̨Ï£¬ÓÃls£¬¾Í»á·¢ÏÖ£¬shell½«²»Í¬ÀàÐ͵ÄÎļþÏîÄ¿ÏÔʾΪ²»Í¬µÄÑÕÉ«¡£Õß¿ÉÒÔÌá¸ßЧÂÊ£¬²»ÓÃls -l±ãÄÜ´ó¸ÅµÄ°Ñ¸÷¸öÎļþµÄÀàÐÍÇé¿öÁ˽âһϡ£
ÄãÓÐûÓÐÏë¹ý¸ü¸ÄÕâ¸ö×ÅÉ«ÅäÖÃÄØ£¿
Æä
ʵ£¬ÔÚ/etcÏÂÓÐÒ»¸öDIR_COLORSµÄÎļþ£¬ÕâÊÇÒ»¸ö×ÅÉ«¿ØÖƵÄÄ£°æ¡£ÏÖ½«Õâ¸öÄ£°æ¿½³öÀ´¡£Èç¹ûÏëÈÃÕâ¸öÅäÖÃÔÚrootÓû§ÏÂÉúЧ£¬±ß¿½µ½
......
SUSE Linux ά»¤±Ê¼Ç Ò»
1. Linuxʱ¼ä¸üÐÂÉèÖÃ
ʱÇøÉ趨:
#Ö÷ÒªÎļþ
/etc/sysconfig/clock
#Óñ±¾©Ê±¼äµÄÕýÈ·ÄÚÈÝÓ¦¸ÃÊÇ
TIMEZONE="Asia/Beijing"
DEFAULT_TIMEZONE="Asia/Beijing"
#ͬʱȷ±£ /etc/localtimeÎļþÊÇ/usr/share/zoneinfo/Asia/BeijingµÄ¿½±´
±£³Ö¸üÐÂ:
ÔÚ/etc/crontabÖмÓÈëÒ» ......