Hi,
I want to run a simple script to print a "Hello World" statement upon reboot. I followed the solutions provided in this link https://e2e.ti.com/support/processors/f/791/t/669550. However, I cannot get the script to run each time I reboot. However, if I test it manually using "systemctl status ", I can see it print. I suspect the service is not executed. Can you help me?
Below is my /lib/systemd/system/smarlins.service:
[Unit]
Description=Smarlins startup services
[Service]
Type=simple
ExecStart=/home/root/smarlins.sh
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
Below is my /home/root/smarlins.sh:
#!/bin/sh
echo "Hello world"
I entered the following to register the service:
root@am57xx-evm:~# chmod 644 /lib/systemd/system/smarlins.service
root@am57xx-evm:~# chmod 755 /home/root/smarlins.sh
root@am57xx-evm:~# systemctl enable smarlins.service
root@am57xx-evm:~# systemctl daemon-reload
Below is the printout for executing "systemctl status smarlins.service":
��● smarlins.service - Smarlins startup services
Loaded: loaded (/lib/systemd/system/smarlins.service; enabled; vendor preset:
enabled)
Active: inactive (dead) since Sun 2020-04-19 02:13:40 UTC; 14min ago
Process: 223 ExecStart=/home/root/smarlins.sh (code=exited, status=0/SUCCESS)
Main PID: 223 (code=exited, status=0/SUCCESS)
Apr 19 02:13:40 am57xx-evm smarlins.sh[223]: Hello world
Apr 19 02:13:39 am57xx-evm systemd[1]: Started Smarlins startup services.
Thanks for your help.
CB