1

In Slackware I just change one line in initab to run my program in a different console on bootup with auto respawn, how can I accomplish this in Ubuntu .. it seem one need a phd to write a upstart file in /etc/init/myprogram

c2:1235:respawn:/home/gerrie/myprogram 1<&2 1>/dev/tty2 <dev/tty2

Thanks in advance

3
  • Please, explain what are you trying to achieve. As it is, your question is unclear. Also read the Upstart cookbook to inform yourself about Upstart.
    – edwin
    Apr 11, 2014 at 19:40
  • Is the file named /etc/init/myprogram? If so, it needs to have a .conf suffix. Jun 2, 2014 at 16:53
  • Good to know that I'm not the only one struggling with upstart. It looks really complicated. Jul 26, 2017 at 5:21

1 Answer 1

0

Just adapt one of the existing jobs:

# tty1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345] and (
            not-container or
            container CONTAINER=lxc or
            container CONTAINER=lxc-libvirt)

stop on runlevel [!2345]

respawn
exec /sbin/getty -8 38400 tty1

You probably want to make it look something like this:

# tty2myprogram - myprogram
#
# This service maintains a getty on tty2 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345] and (
            not-container or
            container CONTAINER=lxc or
            container CONTAINER=lxc-libvirt)

stop on runlevel [!2345]

respawn
exec /sbin/getty -8 38400 -l /home/gerrie/myprogram tty2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .