2

i want to start a java application at start up. I added the script file in init.d and the process got started .

But the owner of the process is root. So when the java process is trying to write a file in my home i am getting permission error.

How can i start the process from the user scope rather than the root scope?

Jorge Castro
  • 71,754
karthick
  • 131

2 Answers2

1

I don't have the time to retype everything I had written to this question on Stack Overflow, but some pointers you may want:

First, @reboot specifier in the crontab(5) makes it easy to run a program as a user on boot.

Second, writing an upstart job specification to run a program as service is pretty straightforward. The documentation is poor, but there are many examples in /etc/init.d/. start-stop-daemon(8) is fantastic -- be sure to read its manpage before you try to re-invent the wheel.

sarnold
  • 1,841
  • 17
  • 20
  • 2
    you could give a link to your answer on StackOverflow... – xubuntix Nov 14 '11 at 10:23
  • @xubuntix: karthick deleted his question seconds before I clicked "submit answer" and I wound up re-using that browser tab for something else eventually. – sarnold Nov 14 '11 at 10:26
0

You can make applications automatically start for your user by adding them to the "Startup Applications" in Ubuntu 11.10 (look for it in drush search)

for older Ubuntu versions: System > Preferences > Sessions

htorque
  • 64,798
Denis
  • 1,003