linux同步工具
来源:互联网 发布:淘宝的 微淘动态 编辑:程序博客网 时间:2024/06/07 05:51
linux同步工具
项目源码
项目简介 :实现在linux环境下服务端和客户端同步文件、更新文件、一键部署环境
开发环境 :linux,c++, vim, g++, gdb, make
主要技术 :
1、正则表达式:关于正则表达式的元字符和在c++中使用正则表达式,我做了总结:正则表达式
2、守护进程:linux下,man 7 daemon会得到守护进程的标准创建过程。
1. Close all open file descriptors except standard input, output, and error (i.e. the first three file descriptors 0, 1, 2). This ensures that no accidentally passed file descriptor stays around in the daemon process. On Linux, this is best implemented by iterating through /proc/self/fd, with a fallback of iterating from file descriptor 3 to the value returned by getrlimit() for RLIMIT_NOFILE.2. Reset all signal handlers to their default. This is best done by iterating through the available signals up to the limit of _NSIG and resetting them to SIG_DFL.3. Reset the signal mask using sigprocmask().4. Sanitize the environment block, removing or resetting environment variables that might negatively impact daemon runtime.5. Call fork(), to create a background process.6. In the child, call setsid() to detach from any terminal and create an independent session.7. In the child, call fork() again, to ensure that the daemon can never re-acquire a terminal again.8. Call exit() in the first child, so that only the second child (the actual daemon process) stays around. This ensures that the daemon process is re-parented to init/PID 1, as all daemons should be.9. In the daemon process, connect /dev/null to standard input, output, and error.10. In the daemon process, reset the umask to 0, so that the file modes passed to open(), mkdir() and suchlike directly control the access mode of the created files and directories.11. In the daemon process, change the current directory to the root directory (/), in order to avoid that the daemon involuntarily blocks mount points from being unmounted.12. In the daemon process, write the daemon PID (as returned by getpid()) to a PID file, for example /run/foobar.pid (for a hypothetical daemon "foobar") to ensure that the daemon cannot be started more than once. This must be implemented in race-free fashion so that the PID file is only updated when it is verified at the same time that the PID previously stored in the PID file no longer exists or belongs to a foreign process.13. In the daemon process, drop privileges, if possible and applicable.14. From the daemon process, notify the original process started that initialization is complete. This can be implemented via an unnamed pipe or similar communication channel that is created before the first fork() and hence available in both the original and the daemon process.15. Call exit() in the original process. The process that invoked the daemon must be able to rely on that this exit() happens after initialization is complete and all external communication channels are established and accessible.
3、配置文档:配置文档主要使用正则表达式进行处理,使用正则表达式提取要获取的关键字。
4、生产消费者模型:生产消费者模型
5、设计模式:单例模式、简单工厂模式、命令模式、中介者模式
项目特点:
- 符合语法规则的前提下,支持c注释与c++注释相互转换。
- 软件安装与升级:能触发多个主机通过apt或者yum安装和升级指定的软件包。
- 脚本执行:能远程控制客户端执行某个脚本文件,达到一键部署功能 。
- 整个系统拥有日志功能
阅读全文
0 0
- linux 文件夹同步工具
- Linux同步工具:rsync
- linux同步工具
- linux同步之相关工具
- linux远程同步工具rsync
- linux文件同步工具使用
- Linux Rsync 远程同步工具
- linux工具rdate:同步网络时间
- linux文件同步工具Unison的使用
- cwSync文件同步工具 linux window
- Linux 文件同步工具——rsync
- linux下文件备份同步工具rsync
- 基于Linux的文件同步工具
- 同步工具
- 同步工具
- rsync文件同步工具,可实现Linux之间,Linux与Windows之间的文件同步
- kettle工具同步数据乱码-Linux下乱码问题二
- WinSCP(Windows与Linux文件同步工具)使用总结
- AngularJS中$http.jsonp跨域请求问题
- 【3dsmax】导入Unity3D需要注意的轴问题
- SessionManager
- Centos下安装NFS服务
- 153. Find Minimum in Rotated Sorted Array
- linux同步工具
- Access-Control-Allow-Origin 跨域
- app-release-unsigned.apk is not signed
- Java中的Switch对整型、字符型、字符串型的具体实现细节
- Android Studio使用bmob以及retrofit开发遇到的包冲突
- CodeForces
- C#正则验证大全 Regex.IsMatch()正则表达式验证
- C 常用函数罗列(长期更新)
- iOS开发之'-[__NSCFString appendString:]: nil argument'