4

I'm installing rocket.chat on CentOS6, following this tutorial. It gives the first half of the instructions in CentOS7 and 6, but then when it comes to making it run as a service, it omits 6's instructions.

For CentOS7, it suggests making making a service file but since 6 uses init scripts and I don't know how to write init scripts, I'm like a kid in a labratory.

The service file has the following in it:

[Unit]
Description=The Rocket.Chat server
After=network.target remote-fs.target nss-lookup.target nginx.target mongod.target
[Service]
ExecStart=/usr/local/bin/node /opt/Rocket.Chat/main.js
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
User=root
Environment=MONGO_URL=mongodb://localhost:27017/rocketchat ROOT_URL=http://your-host-name.com-as-accessed-from-internet:3000/ PORT=3000
[Install]
WantedBy=multi-user.target

I've made a file /etc/init.d/rocketchat and made it executable. I pasted the above in but it obviously isn't liking a lot of that syntax when I run it.

How would this init script be different to a service?

-2

It's a systemd service file. Place to /lib/systemd/system/ Or if you have no systemd, then use the initscript from the previous version of Rocket.Chat.

3
  • 1
    CentOS 6 doesn't used systemd. The question is asking how to create a shell script for SysV init based on the quoted systemd service file. – Anthony Geoghegan Nov 17 '16 at 10:11
  • Then he can use the initscript from the previous version. – Ipor Sircer Nov 17 '16 at 10:14
  • I don't think rocket.chat has been around long enough that there is a script around for it. Maybe I'm just bad at searching. – cosmicbdog Nov 17 '16 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.