Permission denied in rc.local

10,075

The portion of the error message you want to look at is:

/etc/pm/power.d/99macbookair6: Permission denied

which says you do not have sufficient permission to execute /etc/pm/power.d/99macbookair6.

Even if you have some command here executable by you, you would still get permission denied error for:

echo 0 > /sys/module/hid_apple/parameters/iso_layout

In a nutshell, you can do:

service rc.local start

only when you have all entries in /etc/rc.local executable by you (and also rc.local must be readable by you obviously). Same goes for brothers of start i.e. stop, restart etc.


To get your current setup working, the most sane way is to run the command as root:

sudo service rc.local start
Share:
10,075

Related videos on Youtube

half-potato
Author by

half-potato

Updated on September 18, 2022

Comments

  • half-potato
    half-potato almost 2 years

    Here's the contents of my /etc/rc.local

    /etc/pm/power.d/99macbookair6 true
    echo 0 > /sys/module/hid_apple/parameters/iso_layout 
    exit 0
    

    running service rc.local start returns

    /etc/rc.local: 14: /etc/rc.local: /etc/pm/power.d/99macbookair6: Permission denied
    
    • edwinksl
      edwinksl almost 8 years
      You need to run it with sudo.
    • half-potato
      half-potato almost 8 years
      Thanks. However, it still doesn't run correctly on startup. Edit: Nevermind.
  • half-potato
    half-potato almost 8 years
    I did chmod 777 /etc/pm/power.d/99macbookair6