Trouble making an executable as a service
I would like this to run as a service on my Ubuntu server 18.x...
https://github.com/xiaodoudou/PlexIPTV
I have downloaded the linux x64 file, made it executable in my home folder and tried to run it. I also setup the initial settings.json file in the same folder. It worked out fine, so to get it as a service I tried following this guide:
How can I make an executable run as a service?
So I made the file in /etc/systemd/system/
, looking like the following:
[Unit]
Description=Plex IPTV-Tuner
After=network-online.target
[Service]
Type=simple
User=plex
Group=plex
UMask=007
ExecStart=/usr/bin/PlexIPTV/PlexIPTV.linux-x64
Restart=on-failure
# Configures the time to wait before service is stopped forcefully.
TimeoutStopSec=300
[Install]
WantedBy=multi-user.target
I also moved the executable well as the settings.json
file to /usr/bin/PlexIPTV/
Now, when I try to run the folder I get the error that it's not allowed to open /settings.json
.
I've tried to chmod 777 -R /usr/bin/PlexIPTV/
as well as chown plex:plex -R /usr/bin/PlexIPTV
but it do not help.
Exact error I get:
● plex-iptv-tuner.service - Plex IPTV-Tuner
Loaded: loaded (/etc/systemd/system/plex-iptv-tuner.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sun 2019-03-10 13:09:02 CET; 1s ago
Process: 16218 ExecStart=/usr/bin/PlexIPTV/PlexIPTV.linux-x64 (code=exited, status=0/SUCCESS)
Main PID: 16218 (code=exited, status=0/SUCCESS)
Mar 10 13:09:02 media systemd[1]: Started Plex IPTV-Tuner.
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.397Z plexiptv:config:verbose 2019/03/10 13:09:02.3960 🔭 init Getting settings...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.398Z plexiptv:config:verbose 2019/03/10 13:09:02.3970 🔭 readSettings Reading file...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.399Z plexiptv:config:verbose 2019/03/10 13:09:02.3990 🔭 __dirname.readSettings.fs.readFile Didn't found file, injecting template...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.410Z plexiptv:config:error 2019/03/10 13:09:02.4090 🔥 __dirname.init.Q.fcall.then.then.catch.error Error happen during setting pulling:
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: [ { Error: EACCES: permission denied, open '/settings.json'
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: errno: -13,
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: code: 'EACCES',
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: syscall: 'open',
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: path: '/settings.json' } ]
ubuntu systemd
add a comment |
I would like this to run as a service on my Ubuntu server 18.x...
https://github.com/xiaodoudou/PlexIPTV
I have downloaded the linux x64 file, made it executable in my home folder and tried to run it. I also setup the initial settings.json file in the same folder. It worked out fine, so to get it as a service I tried following this guide:
How can I make an executable run as a service?
So I made the file in /etc/systemd/system/
, looking like the following:
[Unit]
Description=Plex IPTV-Tuner
After=network-online.target
[Service]
Type=simple
User=plex
Group=plex
UMask=007
ExecStart=/usr/bin/PlexIPTV/PlexIPTV.linux-x64
Restart=on-failure
# Configures the time to wait before service is stopped forcefully.
TimeoutStopSec=300
[Install]
WantedBy=multi-user.target
I also moved the executable well as the settings.json
file to /usr/bin/PlexIPTV/
Now, when I try to run the folder I get the error that it's not allowed to open /settings.json
.
I've tried to chmod 777 -R /usr/bin/PlexIPTV/
as well as chown plex:plex -R /usr/bin/PlexIPTV
but it do not help.
Exact error I get:
● plex-iptv-tuner.service - Plex IPTV-Tuner
Loaded: loaded (/etc/systemd/system/plex-iptv-tuner.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sun 2019-03-10 13:09:02 CET; 1s ago
Process: 16218 ExecStart=/usr/bin/PlexIPTV/PlexIPTV.linux-x64 (code=exited, status=0/SUCCESS)
Main PID: 16218 (code=exited, status=0/SUCCESS)
Mar 10 13:09:02 media systemd[1]: Started Plex IPTV-Tuner.
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.397Z plexiptv:config:verbose 2019/03/10 13:09:02.3960 🔭 init Getting settings...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.398Z plexiptv:config:verbose 2019/03/10 13:09:02.3970 🔭 readSettings Reading file...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.399Z plexiptv:config:verbose 2019/03/10 13:09:02.3990 🔭 __dirname.readSettings.fs.readFile Didn't found file, injecting template...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.410Z plexiptv:config:error 2019/03/10 13:09:02.4090 🔥 __dirname.init.Q.fcall.then.then.catch.error Error happen during setting pulling:
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: [ { Error: EACCES: permission denied, open '/settings.json'
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: errno: -13,
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: code: 'EACCES',
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: syscall: 'open',
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: path: '/settings.json' } ]
ubuntu systemd
1
Do you actually get a "permission denied" error, or do you get "file not found"? I'm asking because I see no reason for it to look forsettings.json
in the root (/
) directory.
– Kusalananda
Mar 10 at 12:21
1
@Kusalananda added the full error.
– Jesper.Lindberg
Mar 10 at 12:24
"I've tried tochmod 777 -R /usr/bin/PlexIPTV/
..." - NEVER do that; it gives every user and every process on your system write access to that directory, which can easily turn a smaller security problem into a much bigger one.
– marcelm
Mar 10 at 14:08
@marcelm yeah I know, I was just running mad when it kept saying that it did not have the permission.
– Jesper.Lindberg
Mar 11 at 8:46
add a comment |
I would like this to run as a service on my Ubuntu server 18.x...
https://github.com/xiaodoudou/PlexIPTV
I have downloaded the linux x64 file, made it executable in my home folder and tried to run it. I also setup the initial settings.json file in the same folder. It worked out fine, so to get it as a service I tried following this guide:
How can I make an executable run as a service?
So I made the file in /etc/systemd/system/
, looking like the following:
[Unit]
Description=Plex IPTV-Tuner
After=network-online.target
[Service]
Type=simple
User=plex
Group=plex
UMask=007
ExecStart=/usr/bin/PlexIPTV/PlexIPTV.linux-x64
Restart=on-failure
# Configures the time to wait before service is stopped forcefully.
TimeoutStopSec=300
[Install]
WantedBy=multi-user.target
I also moved the executable well as the settings.json
file to /usr/bin/PlexIPTV/
Now, when I try to run the folder I get the error that it's not allowed to open /settings.json
.
I've tried to chmod 777 -R /usr/bin/PlexIPTV/
as well as chown plex:plex -R /usr/bin/PlexIPTV
but it do not help.
Exact error I get:
● plex-iptv-tuner.service - Plex IPTV-Tuner
Loaded: loaded (/etc/systemd/system/plex-iptv-tuner.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sun 2019-03-10 13:09:02 CET; 1s ago
Process: 16218 ExecStart=/usr/bin/PlexIPTV/PlexIPTV.linux-x64 (code=exited, status=0/SUCCESS)
Main PID: 16218 (code=exited, status=0/SUCCESS)
Mar 10 13:09:02 media systemd[1]: Started Plex IPTV-Tuner.
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.397Z plexiptv:config:verbose 2019/03/10 13:09:02.3960 🔭 init Getting settings...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.398Z plexiptv:config:verbose 2019/03/10 13:09:02.3970 🔭 readSettings Reading file...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.399Z plexiptv:config:verbose 2019/03/10 13:09:02.3990 🔭 __dirname.readSettings.fs.readFile Didn't found file, injecting template...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.410Z plexiptv:config:error 2019/03/10 13:09:02.4090 🔥 __dirname.init.Q.fcall.then.then.catch.error Error happen during setting pulling:
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: [ { Error: EACCES: permission denied, open '/settings.json'
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: errno: -13,
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: code: 'EACCES',
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: syscall: 'open',
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: path: '/settings.json' } ]
ubuntu systemd
I would like this to run as a service on my Ubuntu server 18.x...
https://github.com/xiaodoudou/PlexIPTV
I have downloaded the linux x64 file, made it executable in my home folder and tried to run it. I also setup the initial settings.json file in the same folder. It worked out fine, so to get it as a service I tried following this guide:
How can I make an executable run as a service?
So I made the file in /etc/systemd/system/
, looking like the following:
[Unit]
Description=Plex IPTV-Tuner
After=network-online.target
[Service]
Type=simple
User=plex
Group=plex
UMask=007
ExecStart=/usr/bin/PlexIPTV/PlexIPTV.linux-x64
Restart=on-failure
# Configures the time to wait before service is stopped forcefully.
TimeoutStopSec=300
[Install]
WantedBy=multi-user.target
I also moved the executable well as the settings.json
file to /usr/bin/PlexIPTV/
Now, when I try to run the folder I get the error that it's not allowed to open /settings.json
.
I've tried to chmod 777 -R /usr/bin/PlexIPTV/
as well as chown plex:plex -R /usr/bin/PlexIPTV
but it do not help.
Exact error I get:
● plex-iptv-tuner.service - Plex IPTV-Tuner
Loaded: loaded (/etc/systemd/system/plex-iptv-tuner.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sun 2019-03-10 13:09:02 CET; 1s ago
Process: 16218 ExecStart=/usr/bin/PlexIPTV/PlexIPTV.linux-x64 (code=exited, status=0/SUCCESS)
Main PID: 16218 (code=exited, status=0/SUCCESS)
Mar 10 13:09:02 media systemd[1]: Started Plex IPTV-Tuner.
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.397Z plexiptv:config:verbose 2019/03/10 13:09:02.3960 🔭 init Getting settings...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.398Z plexiptv:config:verbose 2019/03/10 13:09:02.3970 🔭 readSettings Reading file...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.399Z plexiptv:config:verbose 2019/03/10 13:09:02.3990 🔭 __dirname.readSettings.fs.readFile Didn't found file, injecting template...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.410Z plexiptv:config:error 2019/03/10 13:09:02.4090 🔥 __dirname.init.Q.fcall.then.then.catch.error Error happen during setting pulling:
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: [ { Error: EACCES: permission denied, open '/settings.json'
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: errno: -13,
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: code: 'EACCES',
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: syscall: 'open',
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: path: '/settings.json' } ]
ubuntu systemd
ubuntu systemd
edited Mar 10 at 12:34
Jesper.Lindberg
asked Mar 10 at 12:16
Jesper.LindbergJesper.Lindberg
254
254
1
Do you actually get a "permission denied" error, or do you get "file not found"? I'm asking because I see no reason for it to look forsettings.json
in the root (/
) directory.
– Kusalananda
Mar 10 at 12:21
1
@Kusalananda added the full error.
– Jesper.Lindberg
Mar 10 at 12:24
"I've tried tochmod 777 -R /usr/bin/PlexIPTV/
..." - NEVER do that; it gives every user and every process on your system write access to that directory, which can easily turn a smaller security problem into a much bigger one.
– marcelm
Mar 10 at 14:08
@marcelm yeah I know, I was just running mad when it kept saying that it did not have the permission.
– Jesper.Lindberg
Mar 11 at 8:46
add a comment |
1
Do you actually get a "permission denied" error, or do you get "file not found"? I'm asking because I see no reason for it to look forsettings.json
in the root (/
) directory.
– Kusalananda
Mar 10 at 12:21
1
@Kusalananda added the full error.
– Jesper.Lindberg
Mar 10 at 12:24
"I've tried tochmod 777 -R /usr/bin/PlexIPTV/
..." - NEVER do that; it gives every user and every process on your system write access to that directory, which can easily turn a smaller security problem into a much bigger one.
– marcelm
Mar 10 at 14:08
@marcelm yeah I know, I was just running mad when it kept saying that it did not have the permission.
– Jesper.Lindberg
Mar 11 at 8:46
1
1
Do you actually get a "permission denied" error, or do you get "file not found"? I'm asking because I see no reason for it to look for
settings.json
in the root (/
) directory.– Kusalananda
Mar 10 at 12:21
Do you actually get a "permission denied" error, or do you get "file not found"? I'm asking because I see no reason for it to look for
settings.json
in the root (/
) directory.– Kusalananda
Mar 10 at 12:21
1
1
@Kusalananda added the full error.
– Jesper.Lindberg
Mar 10 at 12:24
@Kusalananda added the full error.
– Jesper.Lindberg
Mar 10 at 12:24
"I've tried to
chmod 777 -R /usr/bin/PlexIPTV/
..." - NEVER do that; it gives every user and every process on your system write access to that directory, which can easily turn a smaller security problem into a much bigger one.– marcelm
Mar 10 at 14:08
"I've tried to
chmod 777 -R /usr/bin/PlexIPTV/
..." - NEVER do that; it gives every user and every process on your system write access to that directory, which can easily turn a smaller security problem into a much bigger one.– marcelm
Mar 10 at 14:08
@marcelm yeah I know, I was just running mad when it kept saying that it did not have the permission.
– Jesper.Lindberg
Mar 11 at 8:46
@marcelm yeah I know, I was just running mad when it kept saying that it did not have the permission.
– Jesper.Lindberg
Mar 11 at 8:46
add a comment |
1 Answer
1
active
oldest
votes
I also setup the initial settings.json file in the same folder. It worked out fine, so to get it as a service...
In the systemd service, set WorkingDirectory
.
1
Setting thePLEXIPTV_SETTINGS
environment variable and using the--settings
command-line option are alternatives.
– JdeBP
Mar 10 at 12:55
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f505459%2ftrouble-making-an-executable-as-a-service%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I also setup the initial settings.json file in the same folder. It worked out fine, so to get it as a service...
In the systemd service, set WorkingDirectory
.
1
Setting thePLEXIPTV_SETTINGS
environment variable and using the--settings
command-line option are alternatives.
– JdeBP
Mar 10 at 12:55
add a comment |
I also setup the initial settings.json file in the same folder. It worked out fine, so to get it as a service...
In the systemd service, set WorkingDirectory
.
1
Setting thePLEXIPTV_SETTINGS
environment variable and using the--settings
command-line option are alternatives.
– JdeBP
Mar 10 at 12:55
add a comment |
I also setup the initial settings.json file in the same folder. It worked out fine, so to get it as a service...
In the systemd service, set WorkingDirectory
.
I also setup the initial settings.json file in the same folder. It worked out fine, so to get it as a service...
In the systemd service, set WorkingDirectory
.
answered Mar 10 at 12:40
sourcejedisourcejedi
25.2k443109
25.2k443109
1
Setting thePLEXIPTV_SETTINGS
environment variable and using the--settings
command-line option are alternatives.
– JdeBP
Mar 10 at 12:55
add a comment |
1
Setting thePLEXIPTV_SETTINGS
environment variable and using the--settings
command-line option are alternatives.
– JdeBP
Mar 10 at 12:55
1
1
Setting the
PLEXIPTV_SETTINGS
environment variable and using the --settings
command-line option are alternatives.– JdeBP
Mar 10 at 12:55
Setting the
PLEXIPTV_SETTINGS
environment variable and using the --settings
command-line option are alternatives.– JdeBP
Mar 10 at 12:55
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f505459%2ftrouble-making-an-executable-as-a-service%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Do you actually get a "permission denied" error, or do you get "file not found"? I'm asking because I see no reason for it to look for
settings.json
in the root (/
) directory.– Kusalananda
Mar 10 at 12:21
1
@Kusalananda added the full error.
– Jesper.Lindberg
Mar 10 at 12:24
"I've tried to
chmod 777 -R /usr/bin/PlexIPTV/
..." - NEVER do that; it gives every user and every process on your system write access to that directory, which can easily turn a smaller security problem into a much bigger one.– marcelm
Mar 10 at 14:08
@marcelm yeah I know, I was just running mad when it kept saying that it did not have the permission.
– Jesper.Lindberg
Mar 11 at 8:46