7

I have an upstart script to create a service in RedHat 6:

env PLAY_BINARY=/usr/bin/play
env HOME=/opt/warda
env USER=root
env GROUP=root

[...]

script
    exec start-stop-daemon --start --exec $PLAY_BINARY --chuid $USER:$GROUP --chdir $HOME --start $HOME
end script

In Ubuntu everything goes right.

However in RedHat, when I launch sudo initctl start play, I get a successful feedback play start/running, but play doesn't run.

I think that the problem is that start-stop-daemon doesn't exist in RedHat.

How can I replace the exec start-stop-daemon... command?

  • 2
    Are you using RedHat 6 or RedHat 7? – garethTheRed Aug 1 '14 at 11:31
  • If you are using RedHat 7, it will be better to read the docs and create a systemd-unit – user34720 Aug 1 '14 at 11:36
  • I'm using RedHat6 – RikyTres Aug 1 '14 at 12:17
  • No one solution for RedHat6? :( – RikyTres Aug 5 '14 at 13:24
  • for RHEL6 you will need to create and install a traditional sysV init script. Then you can user /etc/init.d/play stop/start or /sbin/service stop/start play etc. and /sbin/chkconfig play on/off to enable/disable it at boot time. – Bram Nov 21 '14 at 17:40
6

You could try the daemonize command, which is available from the EPEL repository. It seems to do most of what you require here.

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.