Praful Bagai
Praful Bagai

Reputation: 17372

Ubuntu- How to start a service in runlevel 5

I have my executable file in service folder /var/www/project/service/project.exe. Currently I'm running on runlevel 2. I used this link to change my default runlevel to 5.

Since this will be deployed on the cloud ,I want that it should start the service(project.exe) in runlevel 5 automatically, rather than manually.

How this can be achieved?

Upvotes: 1

Views: 441

Answers (1)

jfs
jfs

Reputation: 414139

You could create an Upstart job. Write /etc/init/project.conf file:

start on runlevel 5
exec /var/www/project/service/project.exe

You probably want to specify other options such as description, stop on, respawn, setuid.

Upvotes: 1

Related Questions