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 start.sh
and stop.sh
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 ?