How to copy configuration data from test environment into "production"?
Added by Crazy Fin almost 10 years ago
Now when I have a really nice working test environment with the latest build 3.9.2144 I would lika to install the current test setup into "production".
I am on 14.04 LTS with all the updates until today.
I run this from the tvheadend directory (in my case /home/tvserver/tvheadend)
./Autobuild.sh -t precise-amd64
and when package is built I move one directory up to /home/tvserver/ and run the command
sudo dpkg -i tvheadend_3.9.2144~gda3d9ec~precise_amd64.deb
when I start TVH with
service tvheadend start
TVHeadend starts nice but since this is now running as a service it will be running as a new user in the directory
/home/hts/.hts/tvheadend
instead of
/home/tvserver/.hts/tvheadend
it will have a totally empty configuration.
I now I copy my configuration from /home/tvserver/.hts/tvheadend and make sure that the directory and file ownerships are hts as the owner and group is video (read and write rights) as well as the permissions are tagged with 775 with the CHMOD command.
I have also made sure that the user hts is a member of the video group that has Read and Write rights as group to /home/hts/.hts/tvheadend and its subdirs and files.
However if I now start TVH with
service tvheadend start
TVH crashes directly and repeatedly until Ubuntu stops it from restarting.
I just don understand why I can not take the configurations from my TVH directory from my build/dev directory /home/tvserver/.hts/tvheadend and copy it to my "permanent" installation directory /home/hts/.hts/tvheadend ?
Replies (2)
RE: How to copy configuration data from test environment into "production"? - Added by Prof Yaffle almost 10 years ago
You theoretically can copy it - I've done it many times. It should work.
I guess two thoughts come to mind:
1. Are you copying as sudo? cp won't allow you to change ownership to anyone other than the owning UID unless you're root, so some file ownerships would change. Ditto groups. rsync -a would have the same issue as cp -rp unless you sudo first.
2. How is it crashing? What's the message it issues as it dies?
3. You can switch on debugging by setting DEBUG=1 in /etc/default/tvheadend and restarting the daemon.
RE: How to copy configuration data from test environment into "production"? - Added by Crazy Fin almost 10 years ago
Thanks for the suggestions.
Problem solved! :-)
It was the folder "bouquet" that caused TVH to crash when starting it as a daemon after I had copied files from the "local" user to the HTS user folders.
However, if did a full copy
sudo cp -a /home/tvserver/.hts/ /home/hts/.hts/
and then
sudo chown -R hts:video /home/hts/.hts/
BUT I deleted the "bouquet" folder it all worked fine when I started the process with
service tvheadend start
The "bouquet" folder is then recreated by the TVH daemon during the first start.
I just dont understand why this folder is causing TVH daemon to crash when I copy it between same versions of TVH?
Anyway, running TVH as a daemon works fine and it feels good that a crash of TVH or restarting my TV server will automatically start TVH as well. :-)