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;








1















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?










share|improve this question



















  • 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 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












  • How do I determine when /home is mounted?

    – P. Mensch
    Jan 30 '18 at 0:08

















1















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?










share|improve this question



















  • 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 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












  • How do I determine when /home is mounted?

    – P. Mensch
    Jan 30 '18 at 0:08













1












1








1








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?










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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












  • How do I determine when /home is mounted?

    – P. Mensch
    Jan 30 '18 at 0:08












  • 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 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












  • 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










1 Answer
1






active

oldest

votes


















0














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.






share|improve this answer























  • /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











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
);



);













draft saved

draft discarded


















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









0














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.






share|improve this answer























  • /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















0














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.






share|improve this answer























  • /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













0












0








0







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.






share|improve this answer













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.







share|improve this answer












share|improve this answer



share|improve this answer










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

















  • /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

















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.