ÈçºÎÈýø³ÌÔÚLinuxºǫ́ÔËÐÐ
ÔÚLinuxÖУ¬Èç¹ûÒªÈýø³ÌÔÚºǫ́ÔËÐУ¬Ò»°ãÇé¿öÏ£¬ÎÒÃÇÔÚÃüÁîºóÃæ¼ÓÉÏ&¼´¿É£¬Êµ¼ÊÉÏ£¬ÕâÑùÊǽ«ÃüÁî·ÅÈëµ½Ò»¸ö×÷Òµ¶ÓÁÐÖÐÁË£º
[root@localhost /]# ./test.sh &
[1] 17208
È»ºóÎÒÃǾͿÉÒÔÓÃÒÔÏÂÃüÁî½øÐв鿴£º
[root@localhost /]# jobs -l
[1] 17208 Running ./test.sh &
¶ÔÓÚÒѾÔÚǰִ̨ÐеÄÃüÁҲ¿ÉÒÔÖØÐ·ŵ½ºǫִ́ÐÐÊ×ÏȰ´ctrl zÔÝÍ£ÒѾÔËÐеĽø³Ì£¬È»ºóʹÓÃbgÃüÁֹͣµÄ×÷Òµ·Åµ½ºǫ́ÔËÐУº
[root@localhost /]# bg %1
[1] ./test.sh &
[root@localhost /]# jobs -l
[1] 22794 Running ./test.sh &
µ«ÊÇÈçÉÏ·½µ½ºǫִ́ÐеĽø³Ì£¬Æä¸¸½ø³Ì»¹Êǵ±Ç°ÖÕ¶ËshellµÄ½ø³Ì£¬¶øÒ»µ©¸¸½ø³ÌÍ˳ö£¬Ôò»á·¢ËÍhangupÐźŸøËùÓÐ×Ó½ø³Ì£¬×Ó½ø³ÌÊÕµ½hangupÒÔºóÒ²»áÍ˳ö¡£Èç¹ûÎÒÃÇÒªÔÚÍ˳öshellµÄʱºò¼ÌÐøÔËÐнø³Ì£¬ÔòÐèҪʹÓÃnohupºöÂÔhangupÐźţ¬»òÕßsetsid½«½«¸¸½ø³ÌÉèΪinit½ø³Ì(½ø³ÌºÅΪ1)
[root@localhost /]# echo $$
21734
[root@localhost /]# nohup ./test.sh &<br />
[1] 29016
[root@localhost /]# ps -ef | grep test
515 29710 21734 0 11:47 pts/12 00:00:00 /bin/sh ./test.sh
515 29713 21734 0 11:47 pts/12 00:00:00 grep test
[root@localhost /]# setsid ./test.sh &
[1] 409
[root@localhost /]# ps -ef | grep test
515 410 1 0 11:49 ? 00:00:00 /bin/sh ./test.sh
515 413 21734 0 11:49 pts/12 00:00:00 grep test
ÉÏÃæµÄÊÔÑéÑÝʾÁËʹÓÃnohup/setsid¼ÓÉÏ&ʹ½ø³ÌÔÚºǫ́ÔËÐУ¬Í¬Ê±²»Êܵ±Ç°shellÍ˳öµÄÓ°Ïì¡£ÄÇô¶ÔÓÚÒѾÔÚºǫ́ÔËÐеĽø³Ì£¬¸ÃÔõô°ìÄØ£¿¿ÉÒÔʹÓÃdisownÃüÁ
[root@localhost /]# ./test.sh &
[1] 2539
[root@localhost /]# jobs -l
[1] 2539 Running ./test.sh &
[root@localhost /]# disown -h %1
[root@localhost /]# ps -ef | grep test
515 410 1 0 11:49 ? 00:00:00 /bin/sh ./test.sh
515 2542 21734 0 11:52 pts/12 00:00:00 grep test
ÁíÍ⻹ÓÐÒ»ÖÖ·½·¨£¬¼´Ê¹½«½ø³ÌÔÚÒ»¸ösubshellÖÐÖ´ÐУ¬ÆäʵÕâºÍsetsidÒìÇúͬ¹¤¡£·½·¨ºÜ¼òµ¥£¬½«ÃüÁîÓÃÀ¨ºÅ() À¨ÆðÀ´¼´¿É£º
[root@localhost /]# (./test.sh &)
[root@localhost /]# ps -ef | grep test
515 410 1 0 11:49 ? 00:00:00 /bin/sh ./test.sh
515 12483 21734 0 11:59 pts/12 00:00:00 grep test
×¢£º±¾ÎÄÊÔÑé»·¾³ÎªRed Hat Enterpr
Ïà¹ØÎĵµ£º
×îÔç½Ó´¥LinuxÄÚºËÊÇÔÚ´óÈýµÄʱºò£¬ÄÇʱ¡¶²Ù×÷ϵͳ¡·µÄ¿Î³ÌÉè¼Æ¾ÍÊǽøÐÐLinuxÄÚºËÔ´´úÂëµÄ·ÖÎöÓë½ø³Ìµ÷¶ÈµÄ¸Ä½ø¡£ÌâÄ¿ÊÇ´óµÄÓеãÏÅÈË£¬ÌØ
±ðÊǶÔÄÇʱһ¸öÉæ×ãδÉîµÄÄêÇáÈË¿´À´¡£²»¹ýÄÇʱ×öµÄÊÂÇéºÜ¼òµ¥£¬ÈÏÈÏÕæÕæµÄ¿´ÁË¡¶LinuxÄÚºËÔ´´úÂëÇé¾°·ÖÎö¡·µÄǰÑÔ²¿·Ö£¨Ö÷Òª½²µÄAT&T»ã
±àÓïÑÔ£¬ÄÚºËÖÐÒ»Ð©ÌØÊâµÄ±à³Ì¹æÔò£©£¬Ó ......
°²×°£¬Éý¼¶ºÍÐ¶ÔØÓ¦ÓÃÈí¼þÊÇÓ°ÏìÓû§¶Ô²Ù×÷ϵͳÆÀ¼ÛµÄ¾ö¶¨ÐÔÒòËØÖ®Ò»¡£¶ÔÓÚÈÕ½¥Á÷ÐÐµÄ GNU/Linux ²Ù×÷ϵͳ£¬ÓµÓмò½àÇ¿´óµÄÈí¼þ°ü¹ÜÀí»úÖÆ¹¦²»¿Éû¡£±¾ÎÄ´Ó»ù±¾µÄ rpm/dpkg ÃüÁîÐгö·¢£¬ÒÔ RHEL ºÍ Ubuntu
ΪÀý£¬½éÉܵäÐÍ Linux ϵͳÖÐÓ¦ÓÃÈí¼þµÄ¹ÜÀíºÍʹÓá£
RPM/DPKG Á½´óÕóÓª¼ò½é
ÔÚ GNU/Linux( ÒÔϼò³Æ Linux) ²Ù× ......
¸´ÖÆÒÔÏÂÄÚÈÝ£¬±£´æÎª py ºó׺µÄÎļþ£¬¿½±´µ½wallpaperÎļþ¼Ð£¬½øÈëÎļþ¼Ð£¬ÒÔpythonÔËÐУ¬Ñ¡È¡xmlΪ±ÚÖ½
#!/usr/bin/env python2.6
# -*- coding: utf-8 -*-
# Ubuntu 9.10 dynamic wallpaper maker_Can be used in all the distributions of linux
#
# Auto generate a configuration file which you can use ......
1. Workqueue
WorkqueueµÄÃû×־ͺÍËûµÄ¹¦ÄÜÒ»Ñù£ºÐèÒª´¦ÀíµÄ¹¤×÷ÁбíºÍ¹¤×÷µÄÌí¼Óɾ³ý£¨Ã²ËÆÃ»Óп´µ½ÈçºÎɾ³ýµÄ£©¡¢ÒÔ¼°¹¤×÷µÄµ÷¶ÈÖ´ÐС£
ÐèÒª´¦ÀíµÄ¹¤×÷Áбíͨ³£¶¼Î¬»¤ÔÚÄں˶ÔÏóworkqueue_structÀïÃæ¡£ÏµÍ³ÀïÃæ¿ÉÒÔÓжà¸öworkqueue_struct¡£ ......
Ŀ¼½á¹¹Îª£º
inc/hello.h
src/hello.c
main/main.c
Makefile
ÎļþÄÚÈÝΪ£º
hello.h:
void hello(char name[]);
hello.c:
#include <stdio.h>
void hello(char name[])
{
printf("Hello %s!\n", name);
}
main.c:
#include <stdio.h>
#include "hello.h"
// The second hello.h should ......