【正文】
和退出主循環(huán),當(dāng)系統(tǒng)調(diào)用了 gtk_main()函數(shù)后,由于 gtk_main()函數(shù)可以遞歸調(diào)用,所以需要調(diào)用gtk_main_quit()函數(shù)才能退出 gtk。 從根本上來說,主循環(huán)是由 glib實現(xiàn)的。它包含有基本的空間和一些很復(fù)雜的控件:例如文件選擇控件。采用 C/S模式,在客戶端采用 GTK函數(shù)實現(xiàn)用戶界面的編寫,在服務(wù)器端通過 Linux的系統(tǒng)調(diào)用,來實現(xiàn)本地服務(wù)配置,然后再通過 Sock編程來實現(xiàn)服務(wù)器和客戶端的通信,傳遞配置內(nèi)容和服務(wù)指令。通過該課題的設(shè)計和實現(xiàn),既解決遠(yuǎn)程管理Linux系統(tǒng),又讓自己掌握 了一些 Linux系統(tǒng)編程和 Sock編程能力。 本課題研究的意義 本課題是為了給系統(tǒng)管理員提供一種遠(yuǎn)程管理 Linux中某些主要服務(wù)的工具軟件,完成服務(wù)配置管理和查看一些重要的數(shù)據(jù)。而且 Linux平臺上的服務(wù)軟件也是越來越多了。 本課題為減輕系統(tǒng)管理員的工作量而提供了一些簡單的系統(tǒng)服務(wù)的管理和查看工具。Socket 目 錄 論文總頁數(shù): 33頁 1 引言 ......................................................................................................................... 1 課題背景 .......................................................................................................... 1 國內(nèi)外研究現(xiàn)狀 ............................................................................................... 1 本課題研究的意義 ............................................................................................ 1 本課題的研究方法 ............................................................................................ 1 2 GTK 編程 ................................................................................................................. 1 GTK簡介 .......................................................................................................... 1 常用的 GTK構(gòu)件 ............................................................................................... 3 3 LINUX系統(tǒng)調(diào)用 ...................................................................................................... 6 LINUX 系統(tǒng)文件 ................................................................................................. 6 如何從文件中讀取數(shù)據(jù) ..................................................................................... 6 進(jìn)程和線程的使用 ............................................................................................ 7 4 基本的套接口編程 .................................................................................................... 7 概述 ................................................................................................................. 7 簡單的網(wǎng)絡(luò)編程 ............................................................................................... 8 5 程序設(shè)計和流程圖 .................................................................................................... 9 設(shè)計思路 .......................................................................................................... 9 服務(wù)程序 ........................................................................................................ 10 流程設(shè)計 ................................................................................................... 10 功能模塊 ....................................................................................................11 客戶程序 ........................................................................................................ 20 設(shè)計思路 ................................................................................................... 20 程序設(shè)計 ................................................................................................... 20 6 系統(tǒng)測試 ................................................................................................................ 30 結(jié) 論 ........................................................................................................................ 30 參考文獻(xiàn) ........................................................................................................................ 31 致 謝 ........................................................................................................................ 32 聲 明 ........................................................................................................................ 33 第 1 頁 共 33 頁 1 引言 課題背景 Linux 是目前應(yīng)用最廣泛的操作系統(tǒng)之一,基于 Linux 系統(tǒng)的網(wǎng)絡(luò)服務(wù)軟件 (如 FTP、Apache、 DNS、 SendMail)的功能也很強(qiáng)大。GTK。System Servers。通過系統(tǒng)測試后,完成預(yù)期的目標(biāo),但是需要進(jìn)一步完善程序和考慮安全性后,方可應(yīng)用于實際的遠(yuǎn)程管理。 該工具主要功能實現(xiàn) 對Linux系統(tǒng)用戶和組的添加、修改和刪除;對系統(tǒng)應(yīng)用服務(wù) (如 :DNS、 FTP、 Apache、系統(tǒng)啟動服務(wù)管理 )進(jìn)行管理和配置,這些服務(wù)的遠(yuǎn)程配置主要是通過修改服務(wù)配置文本文件來實現(xiàn)的。 畢業(yè)設(shè)計 ( 論文 ) 一種遠(yuǎn)程管理 Linux 系統(tǒng)工具的設(shè)計與實現(xiàn) 論文作者姓名: 申請學(xué)位專業(yè): 申請學(xué)位類別: 指導(dǎo)教師姓名(職稱): 論文提交日期: 一種遠(yuǎn)程管理 Linux 系統(tǒng)工具的設(shè)計與實現(xiàn) 摘 要 現(xiàn)在 ,Linux已經(jīng)是應(yīng)用比較廣泛的操作系統(tǒng)之一,在其系統(tǒng)中有很多的服務(wù)。為了實現(xiàn)遠(yuǎn)程配置和管理 Linux 中的各種服務(wù),需要有一種遠(yuǎn)程管理 Linux 系統(tǒng)的工具軟件,Webmin就是一種較好的 B/S模式軟件,而該課題以 C/S模式實現(xiàn)。該遠(yuǎn)程管理工具選用 C/S 模式設(shè)計,在客戶端,采用 GTK 編程來實現(xiàn)操作界面;在服務(wù)器端,選用 Linux 系統(tǒng)的文件調(diào)用函數(shù)來讀寫配置文件中的數(shù)據(jù);采用 Sock TCP編程來實現(xiàn)客戶端和服務(wù)端之間的數(shù)據(jù)通信。 關(guān)鍵詞 : Linux;系統(tǒng)服務(wù); C/C++; GTK;系統(tǒng)調(diào)用; Socket The Design and Implementation of a Remote Management Tool for Linux Abstract The operating system of Linux has bee one of the most popular operating systems nowadays. It provides many kinds of service. In order to configure and manage the service remotely, the tool of remote management of the operating system of Linux is needed. Webmin is a good tool of software based on the model of B/S. This design is implemented based on the model of C/S. The main functions of the system include addition, modification, deletion of users and groups of Linux operating system and configuration and management of the service of application of the system, such as the DNS, FTP, Apache and the management of booting service. The remote management of service is implemented by modifying the files of configuration. The model of C/S is selected by this system. In the Client, the operating interface is made by the programming of GTK. In the Server, the functions of transferring of files of Linux operating system are used to write and read the data of the configuration files. The munication of Client and Server is implemented by the programming of Sock TCP. The testing demonstrates that the system has reached the prospective goal. But lots of improvements should be made and the problems of security should be considered more. After being modified and perfected, the system can be used to manage th