I'm trying to run a chmod
command in rc.local
so that it gets executed at startup. The command enables the I2C
device to be accessed. However, I need to manually run rc.local
in order for it to work. I am using ubuntu 16.04 LTS.
Here is my rc.local
file:
#!/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.
sudo chmod 777 /dev/i2c-*
exit 0
rc.local
, note that Ubuntu employs systemd'src-local-generator
, and explicitly enablingrc-local.service
should thus not be necessary. – JdeBP Aug 09 '17 at 18:44