Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here it's what I do:

1) create an user some_deployer
2) then create a folder to script like /company/script/<service name>
3) in this folder I create the and scripts and give the ownership to the user some_deployer and the permission with chmod 755.
4) then after create the script in /etc/init.d/ folder, like <service name>-service and give the ownership to the user some_deployer and the permission with chmod 755 too.
5) then add this service to the list of services, still inside of the /etc/init.d/ with

/sbin/chkconfig --add -service (suse) or update-rc.d <service name> defaults (ubuntu)

Is this correct ? Is this the best way to proceed it ? I'm asking 'cause suddenly one of my service that I'm creating is not working anymore, I'm trying the command /etc/init.d/-service and it says that the command is not found, why is that ?

share|improve this question
up vote 2 down vote accepted

It isn't necessary to create a user, but you certainly can if its to your advantage. not sure what your talking about with /company/script/, but no reason not to. just make sure that your script file is in /etc/init.d before running update-rc.d. I'm not sure why you want to use /company/script/ but from your error, your service name is not coming through.

Look into the LSB specs for an init.d script here: you create a single script with the capabilities stop/start/restart/force-reload/status, and then register it with update-rc.d or whatever as you have suggested. that will allow update-rc.d to point to a single file, but perform all the required operations using it.

share|improve this answer

Don't believe LSB too much, most distributions have long abandoned sysvinit, Ubuntu, RHEL use upstart (in RHEL's case mostly in SysV compatibility mode), Fedora is using systemd for more than a year now, in Fedora 18 almost all services are native systemd. One of systemd's promises is to continue handling LSB-compatible setups, but it offers many advantages if using the native configuration. Take a look at its extensive documentation.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .