0

Hy!

I want to add my script in init.d which starts a server at startup but when I can't add it to chkconfig.

This is a head of my script :

#!/bin/bash
# chkconfig :       2345 19 18
# Default-Start :   2 3 4 5
# Default-Stop :    0 1 6
# Short-description: Conan C/C++ Package Manager server
# description :      Conan C/C++ Package Manager server
# processname: conan_server

# Source function library.
. /etc/init.d/functions

And when I try to add it :

[root init.d]# chmod 777 conan_server
[root init.d]# chkconfig --add conan_server
-> service conan_server does not support chkconfig

Can you help me ? thanks :)

  • conan_server is not a service, it is just a regular app, I know little about chkconfig, but I'd say that services have to comply with a certain interface and have start(), stop(), etc commands. I think you might need to write a script that wraps the conan_server launch. From http://docs.conan.io/en/latest/server.html#running-from-source-linux. please check that the recommended way to use a server in production is with gunicorn – drodri Feb 02 '17 at 12:41
  • Yes I know, but gunicorn is a service and i use gunicorn in my script to start an conan server. you understand what I want to say ? –  Feb 02 '17 at 13:04
  • Possible duplicate of [Service doesn't support chkconfig](http://stackoverflow.com/questions/5133552/service-doesnt-support-chkconfig) – Ulises André Fierro Feb 02 '17 at 14:59
  • No I checked before asking my question –  Feb 02 '17 at 15:47
  • Then by all means, please share the rest of your script. – Ulises André Fierro Feb 02 '17 at 16:10
  • Whatever it is that you are trying to do, **`chmod 777` is *wrong* and *insecure*** and you should change it to something sane (maybe `chmod 755`?) immediately. You don't need to think about it very hard to understand why it's not a good idea to give every user on the system write access to a system control resource. – tripleee Feb 02 '17 at 17:46
  • I tried this but it (755) didn't work :/ –  Feb 03 '17 at 10:59
  • I solved the problem. It was just a problem in the comments –  Feb 03 '17 at 14:35
  • Was it an extra space or was anything missing? Was it covered in the link I provided above? – Ulises André Fierro Feb 03 '17 at 16:46

0 Answers0