[mythtv-users] Mythexport output files wrong permissions

Anthony Giggins seven at seven.dorksville.net
Fri May 6 11:25:29 UTC 2016


On 6 May 2016 at 21:11, Hika van den Hoven <hikavdh at gmail.com> wrote:

> Hoi John,
>
> Friday, May 6, 2016, 12:52:21 PM, you wrote:
>
> > Hi,
>
> > I have just upgraded my combined BE/FE from Ubuntu 12.04 to 14.04
> > (I realise I am behind the times!) Before the change, files output
> > from mythexport had permissions 666 (-rw-rw-rw-). Files output
> > since the upgrade have permissions 600 (-rw-------). This means
> > that the apache process that serves the output files, via an RSS
> > feed, cannot read the files and so they cannot be downloaded.
> >
> > I was wondering if anyone else was having this problem, and knew    how
> to solve it?
> >
> >
> > By adding debugging messages to mythexport-daemon, as far as I
> > can see, the umask changes after startDaemon, which calls
> > Proc::Daemon::Init. According to the documentation for the latter,
> > changing the umask is normal behaviour. But as I say, I never had
> this problem with 12.04.
> >
> > Any ideas?
> >
> > John
> >
> >
>
> I don't know about cause, but you could solve it by wrapping the
> command in a small script:
>
> #!/bin/bash
> <your mythexport command>
> chmod 0666 <your export filename>
>
> This assuming the file is owned by the user running it. Else you have
> to use sudo and arrange for the right sudo rights.
>
> Tot mails,
>   Hika                            mailto:hikavdh at gmail.com
>
> "Zonder hoop kun je niet leven
> Zonder leven is er geen hoop
> Het eeuwige dilemma
> Zeker als je hoop moet vernietigen om te kunnen overleven!"
>
> De lerende Mens
>
>
I fixed this in my config module I created to user Handbrake rather then
the default avconv/ffmpeg profiles

you could add this line after the avconv command for which ever profile
your using or my full config profile is below

system("chmod 666 \'$self->{_outputFile}$self->{_extension}\'");

/usr/share/mythexport/configs/iPhoneHandbrake.pm

==cut==
#!/usr/bin/perl

package iPhoneHandbrake;

use ExportBase;

our @ISA = qw(ExportBase);

my $description = "Low Resolution (480x?) Handbrake H264 Settings.";
my $devices = "Handbrake iPhone & iPod Touch profile (example iPod Touch,
iPhone, iPad";
my $notes = "Requires Handbrake, <a href=\"
https://help.ubuntu.com/community/Medibuntu\">activate Medibuntu</a>";
my $version = "1.0";

sub new{
    my $class = shift;
    my $self = $class->SUPER::new(shift, shift, $description, $devices,
$notes, $version);
    bless $self, $class;
    return $self;
}

sub export{
    my( $self ) = @_;

    system("HandBrakeCLI -i \'$self->{_inputFile}\' -o
\'$self->{_outputFile}$self->{_extension}\' --preset='iPhone & iPod
Touch'");
    system("chmod 666 \'$self->{_outputFile}$self->{_extension}\'");
}

1;
==cut==

Cheers,

Anthony
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20160506/7b97128f/attachment-0001.html>


More information about the mythtv-users mailing list