I just received a Pi 3 B+. I've installed Stretch Lite and have the Pi starting from USB. I've created a systemd service that should start after i2c is active during boot (I've got i2c enabled and working), but I get the following error
Code: Select all
systemctl status startmsg.service
startmsg.service - LCD Message
Loaded: loaded (/lib/systemd/system/startmsg.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2018-08-28 11:08:51 CDT; 2h 16min ago
Process: 88 ExecStart=/home/pi/startmsg (code=exited, status=1/FAILURE)
Main PID: 88 (code=exited, status=1/FAILURE)
Aug 28 11:08:51 raspberrypi startmsg[88]: Unable to open I2C device: No such file or directory
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
This is the service I created:
Code: Select all
[Unit]
Description=LCD Message
DefaultDependencies=false
Requires=systemd-modules-load.service
After=systemd-modules.load.service
Before=sysvinit.target
ConditionPathExists=/sys/class/i2c-adapter
[Service]
Type=oneshot
ExecStart=/home/pi/startmsg
Restart=no
[Install]
WantedBy=sysinit.target