I'm trying to start the systemd service during boot once fstab entries mounted.
I have followed Set systemd service to execute after fstab mount and added below details
# cat /etc/fstab
/dev/mmcblk1p11 /data ext4 defaults 0 2
# systemctl list-units | grep '/data' | awk '{ print $1 }'
data.mount
# cat /usr/lib/systemd/system/data.service
[Unit]
Description=My system
After=data.mount
[Service]
Type=oneshot
ExecStartPre=mountpoint -q /data
ExecStart=/usr/etc/data.sh
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Problem is, it won't start during boot. However, the manual restart seems working.
# systemctl status data.service
data.service - My system
Loaded: loaded (/usr/lib/systemd/system/data.service; disabled; vendor preset: enabled)
Active: inactive (dead)
# systemctl enable data.service
Created symlink /etc/systemd/system/multi-user.target.wants/data.service ��→ /usr/lib/systemd/system/data.service.
# systemctl restart data.service
Starting My system...
[ OK ] Started My system.
Did I miss anything?