How to Autorun a program using busybox after boot?
I am using an embedded linux with busybox. I would like to automatically run my app called "myApplication" (runlevel 5 after boot all the services are up).
What I have done so far:
- I made a script under /etc/init.d/ called S90myscript
- Then I added this line to the inittab:
::sysinit:/etc/init.d/S90myscript
The script contains the following:
! /bin/sh
### BEGIN INIT INFO
# Provides: myApplication
# Should-Start: $all
# Required-Start: $remote_fs $network $local_fs
# Required-Stop: $remote_fs
# Default-Start: 5
# Default-Stop: 0 6
# Short-Description: start myprogram at boot time
### END INIT INFO
#
set -e
. /lib/lsb/init-functions
PATH=/root:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin
PROGRAMNAME="myApplication"
case "$1" in
start)
$PROGRAMNAME
;;
stop)
skill $PROGRAMNAME
;;
esac
exit 0
Am I missing something? Symlinks? Is what I did wrong?
Thank you in advance
startup busybox buildroot autostart
add a comment |
I am using an embedded linux with busybox. I would like to automatically run my app called "myApplication" (runlevel 5 after boot all the services are up).
What I have done so far:
- I made a script under /etc/init.d/ called S90myscript
- Then I added this line to the inittab:
::sysinit:/etc/init.d/S90myscript
The script contains the following:
! /bin/sh
### BEGIN INIT INFO
# Provides: myApplication
# Should-Start: $all
# Required-Start: $remote_fs $network $local_fs
# Required-Stop: $remote_fs
# Default-Start: 5
# Default-Stop: 0 6
# Short-Description: start myprogram at boot time
### END INIT INFO
#
set -e
. /lib/lsb/init-functions
PATH=/root:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin
PROGRAMNAME="myApplication"
case "$1" in
start)
$PROGRAMNAME
;;
stop)
skill $PROGRAMNAME
;;
esac
exit 0
Am I missing something? Symlinks? Is what I did wrong?
Thank you in advance
startup busybox buildroot autostart
1
Please don't post images of text. Copy and paste the text itself into your question and format it as code by selecting it and pressing Ctrl-K or by using the editor's{}icon.
– cas
Feb 21 '18 at 1:34
add a comment |
I am using an embedded linux with busybox. I would like to automatically run my app called "myApplication" (runlevel 5 after boot all the services are up).
What I have done so far:
- I made a script under /etc/init.d/ called S90myscript
- Then I added this line to the inittab:
::sysinit:/etc/init.d/S90myscript
The script contains the following:
! /bin/sh
### BEGIN INIT INFO
# Provides: myApplication
# Should-Start: $all
# Required-Start: $remote_fs $network $local_fs
# Required-Stop: $remote_fs
# Default-Start: 5
# Default-Stop: 0 6
# Short-Description: start myprogram at boot time
### END INIT INFO
#
set -e
. /lib/lsb/init-functions
PATH=/root:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin
PROGRAMNAME="myApplication"
case "$1" in
start)
$PROGRAMNAME
;;
stop)
skill $PROGRAMNAME
;;
esac
exit 0
Am I missing something? Symlinks? Is what I did wrong?
Thank you in advance
startup busybox buildroot autostart
I am using an embedded linux with busybox. I would like to automatically run my app called "myApplication" (runlevel 5 after boot all the services are up).
What I have done so far:
- I made a script under /etc/init.d/ called S90myscript
- Then I added this line to the inittab:
::sysinit:/etc/init.d/S90myscript
The script contains the following:
! /bin/sh
### BEGIN INIT INFO
# Provides: myApplication
# Should-Start: $all
# Required-Start: $remote_fs $network $local_fs
# Required-Stop: $remote_fs
# Default-Start: 5
# Default-Stop: 0 6
# Short-Description: start myprogram at boot time
### END INIT INFO
#
set -e
. /lib/lsb/init-functions
PATH=/root:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin
PROGRAMNAME="myApplication"
case "$1" in
start)
$PROGRAMNAME
;;
stop)
skill $PROGRAMNAME
;;
esac
exit 0
Am I missing something? Symlinks? Is what I did wrong?
Thank you in advance
startup busybox buildroot autostart
startup busybox buildroot autostart
edited Feb 21 '18 at 10:54
JigglyNaga
3,918932
3,918932
asked Feb 20 '18 at 12:22
AJ GSAJ GS
65
65
1
Please don't post images of text. Copy and paste the text itself into your question and format it as code by selecting it and pressing Ctrl-K or by using the editor's{}icon.
– cas
Feb 21 '18 at 1:34
add a comment |
1
Please don't post images of text. Copy and paste the text itself into your question and format it as code by selecting it and pressing Ctrl-K or by using the editor's{}icon.
– cas
Feb 21 '18 at 1:34
1
1
Please don't post images of text. Copy and paste the text itself into your question and format it as code by selecting it and pressing Ctrl-K or by using the editor's
{} icon.– cas
Feb 21 '18 at 1:34
Please don't post images of text. Copy and paste the text itself into your question and format it as code by selecting it and pressing Ctrl-K or by using the editor's
{} icon.– cas
Feb 21 '18 at 1:34
add a comment |
1 Answer
1
active
oldest
votes
Found the solution.
- I placed "myApplication" in /usr/sbin/
- Created a symlink named myApp to the script located in /etc/init.d/S99myAppScript
(notice that there is no .sh and I had to run sudo chmod 755 on this script) - Added the following line at the end of "rcS" file located in /etc/init.d/ just before the command "done":
myApp &
After rebooting the system, myApplication autoruns.
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%2f425389%2fhow-to-autorun-a-program-using-busybox-after-boot%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
Found the solution.
- I placed "myApplication" in /usr/sbin/
- Created a symlink named myApp to the script located in /etc/init.d/S99myAppScript
(notice that there is no .sh and I had to run sudo chmod 755 on this script) - Added the following line at the end of "rcS" file located in /etc/init.d/ just before the command "done":
myApp &
After rebooting the system, myApplication autoruns.
add a comment |
Found the solution.
- I placed "myApplication" in /usr/sbin/
- Created a symlink named myApp to the script located in /etc/init.d/S99myAppScript
(notice that there is no .sh and I had to run sudo chmod 755 on this script) - Added the following line at the end of "rcS" file located in /etc/init.d/ just before the command "done":
myApp &
After rebooting the system, myApplication autoruns.
add a comment |
Found the solution.
- I placed "myApplication" in /usr/sbin/
- Created a symlink named myApp to the script located in /etc/init.d/S99myAppScript
(notice that there is no .sh and I had to run sudo chmod 755 on this script) - Added the following line at the end of "rcS" file located in /etc/init.d/ just before the command "done":
myApp &
After rebooting the system, myApplication autoruns.
Found the solution.
- I placed "myApplication" in /usr/sbin/
- Created a symlink named myApp to the script located in /etc/init.d/S99myAppScript
(notice that there is no .sh and I had to run sudo chmod 755 on this script) - Added the following line at the end of "rcS" file located in /etc/init.d/ just before the command "done":
myApp &
After rebooting the system, myApplication autoruns.
answered Feb 21 '18 at 10:38
AJ GSAJ GS
65
65
add a comment |
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%2f425389%2fhow-to-autorun-a-program-using-busybox-after-boot%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
Please don't post images of text. Copy and paste the text itself into your question and format it as code by selecting it and pressing Ctrl-K or by using the editor's
{}icon.– cas
Feb 21 '18 at 1:34