Easy setup guide for Ubuntu / Debian (DEB packages and repo)

For help and support with issues specific to Linux/Unix
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

Re: Easy setup guide for Ubuntu / Debian (DEB packages and r

Postby Jose1701 » Wed Apr 04, 2012 9:36 pm

It seems to work now.

Thanks a lot.

Regards

Jose
Jose1701
 
Posts: 24
Joined: Thu Nov 17, 2011 6:27 pm

Re: Easy setup guide for Ubuntu / Debian (DEB packages and r

Postby Katuuqed » Fri Apr 06, 2012 9:36 pm

While the PPA PS3 Media Server from this package works fine (Ubuntu 11.10), I have found a fatal problem when uninstalling (with purge) this package.

The postrm script have failed during uninstallation and on closer inspection, I've found that this package explicitly uninstalls ps3mediaserver configuration files in all user directories:
Code: Select all
        # for every user in /home/ ...
   for HOME_U in /home/*?; do
      # obtain the username
      USER=$( basename $HOME_U )
      if [ -d /home/$USER/.config/$PACKAGE/ ]; then
         rm -rf /home/$USER/.config/$PACKAGE/
      fi
   done


I think this is really bad practice, packages should never ever touch files in home directories (unless they explicitly ask for it). Have you considered reasons why you shouldn't remove user's configuration? For example I want to switch to the generic package of PSM and I want to keep the configuration, not just completely get rid of it.

This behaviour has another, somewhat fatal, consequence. It seems that $PACKAGE variable isn't (in some cases?) populated, so in the end the postrm script calls this:
Code: Select all
rm -rf /home/$USER/.config//

That means ps3mediaserver package removes .config/ directory for all users.

Please, fix this before more users get hurt, at least make sure that $PACKAGE variable is populated or - ideally - remove the whole user configuration sweeping procedure. Thank you.
Katuuqed
 
Posts: 3
Joined: Fri Apr 06, 2012 9:04 pm

Re: Easy setup guide for Ubuntu / Debian (DEB packages and r

Postby chocolateboy » Fri Apr 06, 2012 11:17 pm

Katuuqed wrote:ps3mediaserver package removes .config/ directory for all users


That's a serious bug.

I've found that this package explicitly uninstalls ps3mediaserver configuration files in all user directories


Isn't that what purge means? Use remove if you want to keep them.
chocolateboy
Project Member
 
Posts: 2579
Joined: Wed Sep 16, 2009 10:05 am

Re: Easy setup guide for Ubuntu / Debian (DEB packages and r

Postby happy.neko » Sat Apr 07, 2012 5:31 pm

Like chocolateboy said erasing configs is expected behaviour for apt-get purge:
+ apt-get remove - remove package
+ apt-get purge - remove package with configs.

Unset $PACKAGE variable on other hand is bug and will be fixed.
happy.neko
Project Member
 
Posts: 478
Joined: Fri Sep 23, 2011 5:38 pm

Re: Easy setup guide for Ubuntu / Debian (DEB packages and r

Postby Katuuqed » Sat Apr 07, 2012 8:24 pm

purge should remove only system configs, e.g. files in /etc/ps3mediaserver/ - it shouldn't remove user's configuration files, see Debian forums:
roseway wrote:Purge deletes the package and its central configuration, but doesn't remove any user data.

Also man dpkg is quite clear about this:
-r, --remove, -P, --purge package...|-a|--pending [...]
-P or --purge removes everything, including conffiles.
[...]
Note: some configuration files might be unknown to dpkg because they are created and handled separately through the configuration scripts. In that case, dpkg won't remove them by itself, but the package's postrm script (which is called by dpkg), has to take care of their removal during purge.
Of course, this only applies to files in system directories, not configuration files written to individual users' home directories.

I just recommend sticking to the standard behaviour. Anyway thanks for fixing this.
Katuuqed
 
Posts: 3
Joined: Fri Apr 06, 2012 9:04 pm

Re: Easy setup guide for Ubuntu / Debian (DEB packages and r

Postby RPG_Master » Sun Apr 08, 2012 9:51 am

Thanks for making this PPA! Everything is looking good, music streaming wise. I haven't messed with video yet. But I am having one issue. I'm trying to play some multi-channel flac files, but I keep getting "File Corrupted". What can I do to fix this?
RPG_Master
 
Posts: 1
Joined: Sun Apr 08, 2012 9:48 am

Re: Easy setup guide for Ubuntu / Debian (DEB packages and r

Postby happy.neko » Sun Apr 08, 2012 2:31 pm

new version with postrm and postinst fixes
Code: Select all
ps3mediaserver (1.51.0+git+mencoder34587-3) oneiric; urgency=low

  * Double quotes in postinst


ps3mediaserver (1.51.0+git+mencoder34587-2) oneiric; urgency=low

  * Fix config directories in postrm script
  * Allow home directories with spaces in postinst script

This version is planned to be the last one for legacy systems (Ubuntu 10.04-11.04). Future releases will be for 11.10 and 12.04 LTS only.

RPG_Master wrote:Thanks for making this PPA! Everything is looking good, music streaming wise. I haven't messed with video yet. But I am having one issue. I'm trying to play some multi-channel flac files, but I keep getting "File Corrupted". What can I do to fix this?

I think PS3 does not support 5.1 music files, only videos. I am not 100% sure though.

Katuuqed wrote:purge should remove only system configs, e.g. files in /etc/ps3mediaserver/ - it shouldn't remove user's configuration files, see Debian forums:
roseway wrote:Purge deletes the package and its central configuration, but doesn't remove any user data.

Also man dpkg is quite clear about this:
-r, --remove, -P, --purge package...|-a|--pending [...]
-P or --purge removes everything, including conffiles.
[...]
Note: some configuration files might be unknown to dpkg because they are created and handled separately through the configuration scripts. In that case, dpkg won't remove them by itself, but the package's postrm script (which is called by dpkg), has to take care of their removal during purge.
Of course, this only applies to files in system directories, not configuration files written to individual users' home directories.

I just recommend sticking to the standard behaviour. Anyway thanks for fixing this.


I see your point, but still not convinced. The last quote about dpkg says that these configs will be left by dpkg because they were created outside dpkg and should be handled by postrm script instead ("...but the package's postrm script (which is called by dpkg), has to take care of their removal during purge."). Thats how it works now. Debian Policy is not clear about configs in /home directories because expects all programs to use system-wide configs in /etc or at least use symlinks, not feasible for PS3 Media Server. I think that dpkg purge should delete all previously installed package files and leave user generated ones. And configs in ~/.config/ps3mediaserver are installed with postinst.
happy.neko
Project Member
 
Posts: 478
Joined: Fri Sep 23, 2011 5:38 pm

Re: Easy setup guide for Ubuntu / Debian (DEB packages and r

Postby Katuuqed » Sun Apr 08, 2012 6:38 pm

happy.neko wrote:[...] And configs in ~/.config/ps3mediaserver are installed with postinst.

I see, this somewhat justifies postrm's behaviour. I was assuming that PMS creates user configuration on launch – this is after all common for most user applications, e.g. web browsers – and no browser package deletes users' profiles on purge. Also generic PMS for Linux creates user configuration in ~/.config/PMS/PMS.conf

Other packages, e.g. bash, install conffiles into /etc/skel (as ps3mediaserver does) but don't touch home directories of existing users. If the application needs configuration in user's home, it can recreate it by itself or copy it from central location such as /etc/skel - but this happens only if the user executes the application.

There are good reasons why Debian packages don't mess with user configuration, it's virtually impossible to make this 100% foolproof (do you really think that /home is the only place where users' home directories can be placed?), it may lead to redundancy (not all users on the system will run PMS so why all of them should have their own copy of configuration?) and it can still cause damage and users' data loss. I am presenting edge cases but you should be paranoid when it comes to user data - package management runs with root permissions and with such power comes huge responsibility.
Katuuqed
 
Posts: 3
Joined: Fri Apr 06, 2012 9:04 pm

Re: Easy setup guide for Ubuntu / Debian (DEB packages and r

Postby happy.neko » Sun Apr 08, 2012 8:22 pm

Katuuqed wrote:Other packages, e.g. bash, install conffiles into /etc/skel (as ps3mediaserver does) but don't touch home directories of existing users. If the application needs configuration in user's home, it can recreate it by itself or copy it from central location such as /etc/skel - but this happens only if the user executes the application.


That makes sense. So the real solution is another debian compliance patch for PS3MS. It should copy default configs from /etc/skel during first run.Then we can remove copy/erase workarounds from deb scripts entirely. But I don't have time to implement it now. You can try if you want.
happy.neko
Project Member
 
Posts: 478
Joined: Fri Sep 23, 2011 5:38 pm

Re: Easy setup guide for Ubuntu / Debian (DEB packages and r

Postby arrrghhh » Wed Apr 11, 2012 8:06 am

happy.neko wrote:
Jose1701 wrote:Well, with older versions the sound was given to my av-receiver and it shows DolbyDigital. Also the ps3 shows actually lpcm and not dolbydigital. dts files were working.

You can either disable "Use LPCM for audio" on common transcode settings to enable AC3 transcoding or enable "Keep AC3 track (remux)".


Hello.

I have mencoder_usepcm = false in my PMS.conf file. However, when I play a file I know had DolbyDigital before does not. I see the amp say "Dolby D" and then it switches back to 'normal' non-surround sound mode? Eh?

Perhaps I also need to turn up more logging. The end of my log file is there it shows the file I'm playing, and it's very short:

Code: Select all
[StartPlaying Event] INFO  2012-04-11 01:03:39.613 renderer: 192.168.0.230, file: /media/movies/Movies/BBC/Planet Earth/02 - Mountains.mpg
[StopPlaying Event] INFO  2012-04-11 01:03:51.015 renderer: 192.168.0.230, file: /media/movies/Movies/BBC/Planet Earth/02 - Mountains.mpg


Doesn't give a whole lot to go off of. Here's my PMS.conf:

Code: Select all
cat /root/.config/ps3mediaserver/PMS.conf
folders = /media/movies/Movies/,/media/tvshows/TV Shows/,/media/1-500/Music/,/var/www/downloads/Complete
hostname =
port =
language =
thumbnails = true
thumbnail_seek_pos = 1
nbcores = 4
turbomode = false
minimized = true
hidevideosettings = false
usecache = false
charsetencoding = 850
engines = pmsencoder,mencoder,avsmencoder,tsmuxer,mplayeraudio,ffmpegaudio,tsmuxeraudio,vlcvideo,mencoderwebvideo,mplayervideodump,mplayerwebaudio,vlcaudio,ffmpegdvrmsremux
autoloadsrt = true
avisynth_convertfps = true
avisynth_script = #AviSynth script is now fully customisable !\u0001#You must use the following variables (\"clip\" being the avisynth variable of the movie):\u0001#<movie>: insert the complete DirectShowSource instruction [ clip=DirectShowSource(movie, convertfps) ]\u0001#<sub>: insert the complete TextSub/VobSub instruction if there's any detected srt/sub/idx/ass subtitle file\u0001#<moviefilename>: variable of the movie filename, if you want to do all this by yourself\u0001#Be careful, the custom script MUST return the clip object\u0001<movie>\u0001<sub>\u0001return clip
transcode_block_multiple_connections = false
tsmuxer_forcefps = true
tsmuxer_preremux_pcm = false
tsmuxer_preremux_ac3 = false
audiochannels = 6
audiobitrate = 384
maximumbitrate = 0
skiploopfilter = false
enable_archive_browsing = true
mencoder_fontconfig = false
mencoder_font =
mencoder_forcefps = false
mencoder_usepcm = false
mencoder_intelligent_sync = true
mencoder_decode =
mencoder_encode = keyint=1:vqscale=1:vqmin=2
mencoder_nooutofsync = true
mencoder_audiolangs = eng
mencoder_sublangs = eng
mencoder_audiosublangs =
mencoder_subfribidi = false
mencoder_ass_scale = 1.0
mencoder_ass_margin = 10
mencoder_ass_outline = 1
mencoder_ass_shadow = 1
mencoder_noass_scale = 3
mencoder_noass_subpos = 2
mencoder_noass_blur = 1
mencoder_noass_outline = 1
mencoder_subcp = cp1252
mencoder_ass = true
mencoder_disablesubs = false
mencoder_yadif = false
mencoder_scaler = false
mencoder_scalex = 0
mencoder_scaley = 0
ffmpeg = -g 1 -qscale 1 -qmin 2
use_mplayer_for_video_thumbs = true
dvd_isos_thumbnails = true
uuid = 725e5039-67a2-313f-8bf6-3001b49a508d


Let me know what you think, thanks again for providing this package. It is very helpful! Might be good to note, I am on 10.04 which I see you're shuttering support for... I do hope to upgrade to 12.04 soon, I'd like for it to be released first! :p. I also prefer to keep my servers on LTS releases, so perhaps keep that in mind for supporting old Ubuntu versions? Thanks again!
arrrghhh
 
Posts: 63
Joined: Thu May 07, 2009 12:43 am

PreviousNext

Return to Linux/Unix Support

Who is online

Users browsing this forum: No registered users and 4 guests