Quantcast
Channel: 看得透又看得远者prevail.ppt.cc/flUmLx ppt.cc/fqtgqx ppt.cc/fZsXUx ppt.cc/fhWnZx ppt.cc/fnrkVx ppt.cc/f2CBVx
Viewing all articles
Browse latest Browse all 20483

又一个让进程在后台运行的工具:start-stop-daemon

$
0
0
登陆linux vps.
git clone https://github.com/daleobrien/start-stop-daemon
cd start-stop-daemon
gcc -o start-stop-daemon start-stop-daemon.c
(此命令会在当前目录下,生成可执行文件start-stop-daemon)


root@ar:~/start-stop-daemon# ./start-stop-daemon --start --exec /root/go/gopath/bin/GolangSocks5Server 2222 --background
root@ar:~/start-stop-daemon# ps aux|grep GolangSocks5Server
root     10796  1.8  0.9  62204 20848 ?        Sl   22:18   0:00 /root/go/gopath/bin/GolangSocks5Server 2222
root     10803  0.0  0.0  11072   844 pts/0    S+   22:19   0:00 grep GolangSocks5Server
root@ar:~/start-stop-daemon#

这样,命令:/root/go/gopath/bin/GolangSocks5Server 2222就在后台运行了。

项目地址:https://github.com/daleobrien/start-stop-daemon
(示范的在前台运行的程序例子GolangSocks5Server,
https://github.com/leechristensen/GolangSocks5Server)

类似的工具daemonize,http://briteming.blogspot.com/2016/08/daemonize-daemon.html

Viewing all articles
Browse latest Browse all 20483

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>