linux ¶¯Ì¬¼ÓÔØ ¶¯Ì¬Á´½Ó¿â
¶¯Ì¬¿âµÄÏÔʽµ÷ÓÃ
ÏÔʽµ÷Óõĺ¬ÒåÊÇ´úÂë³öÏÖ¿âÎļþÃû£¬Óû§ÐèÒª×Ô¼ºÈ¥
´ò¿ªºÍ¹ÜÀí¿âÎļþ¡£ÆäÒªµãΪ:
¢Å°Ñdlfcn.hϵͳͷÎļþ°üº¬½øÀ´
¢ÆÓÃdlopenº¯Êý´ò¿ª¿âÎļþ£¬²¢Ö¸¶¨´ò¿ª·½Ê½
dllopeµÄµÄµÚÒ»¸ö²ÎÊýΪ¹²Ïí¿âµÄÃû³Æ£¬½«»áÔÚÏÂÃæλÖòéÕÒÖ¸¶¨µÄ¹²Ïí¿â¡£
¢Ù»·¾³±äÁ¿LD_LIBRARY_PATHÁгöµÄÓ÷ֺżä¸ôµÄËùÓÐĿ¼¡£
¢ÚÎļþ/etc/ld.so.cacheÖÐÕÒµ½µÄ¿âµÄÁÐ±í£¬ÓÉldconfigÃüÁîˢС£
¢ÛĿ¼usr/lib¡£
¢ÜĿ¼/lib¡£
¢Ýµ±Ç°Ä¿Â¼¡£
µÚ¶þ¸ö²ÎÊýΪ´ò¿ª¹²Ïí¿âµÄ·½Ê½¡£ÓÐÁ½¸öÈ¡Öµ
¢ÙRTLD_NOW£º½«¹²Ïí¿âÖеÄËùÓк¯Êý¼ÓÔص½ÄÚ´æ
¢ÚRTLD_LAZY£º»áÍƺó¹²Ïí¿âÖеĺ¯ÊýµÄ¼ÓÔزÙ×÷£¬Ö±µ½µ÷ÓÃdlsym()ʱ·½¼ÓÔØijº¯Êý
¢ÇÓÃdlerror()º¯Êý²âÊÔÊÇ·ñ´ò¿ª³É¹¦£¬²¢½øÐдíÎó´¦Àí;
¢ÈÓÃdlsym»ñµÃº¯ÊýµØÖ·,´æ·ÅÔÚÒ»¸öº¯ÊýÖ¸ÕëÖÐ
¢ÉÓûñµÃµÄº¯ÊýÖ¸Õë½øÐк¯Êýµ÷Óá£
¢Ê³ÌÐò½áÊøʱÓÃdlclose¹Ø±Õ´ò¿ªµÄ¶¯Ì¬¿â£¬·ÀÖ¹×ÊԴй¶¡£
¢ËÓÃldconfig¹¤¾ß°Ñ¶¯Ì¬¿âµÄ·¾¶¼Óµ½ÏµÍ³¿âÁбíÖÐ
1¡¢±àд²âÊÔÎļþ
//main.c ²âÊÔ¶¯Ì¬¿âÏÔʽµ÷ÓõijÌÐò
#include<dlfcn.h> //ÓÃÓÚ¶¯Ì¬¿â¹ÜÀíµÄϵͳͷÎļþ
#include "myalib.h" //Òª°Ñº¯ÊýµÄÍ·Îļþ°üº¬½øÀ´£¬·ñÔò±àÒëʱ»á±¨´í
int main(int argc,char* argv[])
{
//ÉùÃ÷¶ÔÓ¦µÄº¯ÊýµÄº¯ÊýÖ¸Õë
void (*pTest)();
//¼ÓÔض¯Ì¬¿â
void *pdlHandle = dlopen("libtest.so", RTLD_LAZY);
//´íÎó´¦Àí
if(pdlHandle == NULL ) {
printf("Failed load library\n");
return -1;
}
char* pszErr = dlerror();
if(pszErr != NULL)
{
printf("%s\n", pszErr);
return -1;
&nbs
Ïà¹ØÎĵµ£º
vi adduser.sh È»ºó°ÑÈçÏ´úÂëÌùÈë¡£±£´æµ½CVSROOTĿ¼Ï¡£
#!/bin/bash
#add cvs users
while [ -n "$(echo $1|grep '^_')"];
do
case $1 in
-u) param=$2
echo -e "$param:\c" >>passwd
shift ;;
-p) param=$2
echo -e `./passwdgen.pl $param`":cvsroot" >> passwd;;
*)
exit 1
esac
shift
......
ÔÚLinuxÏÂJdkµÄ°²×°ºÍJava»·¾³±äÁ¿µÄÉèÖÃ
ÔÚLinuxÏÂJdkµÄ°²×°ºÍJava»·¾³±äÁ¿µÄÉèÖÃ
1¡¢µ½www.sun.comÏÂÔØ×îа汾µÄj2sdk for linux
2¡¢°²×°jdk1.4.2 for linux,ÒÔÏÂÊÇÔÚRedhat Linux 9ÏÂΪÀý£º
ÒÔrootÉí·ÝµÇ¼
(1)´ò¿ªÒ»¸öÖÕ¶Ë
(2)ÊäÈëÃüÁîls -l ²é¿´°²×°ÎļþµÄȨÏÞ
......
DHCPÊÇDynamic Host Configuration ProtocolµÄÓ¢ÎÄËõд£¬·Òë¹ýÀ´¾ÍÊǶ¯Ì¬Ö÷»úÅäÖÃͨѶÐÒé¡£ËüµÄ¹¦ÄܾÍÊÇΪÍøÂçÁ¬½Ó¶¯Ì¬·ÖÅäIPµØÖ·£¬ËüÔÊÐí¿Í»§¶Ë¼ÆËã»úÏòÍøÂç·þÎñÆ÷×Ô¶¯»ñÈ¡ÍøÂçÉèÖá£DHCP·þÎñÆ÷ʹµÃÍøÂç¹ÜÀíÔ±ÔÚ¹ÜÀíÍøÂçÖÐÔÚÍøÂçÖÐÔö¼Ó¡¢É¾³ýÍøÂç½Úµã»òÕßÖØÐÂÅäÖÃÍøÂçʱ£¬¹¤×÷±äµÃ·Ç³£¼òµ¥£¬ÎÞÐëÊÖ¹¤µÄ·ÖÅäIPµØÖ ......
1. Linux ½Å±¾±àд»ù´¡
1.1 Óï·¨»ù±¾½éÉÜ
1.1.1 ¿ªÍ·
³ÌÐò±ØÐëÒÔÏÂÃæµÄÐпªÊ¼£¨±ØÐë·½ÔÚÎļþµÄµÚÒ»ÐУ©£º
#!/bin/sh
¡¡¡¡·ûºÅ#!ÓÃÀ´¸æËßϵͳËüºóÃæµÄ²ÎÊýÊÇÓÃÀ´Ö´ÐиÃÎļþµÄ³ÌÐò¡£ÔÚÕâ ¸öÀý×ÓÖÐÎÒÃÇʹÓÃ/bin/shÀ´Ö´ÐгÌÐò¡£
¡¡¡¡µ±±à¼ºÃ½Å±¾Ê±£¬Èç¹ûÒªÖ´Ðиýű¾£¬»¹±ØÐëʹÆä¿ÉÖ´ÐС£
¡¡¡¡ÒªÊ¹½Å±¾¿ÉÖ´ÐУº
±àÒ ......
umask()º¯Êý£º´Ëº¯ÊýµÄÖ÷Òª×÷ÓÃÊÇÔÚ´´½¨ÎļþʱÉèÖûòÕßÆÁ±ÎµôÎļþµÄһЩȨÏÞ¡£Ò»°ãÓëopen()º¯ÊýÅäºÏʹÓá£openº¯ÊýÔÐÍ£º
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
int open( const char * pathname, int flags);
int open( const char ......