centos daemon make and install

【編譯】 centos  1.先到libtlpi目錄下,make 編譯出ename.c.inc;複製到cksettling目錄下; 2.結算編譯環境須要64bit的libmysql庫:把libmysql.so.16 所在路徑加入到 /var/ld.so.conf 中,執行 ldconfig; 三、配置 ./configure –refix=/usr/local/cksettling //指定安裝目錄,之後要刪除安裝就只需刪除這個目錄。 四、編譯和安裝    修改makefile 和subdir.mk 中的輸出文件和庫文件路徑,    make clean &&  make install    複製cksettling.conf到安裝目錄 cp cksettling.conf /usr/local/cksettling/.  五、編寫啓動腳本,把它放到目錄 /etc/rc.d/init.d/裏,這裏取名爲cksettlingd,其內容以下 ////////////////////////////// 例如腳本名稱爲cksettlingd #!/bin/bash  #chkconfig 2345 99 80  # description: cksettlingd is a settling service. #上面爲固定格式:2345 表示運行級別,99表示開機執行順序,80爲關機順序  # 沒有上面的就會提示 does not support chkconfig   # cking settling service.  # author :zhangshiguang  # time:2012.12.09 PM  # description: a application server # usage: #chkconfig --list|grep cksettling #chkconfig --add cksettling #chkconfig --levels 235 cksettling on #chkconfig --del cksettling case "$1" in start) /usr/local/cking/sbin/cksettling echo "cksettling start ok" ;; restart) kill -HUP `ps aux | grep cksettling | grep -v grep | awk '{print $2}'` echo "cksettling restart ok" ;; stop) kill -TERM `ps aux | grep cksettling | grep -v grep | awk '{print $2}'` echo "cksettling stop ok" ;; esac exit 0 ///////////////////////// 別忘了給它賦予可執行權限: chmod a+x /etc/rc.d/init.d/cksettlingd ////////////////////////////// 查看系統日誌 gedit /var/log/syslog centos 系統日誌在 /var/log/messages
相關文章
相關標籤/搜索