repeatedly getting invalid_service errors

Support for security such as Firewalls and securing linux
Post Reply
Aeducan
Posts: 1
Joined: 2019/02/13 04:40:09

repeatedly getting invalid_service errors

Post by Aeducan » 2019/02/13 04:46:03

I am trying to set up a plex server on 7 minimal and every time i try to run

Code: Select all

firewall-cmd --permanent --add-service=plexmediaserver
i am receiving Error: INVALID_SERVICE: 'plexmediaserver' not among existing services. I created a plexmediaserver.xml file in /etc/firewalld/services and dont understand what i am missing. Thanks in advance

pjsr2
Posts: 439
Joined: 2014/03/27 20:11:07

Re: repeatedly getting invalid_service errors

Post by pjsr2 » 2019/02/13 13:14:09

Did you do a

Code: Select all

firewall-cmd --reload
after you added the plexmediaserver.xml file?

buffalosolja42
Posts: 1
Joined: 2019/04/01 00:33:48

Re: repeatedly getting invalid_service errors

Post by buffalosolja42 » 2019/04/01 00:36:18

I am having the same issue and will be following this thread. I thought it was me but noticed that other items in firewalld/services would take the command. Thanks for all your help :)

User avatar
TrevorH
Forum Moderator
Posts: 27407
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: repeatedly getting invalid_service errors

Post by TrevorH » 2019/04/02 15:34:51

Show us the contents of the file in question and also the output from ls -laZ against it.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

atremblay
Posts: 3
Joined: 2016/02/09 00:03:33

Re: repeatedly getting invalid_service errors

Post by atremblay » 2019/12/13 01:11:02

i have the same problem, here is the content ans la -laZ of the file :

[root@localhost home]# ls -laZ /etc/firewalld/services/plexmediaserver.xml
-rw-r--r--. 1 root root unconfined_u:object_r:firewalld_etc_rw_t:s0 88 Dec 13 19:52 /etc/firewalld/services/plexmediaserver.xml
[root@localhost home]#



content of the file :

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

  plexmediaserver
  Plex TV Media Server







~

User avatar
TrevorH
Forum Moderator
Posts: 27407
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: repeatedly getting invalid_service errors

Post by TrevorH » 2019/12/13 01:59:26

That file is not valid. Did you create it and from where did you find what to put inside it?

If you want to create a valid one, look at the existing files in /usr/lib/firewalld/services/, find the one most similar to plex and copy that to /etc/firewalld/services/plexmediaserver.xml and amend that. For example, in my directory I have a file minidlna.xml and that contains a valid xml definition for the two ports that the minidlna server needs to have opened. I've never run plex so have no idea what ports it uses.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

atremblay
Posts: 3
Joined: 2016/02/09 00:03:33

Re: repeatedly getting invalid_service errors

Post by atremblay » 2019/12/14 12:34:48

File not valid ? hahha makes sens :)

i was following the instructions on this webpage :

https://forums.plex.tv/t/plex-media-ser ... 7-0/104153

i have created using vi, but i am far from being a linux expert, so that explains a lot hahahaha

from this webpage, plex uses ports 32400, 32410, 32412, 32414

i will do a copy of an existing file and edit it to see if it solves my problem, thanks !

atremblay
Posts: 3
Joined: 2016/02/09 00:03:33

Re: repeatedly getting invalid_service errors

Post by atremblay » 2019/12/14 13:04:28

ok, i took a look at valid examples in /usr/lib/firewalld/services/, and indeed, the formatting of my example file was soooo wrong !

with extra digging, i managed to make it work.

this is the new content of the plexmediaserver.xml :


<?xml version="1.0" encoding="utf-8"?>
<service>
<short>plexmediaserver</short>
<description>Ports required by plexmediaserver.</description>
<port protocol="tcp" port="32400"></port>
<port protocol="udp" port="1900"></port>
<port protocol="tcp" port="3005"></port>
<port protocol="udp" port="5353"></port>
<port protocol="tcp" port="8324"></port>
<port protocol="udp" port="32410"></port>
<port protocol="udp" port="32412"></port>
<port protocol="udp" port="32413"></port>
<port protocol="udp" port="32414"></port>
<port protocol="tcp" port="32469"></port>
</service>

after tiping
> systemctl stop plexmediaserver.service
> firewall-cmd --permanent --add-service=plexmediaserver
> systemctl restart firewalld.service
> systemctl start plexmediaserver.service

The problem was solved

Thanls a lot for your help!!!!

User avatar
TrevorH
Forum Moderator
Posts: 27407
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: repeatedly getting invalid_service errors

Post by TrevorH » 2019/12/14 14:11:19

You might want to post that to that plex thread too so that others that try to use that invalid file know about the problem.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - Security Support”