How to start a service at startup
I am using Ubuntu Server to make a Kodi box. I'm using kodi-standalone-service to do so. I have made a shell script (sudo -S <<< "password" systemctl start kodi) to start kodi. When I run it mannually it starts kodi as expected. I need it to run at startup though. The only way I could do so (or at least I thought) was to add @reboot /home/main/startupscript.sh to crontab.
And I did so. Now Ubuntu stops after the initial boot log whithout any meaningful error message. And I cant use the terminal. Can you guys help me?
Could it be something to do with xorg even though I have it installed? (clearly as I can run it manually) Maybe the command is ran too soon in the boot process?
linux boot shell-script crontab kodi
add a comment |
I am using Ubuntu Server to make a Kodi box. I'm using kodi-standalone-service to do so. I have made a shell script (sudo -S <<< "password" systemctl start kodi) to start kodi. When I run it mannually it starts kodi as expected. I need it to run at startup though. The only way I could do so (or at least I thought) was to add @reboot /home/main/startupscript.sh to crontab.
And I did so. Now Ubuntu stops after the initial boot log whithout any meaningful error message. And I cant use the terminal. Can you guys help me?
Could it be something to do with xorg even though I have it installed? (clearly as I can run it manually) Maybe the command is ran too soon in the boot process?
linux boot shell-script crontab kodi
1
I assume you’ve triedsystemctl enable kodi.service
– Appleoddity
Jan 5 at 6:07
add a comment |
I am using Ubuntu Server to make a Kodi box. I'm using kodi-standalone-service to do so. I have made a shell script (sudo -S <<< "password" systemctl start kodi) to start kodi. When I run it mannually it starts kodi as expected. I need it to run at startup though. The only way I could do so (or at least I thought) was to add @reboot /home/main/startupscript.sh to crontab.
And I did so. Now Ubuntu stops after the initial boot log whithout any meaningful error message. And I cant use the terminal. Can you guys help me?
Could it be something to do with xorg even though I have it installed? (clearly as I can run it manually) Maybe the command is ran too soon in the boot process?
linux boot shell-script crontab kodi
I am using Ubuntu Server to make a Kodi box. I'm using kodi-standalone-service to do so. I have made a shell script (sudo -S <<< "password" systemctl start kodi) to start kodi. When I run it mannually it starts kodi as expected. I need it to run at startup though. The only way I could do so (or at least I thought) was to add @reboot /home/main/startupscript.sh to crontab.
And I did so. Now Ubuntu stops after the initial boot log whithout any meaningful error message. And I cant use the terminal. Can you guys help me?
Could it be something to do with xorg even though I have it installed? (clearly as I can run it manually) Maybe the command is ran too soon in the boot process?
linux boot shell-script crontab kodi
linux boot shell-script crontab kodi
asked Jan 5 at 5:49
Zizico2Zizico2
31
31
1
I assume you’ve triedsystemctl enable kodi.service
– Appleoddity
Jan 5 at 6:07
add a comment |
1
I assume you’ve triedsystemctl enable kodi.service
– Appleoddity
Jan 5 at 6:07
1
1
I assume you’ve tried
systemctl enable kodi.service
– Appleoddity
Jan 5 at 6:07
I assume you’ve tried
systemctl enable kodi.service
– Appleoddity
Jan 5 at 6:07
add a comment |
1 Answer
1
active
oldest
votes
The proper way to start a service during the boot proccess in a system that uses systemd is by using the enable
option.
systemctl enable kodi.service
Regards.
Oh thank you. I had never used a service before. Should've done a little research xd. I've still got a problem though. I can't exit Kodi. When I do it terminates the X server and stays ok "closing log file.X server" until I reboot... (Power button or shutdown signal as I'm working on a virtual machine). Is it a problem with kodi-standalone-service?
– Zizico2
Jan 5 at 11:27
I have found a way around it. I can just use another tty. It' still bugging me though...
– Zizico2
Jan 5 at 11:40
Glad it worked. I haven't used this service, so I don't really know how it works.
– Manuel Florian
Jan 5 at 19:53
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2fsuperuser.com%2fquestions%2f1390792%2fhow-to-start-a-service-at-startup%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
The proper way to start a service during the boot proccess in a system that uses systemd is by using the enable
option.
systemctl enable kodi.service
Regards.
Oh thank you. I had never used a service before. Should've done a little research xd. I've still got a problem though. I can't exit Kodi. When I do it terminates the X server and stays ok "closing log file.X server" until I reboot... (Power button or shutdown signal as I'm working on a virtual machine). Is it a problem with kodi-standalone-service?
– Zizico2
Jan 5 at 11:27
I have found a way around it. I can just use another tty. It' still bugging me though...
– Zizico2
Jan 5 at 11:40
Glad it worked. I haven't used this service, so I don't really know how it works.
– Manuel Florian
Jan 5 at 19:53
add a comment |
The proper way to start a service during the boot proccess in a system that uses systemd is by using the enable
option.
systemctl enable kodi.service
Regards.
Oh thank you. I had never used a service before. Should've done a little research xd. I've still got a problem though. I can't exit Kodi. When I do it terminates the X server and stays ok "closing log file.X server" until I reboot... (Power button or shutdown signal as I'm working on a virtual machine). Is it a problem with kodi-standalone-service?
– Zizico2
Jan 5 at 11:27
I have found a way around it. I can just use another tty. It' still bugging me though...
– Zizico2
Jan 5 at 11:40
Glad it worked. I haven't used this service, so I don't really know how it works.
– Manuel Florian
Jan 5 at 19:53
add a comment |
The proper way to start a service during the boot proccess in a system that uses systemd is by using the enable
option.
systemctl enable kodi.service
Regards.
The proper way to start a service during the boot proccess in a system that uses systemd is by using the enable
option.
systemctl enable kodi.service
Regards.
answered Jan 5 at 6:15
Manuel FlorianManuel Florian
1595
1595
Oh thank you. I had never used a service before. Should've done a little research xd. I've still got a problem though. I can't exit Kodi. When I do it terminates the X server and stays ok "closing log file.X server" until I reboot... (Power button or shutdown signal as I'm working on a virtual machine). Is it a problem with kodi-standalone-service?
– Zizico2
Jan 5 at 11:27
I have found a way around it. I can just use another tty. It' still bugging me though...
– Zizico2
Jan 5 at 11:40
Glad it worked. I haven't used this service, so I don't really know how it works.
– Manuel Florian
Jan 5 at 19:53
add a comment |
Oh thank you. I had never used a service before. Should've done a little research xd. I've still got a problem though. I can't exit Kodi. When I do it terminates the X server and stays ok "closing log file.X server" until I reboot... (Power button or shutdown signal as I'm working on a virtual machine). Is it a problem with kodi-standalone-service?
– Zizico2
Jan 5 at 11:27
I have found a way around it. I can just use another tty. It' still bugging me though...
– Zizico2
Jan 5 at 11:40
Glad it worked. I haven't used this service, so I don't really know how it works.
– Manuel Florian
Jan 5 at 19:53
Oh thank you. I had never used a service before. Should've done a little research xd. I've still got a problem though. I can't exit Kodi. When I do it terminates the X server and stays ok "closing log file.X server" until I reboot... (Power button or shutdown signal as I'm working on a virtual machine). Is it a problem with kodi-standalone-service?
– Zizico2
Jan 5 at 11:27
Oh thank you. I had never used a service before. Should've done a little research xd. I've still got a problem though. I can't exit Kodi. When I do it terminates the X server and stays ok "closing log file.X server" until I reboot... (Power button or shutdown signal as I'm working on a virtual machine). Is it a problem with kodi-standalone-service?
– Zizico2
Jan 5 at 11:27
I have found a way around it. I can just use another tty. It' still bugging me though...
– Zizico2
Jan 5 at 11:40
I have found a way around it. I can just use another tty. It' still bugging me though...
– Zizico2
Jan 5 at 11:40
Glad it worked. I haven't used this service, so I don't really know how it works.
– Manuel Florian
Jan 5 at 19:53
Glad it worked. I haven't used this service, so I don't really know how it works.
– Manuel Florian
Jan 5 at 19:53
add a comment |
Thanks for contributing an answer to Super User!
- 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%2fsuperuser.com%2fquestions%2f1390792%2fhow-to-start-a-service-at-startup%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
I assume you’ve tried
systemctl enable kodi.service
– Appleoddity
Jan 5 at 6:07