How to start a service at boot time in ubuntu 12.04, run as a different user?

Posted by Alex on Super User See other posts from Super User or by Alex
Published on 2013-06-26T06:36:52Z Indexed on 2013/06/26 16:23 UTC
Read the original article Hit count: 249

Filed under:
|
|
|
|

I have a server ClueReleaseManager which I have installed on a Ubuntu 12.04 system from a separate user (named pypi), and I want to be able to start this server at startup.

I already have tried to create a simple bash script with some commands (login as user pypi, use a virtual python environment, start the server), but this does not work properly. Either the terminal crashes or when I try to ask the status of the service it is started and I am logged in as user pypi ...?

So, here the question: What are the steps to take to make sure the ClueReleaseManager service properly starts up on boot time, and which I can control (start/stop/..) during runtime, while the service is running from a user pypi?

Additional information and constraints:

  • I want to do this as simple as possible
  • Without any other packages/programs to be installed
  • I am not familiar with the Ubuntu 12.04 init structure
  • All the information I found on the web is very sparse, confusing, incorrect or does not apply to my case of running a service as a different user from root.

© Super User or respective owner

Related posts about linux

Related posts about ubuntu