rc.local can't find my script The 2019 Stack Overflow Developer Survey Results Are InPurpose and typical usage of /etc/rc.localrc.local - not all commands are executedWhat's the difference between /etc/rc.local and /etc/init.d/rc.local?Why doesn't rc.local run entirelySystemd vs rc.local for a startup script post installation? (completely hands free)rc.local can't launch my program (raspbian linux)Can't run my scriptHow to configure rc.local with shell?I cant get my sh script to run at boot in rc.localInteraction with /etc/rc.localDifference in rc.local and lxde autostart
How to save as into a customized destination on macOS?
Can one be advised by a professor who is very far away?
Have you ever entered Singapore using a different passport or name?
What to do when moving next to a bird sanctuary with a loosely-domesticated cat?
What do the Banks children have against barley water?
Can a rogue use sneak attack with weapons that have the thrown property even if they are not thrown?
Why is the maximum length of OpenWrt’s root password 8 characters?
Deal with toxic manager when you can't quit
What is the closest word meaning "respect for time / mindful"
Loose spokes after only a few rides
The difference between dialogue marks
Can someone be penalized for an "unlawful" act if no penalty is specified?
If a Druid sees an animal’s corpse, can they wild shape into that animal?
Geography at the pixel level
How to type this arrow in math mode?
What tool would a Roman-age civilization have for the breaking of silver and other metals into dust?
Identify boardgame from Big movie
Why isn't airport relocation done gradually?
What does ひと匙 mean in this manga and has it been used colloquially?
How to deal with fear of taking dependencies
How are circuits which use complex ICs normally simulated?
Which Sci-Fi work first showed weapon of galactic-scale mass destruction?
Protecting Dualbooting Windows from dangerous code (like rm -rf)
Are there incongruent pythagorean triangles with the same perimeter and same area?
rc.local can't find my script
The 2019 Stack Overflow Developer Survey Results Are InPurpose and typical usage of /etc/rc.localrc.local - not all commands are executedWhat's the difference between /etc/rc.local and /etc/init.d/rc.local?Why doesn't rc.local run entirelySystemd vs rc.local for a startup script post installation? (completely hands free)rc.local can't launch my program (raspbian linux)Can't run my scriptHow to configure rc.local with shell?I cant get my sh script to run at boot in rc.localInteraction with /etc/rc.localDifference in rc.local and lxde autostart
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am trying to get my script to run on startup. I am using Ubuntu Server 16.04.
Here are the exact contents of /etc/r.local.
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sleep 1
/home/myusername/myscript.sh 15 &
exit 0
Here's relevant output from /var/log/syslog, when starting up:
rc.local[1157]: /etc/rc.local: 15: /etc/rc.local: /home/myusername/myscript.sh: not found
The script in question has all needed permissions AFAICT.
myusername@myserver:~$ ls -l /home/myusername/myscript.sh
-rwxr-xr-x 1 root root 199 Jan 23 09:19 /myusername/myscript.sh
When manually executing rc.local or my script, it runs fine.
What could be some reasons that rc.local can't access the file on startup?
scripting startup
add a comment |
I am trying to get my script to run on startup. I am using Ubuntu Server 16.04.
Here are the exact contents of /etc/r.local.
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sleep 1
/home/myusername/myscript.sh 15 &
exit 0
Here's relevant output from /var/log/syslog, when starting up:
rc.local[1157]: /etc/rc.local: 15: /etc/rc.local: /home/myusername/myscript.sh: not found
The script in question has all needed permissions AFAICT.
myusername@myserver:~$ ls -l /home/myusername/myscript.sh
-rwxr-xr-x 1 root root 199 Jan 23 09:19 /myusername/myscript.sh
When manually executing rc.local or my script, it runs fine.
What could be some reasons that rc.local can't access the file on startup?
scripting startup
2
the sh-bang line of /home/myusername/myscript.sh is suspect; can you post it?
– Jeff Schaller♦
Jan 29 '18 at 20:31
6
Is/home
mounted at boot-time whenrc.local
is executing?
– DopeGhoti
Jan 29 '18 at 20:34
If by sh-bang line you mean the first line, this is it:#!/bin/bash
– P. Mensch
Jan 30 '18 at 0:07
How do I determine when/home
is mounted?
– P. Mensch
Jan 30 '18 at 0:08
add a comment |
I am trying to get my script to run on startup. I am using Ubuntu Server 16.04.
Here are the exact contents of /etc/r.local.
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sleep 1
/home/myusername/myscript.sh 15 &
exit 0
Here's relevant output from /var/log/syslog, when starting up:
rc.local[1157]: /etc/rc.local: 15: /etc/rc.local: /home/myusername/myscript.sh: not found
The script in question has all needed permissions AFAICT.
myusername@myserver:~$ ls -l /home/myusername/myscript.sh
-rwxr-xr-x 1 root root 199 Jan 23 09:19 /myusername/myscript.sh
When manually executing rc.local or my script, it runs fine.
What could be some reasons that rc.local can't access the file on startup?
scripting startup
I am trying to get my script to run on startup. I am using Ubuntu Server 16.04.
Here are the exact contents of /etc/r.local.
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sleep 1
/home/myusername/myscript.sh 15 &
exit 0
Here's relevant output from /var/log/syslog, when starting up:
rc.local[1157]: /etc/rc.local: 15: /etc/rc.local: /home/myusername/myscript.sh: not found
The script in question has all needed permissions AFAICT.
myusername@myserver:~$ ls -l /home/myusername/myscript.sh
-rwxr-xr-x 1 root root 199 Jan 23 09:19 /myusername/myscript.sh
When manually executing rc.local or my script, it runs fine.
What could be some reasons that rc.local can't access the file on startup?
scripting startup
scripting startup
edited Jan 29 '18 at 20:31
Jeff Schaller♦
44.9k1164147
44.9k1164147
asked Jan 29 '18 at 20:27
P. MenschP. Mensch
61
61
2
the sh-bang line of /home/myusername/myscript.sh is suspect; can you post it?
– Jeff Schaller♦
Jan 29 '18 at 20:31
6
Is/home
mounted at boot-time whenrc.local
is executing?
– DopeGhoti
Jan 29 '18 at 20:34
If by sh-bang line you mean the first line, this is it:#!/bin/bash
– P. Mensch
Jan 30 '18 at 0:07
How do I determine when/home
is mounted?
– P. Mensch
Jan 30 '18 at 0:08
add a comment |
2
the sh-bang line of /home/myusername/myscript.sh is suspect; can you post it?
– Jeff Schaller♦
Jan 29 '18 at 20:31
6
Is/home
mounted at boot-time whenrc.local
is executing?
– DopeGhoti
Jan 29 '18 at 20:34
If by sh-bang line you mean the first line, this is it:#!/bin/bash
– P. Mensch
Jan 30 '18 at 0:07
How do I determine when/home
is mounted?
– P. Mensch
Jan 30 '18 at 0:08
2
2
the sh-bang line of /home/myusername/myscript.sh is suspect; can you post it?
– Jeff Schaller♦
Jan 29 '18 at 20:31
the sh-bang line of /home/myusername/myscript.sh is suspect; can you post it?
– Jeff Schaller♦
Jan 29 '18 at 20:31
6
6
Is
/home
mounted at boot-time when rc.local
is executing?– DopeGhoti
Jan 29 '18 at 20:34
Is
/home
mounted at boot-time when rc.local
is executing?– DopeGhoti
Jan 29 '18 at 20:34
If by sh-bang line you mean the first line, this is it:
#!/bin/bash
– P. Mensch
Jan 30 '18 at 0:07
If by sh-bang line you mean the first line, this is it:
#!/bin/bash
– P. Mensch
Jan 30 '18 at 0:07
How do I determine when
/home
is mounted?– P. Mensch
Jan 30 '18 at 0:08
How do I determine when
/home
is mounted?– P. Mensch
Jan 30 '18 at 0:08
add a comment |
1 Answer
1
active
oldest
votes
If you've got rights to change rc.local
you're also able to place your script into /usr/local/bin
, or /usr/bin
, or even /bin
if necessary, which are more likely to be available at boot time than /home
, which may be located on a different drive or partition.
Also read more about the usage of rc.local
to make sure it's the right place to do what you intend. And be careful of what you do in that script, as it may mess up your boot process.
/usr/local/bin
did not work. Same problem, rc.local can't find the file.
– P. Mensch
Jan 30 '18 at 23:06
Also, I'm just trying to get a simple script to run on startup and it seemed that using rc.local was the simplest way to do so. I was in fact following the directions of a guide.
– P. Mensch
Jan 30 '18 at 23:07
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%2f420505%2frc-local-cant-find-my-script%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
If you've got rights to change rc.local
you're also able to place your script into /usr/local/bin
, or /usr/bin
, or even /bin
if necessary, which are more likely to be available at boot time than /home
, which may be located on a different drive or partition.
Also read more about the usage of rc.local
to make sure it's the right place to do what you intend. And be careful of what you do in that script, as it may mess up your boot process.
/usr/local/bin
did not work. Same problem, rc.local can't find the file.
– P. Mensch
Jan 30 '18 at 23:06
Also, I'm just trying to get a simple script to run on startup and it seemed that using rc.local was the simplest way to do so. I was in fact following the directions of a guide.
– P. Mensch
Jan 30 '18 at 23:07
add a comment |
If you've got rights to change rc.local
you're also able to place your script into /usr/local/bin
, or /usr/bin
, or even /bin
if necessary, which are more likely to be available at boot time than /home
, which may be located on a different drive or partition.
Also read more about the usage of rc.local
to make sure it's the right place to do what you intend. And be careful of what you do in that script, as it may mess up your boot process.
/usr/local/bin
did not work. Same problem, rc.local can't find the file.
– P. Mensch
Jan 30 '18 at 23:06
Also, I'm just trying to get a simple script to run on startup and it seemed that using rc.local was the simplest way to do so. I was in fact following the directions of a guide.
– P. Mensch
Jan 30 '18 at 23:07
add a comment |
If you've got rights to change rc.local
you're also able to place your script into /usr/local/bin
, or /usr/bin
, or even /bin
if necessary, which are more likely to be available at boot time than /home
, which may be located on a different drive or partition.
Also read more about the usage of rc.local
to make sure it's the right place to do what you intend. And be careful of what you do in that script, as it may mess up your boot process.
If you've got rights to change rc.local
you're also able to place your script into /usr/local/bin
, or /usr/bin
, or even /bin
if necessary, which are more likely to be available at boot time than /home
, which may be located on a different drive or partition.
Also read more about the usage of rc.local
to make sure it's the right place to do what you intend. And be careful of what you do in that script, as it may mess up your boot process.
answered Jan 30 '18 at 11:35
MurphyMurphy
1,7861718
1,7861718
/usr/local/bin
did not work. Same problem, rc.local can't find the file.
– P. Mensch
Jan 30 '18 at 23:06
Also, I'm just trying to get a simple script to run on startup and it seemed that using rc.local was the simplest way to do so. I was in fact following the directions of a guide.
– P. Mensch
Jan 30 '18 at 23:07
add a comment |
/usr/local/bin
did not work. Same problem, rc.local can't find the file.
– P. Mensch
Jan 30 '18 at 23:06
Also, I'm just trying to get a simple script to run on startup and it seemed that using rc.local was the simplest way to do so. I was in fact following the directions of a guide.
– P. Mensch
Jan 30 '18 at 23:07
/usr/local/bin
did not work. Same problem, rc.local can't find the file.– P. Mensch
Jan 30 '18 at 23:06
/usr/local/bin
did not work. Same problem, rc.local can't find the file.– P. Mensch
Jan 30 '18 at 23:06
Also, I'm just trying to get a simple script to run on startup and it seemed that using rc.local was the simplest way to do so. I was in fact following the directions of a guide.
– P. Mensch
Jan 30 '18 at 23:07
Also, I'm just trying to get a simple script to run on startup and it seemed that using rc.local was the simplest way to do so. I was in fact following the directions of a guide.
– P. Mensch
Jan 30 '18 at 23:07
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%2f420505%2frc-local-cant-find-my-script%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
2
the sh-bang line of /home/myusername/myscript.sh is suspect; can you post it?
– Jeff Schaller♦
Jan 29 '18 at 20:31
6
Is
/home
mounted at boot-time whenrc.local
is executing?– DopeGhoti
Jan 29 '18 at 20:34
If by sh-bang line you mean the first line, this is it:
#!/bin/bash
– P. Mensch
Jan 30 '18 at 0:07
How do I determine when
/home
is mounted?– P. Mensch
Jan 30 '18 at 0:08