1
votes

I have a /etc/init.d/some-file script which starts a service.

I want that to be a part of upstart, meaning when i do a kill -9 on the process of the service, the service should auto start.

I created a file in /etc/init/some-file.conf

start on runlevel [2345]
stop on runlevel [016]

respawn
respawn limit 2 5

exec /etc/init.d/some-file start

Once i created this file i ran the below command to reload the configuration changes.

initctl reload-configuration

But the service does not start up when i kill the process.

Am i missing some concept here or doing something wrong ?

1

1 Answers

1
votes

In the script,

exec /etc/init.d/some-file start

should be the path to the executable or binary that this upstart should start and not itself.

So change this to the name of the process like

exec /usr/bin/<NameOfProcess>

EDIT:

After adding changes to the conf file run the below command.

$ sudo initctl start some-file

where some-file is the name of your upstart job.

Also to verify that your upstart job is running, run the below comand

$ initctl list