1

I have a service that I run with a program that we developed. I want this program to start on startup and I want it to run in the foreground.

Now I got it to a place where I can run it using " service xxx start " and it also starts up when killed which is perfect. But I also want it to run in the foreground with a terminal?

Here is the code in the /etc/init/test.conf As you can see this is a test with gnome-calculator which seems to work fine actually. BUT the moment I want to run my cmd program instead it launches it in the background.

Ok I am using the following code to try and run a command line program.

#!upstart
description "Node Server"

# Start job via the daemon control script.
exec su -l gert -c 'export DISPLAY=:0; /usr/bin/gnome-calculator'

#Restart process if it dies with a signal
# or exit code not given by the 'normal exit' status.
respawn

#Give up if restart occurs 10 times in 90 seconds
respawn limit 10 90
Thanks
  • Remember what you did to get it to run as a service? Don't do that. You will have to change the "program that we developed" to notice how it was started and do/do not read STDIN, write STDOUT, etc. – waltinator Sep 1 '15 at 17:56
  • @waltinator Ok but that is not really what I want to do ... I want this window to open up even if the user closes it a million times... I have tested it with the "gnome-calculator" and it worked. No matter how many times I killed it, it came back! – Testo Sep 2 '15 at 7:15
  • Then your question is unclear. Services, in general, run not connected to a terminal, since they're often started before the X window system. – waltinator Sep 2 '15 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.