Fedora 16设置开机自启动程序与Ubuntu的区别

Ubuntu设置开机自启动脚本的方法是:修改/etc/init.d/rc.local这个文件,添加需要启动的程序即可,香港空间,相关函数如下:

void SetSysAutoBoot(){char path[256] = {0};int ret = 0;ret = readlink(,path,sizeof(path));if((ret > 0 )&& (ret < sizeof(path))){printf(,path);};int fileLen = GetFileSize(fileName);FILE * fp = fopen(fileName,);char* buf;buf = (char*)malloc(fileLen*2);char* tempBuf = buf;if(fp == NULL){return;}int flag = 0;while(!feof(fp)){tempBuf = fgets(buf,fileLen,fp);if(tempBuf != buf){break;}(strstr(tempBuf,path) != 0){//flag = 1;}}fclose(fp);(0 == flag){char buf[1024];sprintf(buf,,path);printf(buf);system(buf);}free(buf);},香港服务器租用,香港空间明天又会是新的一天,而我依然年轻。

Fedora 16设置开机自启动程序与Ubuntu的区别

相关文章:

你感兴趣的文章:

标签云: