我目前正在开发一个聊天程序,其中服务器为Ubuntu + Swift,客户端为JavaScript + WebSocket。最后,我达到了0.1版本,我需要部署它供公众使用。
我正在租用一个带有Ubuntu16.04LST的虚拟云服务器,我安装了Swift 3和我开发的聊天服务器作为.swift文件的集合。我可以编译和运行我的聊天服务器使用迅速的命令。但一旦我关闭我的SSH连接,服务器就会停止。是的,我能理解为什么。
service squid start,然后怎么做?从哪里开始?我在网上搜索了很多,但找不到任何例子或建议。有什么帮助吗?提前谢谢你。
发布于 2017-10-05 10:42:17
https://wiki.ubuntu.com/SystemdForUpstartUsers示例系统服务
/lib/systemd/system/foo.service:
[Unit]
Description=Job that runs the foo daemon
Documentation=man:foo(1)
[Service]
Type=forking
Environment=statedir=/path/to/swift/usr/lib
ExecStart=/path/to/swiftBinary
[Install]
WantedBy=multi-user.targethttps://stackoverflow.com/questions/41570829
复制相似问题