Project

General

Profile

Writing a proper auto-restart using uptime

Added by Maury Markowitz almost 9 years ago

I had to build from source for my Odroid C1+, and I did so in a directory called "bld" so the complete path to the binary is:

/home/odroid/bld/tvheadend/build.linux/tvheadend

Now I would like to automate startup/restart. This system has upstart, not systemd. I found the git file for the .conf, but I'm new to upstart and I'm hoping someone can give me some pointers.

For one, how do I set the path properly to point to the bld-based location? I don't see a path to the executable in the script, only the settings.

For another, does TVH have to run as user tvh? Or is it find to add setuid odroid in the script?

Finally, how do I set some of the command line switches like -u? Do I modify the script itself, or is it reading these settings from another location, perhaps /etc/default/tvheadend?


Replies (2)

RE: Writing a proper auto-restart using uptime - Added by Hiro Protagonist almost 9 years ago

Is there some reason you can't move the executable to somewhere like /usr/local/bin?

In your .conf you can do this if you want:

script
  # Add any shell script stuff you like...
/path/to/executable/foo
end script

You can run tvheadend as any user you like, just make sure that user has permission to write where tvheadend needs to.

You can pass arguments on your tvheadend command line, or put them in /etc/default/tvheadend, your choice.

HTH

RE: Writing a proper auto-restart using uptime - Added by Maury Markowitz almost 9 years ago

I did move it finally, to /usr/local/bin. The problem is that I had failed to build it with --enable-package, which seems to me should be the default.

In any case the application now runs properly from that /usr location, but upstart still fails to start it (I think).

    (1-2/2)