I need to create ratchet service on my dedicated server (CentOS 6). I have successfully created this service on local CentOS 7. The problem is that the server has got old version of CentOS and I need to create a service there.
I have taken the following steps to create a service in CentOS 7:
Created a file named ratchet.service
in /etc/systemd/system/
and put the following in it:
[Unit]
Description=Ratchet Service
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/php -f /path/to/ratchet/server$
Restart=on-abort
[Install]
WantedBy=multi-user.target
To start:
service ratchet start
Can anyone please advise how can this be achieved in CentOS 6?
UPDATE: What i am trying to achieve is to run Ratchet Service written in php.I want to run this service on Centos 6 so that it can run persistently on my server. I need to execute server file script (named above as /path/to/ratchet/server.php).
I am following this tutorial and code : https://github.com/amirsanni/Video-Call-App
systemd
and you need to work with/etc/init.d/
instead of systemd units. Please study How to find out if a system uses SysV, Upstart or Systemd initsystem, Detect init system using the shell and edit your question to tell us what it is.