I've got a 3-rd party proprietary application server daemon which can be started and stopped by couple of command lines. I need this daemon to start when the system starts up and correctly stopped on system shutting down. How do I correctly implement this? Is it enough to copy some script inside /etc/init.d and modify it accordingly?
|
feedback
|
|
init.d is the old, deprecated system for starting daemons; is has been supplanted by upstart. Upstart has the advantage of being far easier to configure and allows proper sequencing of task initialization. The configuration files for upstart live in /etc/init and if your daemon has no pre-requisites it can be as simple as tty1.conf:
in which case you can copy that file and modify to taste. More complex configurations are best documented at the upstart site and in other entries in /etc/init. added in response to commentWhether you use upstart or init.d, you'll still need some way of determining when Firebird is properly initialized. Unfortunately, Firebird itself doesn't seem to have a good way of verifying that it is installed and running. Therefore, the recommendation to stick your program start into /etc/rc.local is certainly the easiest, and on Ubuntu - at least - is guaranteed to run about as late as possible in the boot process. | ||||
feedback
|
| |||
|
feedback
|
|
Make a copy of /etc/init.d/skeleton and edit it at appropriate places to start/stop/restart your service. It is very well commented so you should be able to create a working init.d script in no time. | |||
|
feedback
|