0

I am currently developing a chat program where the Server as Ubuntu + Swift and client as JavaScript + WebSocket. Finally I reached the 0.1 version and I need to deploy it for public use.

I am renting a Virtual Cloud Server with Ubuntu 16.04 LST and I installed Swift 3 and my developed chat server as collection of .swift files. I can compile and run my chat server using swift commands. But as soon as I close my SSH connection the server stops. Yea, I can understand why.

  1. How can I start my chat server permanently on my Virtual Cloud Server?
  2. Do I really need to make it as a service e.g. service squid start then how?

Where to start? I searched a lot in internet but could not find any example or advice. Any help? Thank you in advance.

Goppinath
  • 10,569
  • 4
  • 22
  • 45
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. Also see [Where do I post questions about Dev Ops?](http://meta.stackexchange.com/q/134306) – jww Jan 10 '17 at 21:14
  • Thank your for your comment. I know that is not a right place to ask this kind of question. But... most of the Linux and Unix guys doesn't know the limitations of the Swift deployment under Linux therefore they are giving very abstract answer. My questions is very similar to http://stackoverflow.com/questions/22336075/linux-process-into-a-service. The question is something Linux+Swift. Couple of days before I asked the same questions in other Linux related sites like Super User or Unix & Linux Stack Exchange but no response yet.. – Goppinath Jan 11 '17 at 08:39

1 Answers1

1

https://wiki.ubuntu.com/SystemdForUpstartUsers Example Systemd service

/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.target
Goppinath
  • 10,569
  • 4
  • 22
  • 45
Serhii Didanov
  • 2,200
  • 1
  • 16
  • 31