Forums » Kodi (XBMC) as frontend »
Cannot use the upstart commands like "start tvheadend"
Added by Sébastien Aubry about 12 years ago
Hi,
I use XBMCBuntu Eden + Tvheadend PPA (currently 3.2.18~g40a8920~oneiric).
Over the months, I have been using a lot of versions of tvheadend. The automatic startup at boot never worked very well (duplicate instances - see this thread) so I wrote a dirty but efficient little script to kill everything at startup and to start it again.
- But when I type "start tvheadend", I get a message looking like insufficient rights:
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.36" (uid=1000 pid=2490 comm="start tvheadend ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
- When I type "sudo start tvheadend", I get a nice message, however nothing starts (no tvheadend web interface nor process nor syslog message)
spontex@pchc:~$ sudo restart tvheadend tvheadend start/running spontex@pchc:~$ ps aux | grep tvh spontex 2509 0.0 0.0 4212 772 pts/1 S+ 21:51 0:00 grep --color=auto tvh
- When I type "tvheadend -f -u spontex -g video", I get this error message:
Nov 14 21:53:28 [ALERT]:START: setgid() failed, do you have permission?
- When I just type "tvheadend", everything works fine and I am happy :-)
Can anyone please help me to understand why these upstart scripts do not work?
Thanks!
Replies (8)
RE: Cannot use the upstart commands like "start tvheadend" - Added by Adam Sutton about 12 years ago
have you tried "sudo start tvheadend", not entirely sure what restart will do if process is not already running.
I note in the above output no PID is printed. Can you check you don't have TVH_ENABLED=0 in /etc/default/tvheadend.
Adam
RE: Cannot use the upstart commands like "start tvheadend" - Added by Sébastien Aubry about 12 years ago
Hi Adam,
It is the same:
spontex@pchc:~$ sudo start tvheadend tvheadend start/running spontex@pchc:~$ ps aux | grep tvh spontex 2574 0.0 0.0 4212 768 pts/1 S+ 22:13 0:00 grep --color=auto tvh spontex@pchc:~$ sudo start tvheadend start: Job is already running: tvheadend
I had typed "restart" because on the second time, "start" thinks it is already started.
This is the content of my /etc/default/tvheadend file:
spontex@pchc:~$ more /etc/default/tvheadend DAEMON_ARGS="-f -u spontex -g video"
I have been using a lot of tvheadend versions and packages (even some hts-tvheadend packages) and some things may not be clean.
RE: Cannot use the upstart commands like "start tvheadend" - Added by Adam Sutton about 12 years ago
Ah, that's the problem.
You have a customised /etc/default/tvheadend that pre-dates 3.2. I think I added the file in a temporary format before the release of 3.2, since you've customised the file it won't have been overwritten when upgrading to 3.2.
Download this file https://raw.github.com/tvheadend/tvheadend/master/debian/tvheadend.default and overwrite your existing one and then change the settings accordingly.
Adam
RE: Cannot use the upstart commands like "start tvheadend" - Added by Sébastien Aubry about 12 years ago
Thank you very much, now it is solved:
spontex@pchc:~$ sudo start tvheadend tvheadend start/running, process 2931
- Shouldn't "dpkg-reconfigure" or a reinstallation replace this /etc/default/tvheadend file?
- Is it possible to use "start" as a normal user? I still get this message when typing "start tvheadend":
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.38" (uid=1000 pid=2872 comm="start tvheadend ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
RE: Cannot use the upstart commands like "start tvheadend" - Added by Adam Sutton about 12 years ago
Maybe?
The point of that file is that it doesn't get replaced, though I'm surprised that dpkg doesn't give you an option on upgrade to keep original/use new etc... I've seen that before with other files.
But to be honest I'd be more worried if this was between released versions etc... The file version you had was either created manually by you or picked up during the beta phase so it would not have been something I checked.
Adam
RE: Cannot use the upstart commands like "start tvheadend" - Added by Sébastien Aubry about 12 years ago
About the default file, I just noticed that I have a /etc/xbmc/setup.d/15-setTvheadend.sh
file at the old format:
xbmcUser=$1 xbmcParams=$2 cat > /etc/default/tvheadend << EOF DAEMON_ARGS="-f -u $xbmcUser -g video" EOF mkdir -p /home/$xbmcUser/.hts/tvheadend cat > /home/$xbmcUser/.hts/tvheadend/superuser << EOF { "username": "$xbmcUser", "password": "$xbmcUser" } EOF if [ -d /home/$xbmcUser/.hts ] then chown -R $xbmcUser:$xbmcUser /home/$xbmcUser/.hts fi /etc/init.d/tvheadend restart
I think it will never be run again but it will have to be updated in the next XBMCbuntu, if not already done.
RE: Cannot use the upstart commands like "start tvheadend" - Added by Sébastien Aubry about 12 years ago
So we got the answer: it is automatically created by XBMCbuntu setup!
RE: Cannot use the upstart commands like "start tvheadend" - Added by Adam Sutton about 12 years ago
Ah, ok.
It was a failing of tvh not to have a defaults file and to have the config embedded in the init script. This is why I created a default file in the TVH package. I was slightly confused as I did the exact same thing as above as an interim solution in TVH, but decided it was better to split things out to make it easier for users to follow and not have to worry abotu specific command line flags.
Adam