0

i have a shell script which i require to run during boot i have followed the link

Executing a script on startup using BeagleBone Black

by this, the service is getting created but when i check by using systemctl, it is showing failed

enter image description here

can anyone help me

  • try to avoid adding images instead of data in questions. – Vikas Periyadath Feb 22 '18 at 06:04
  • Please include the output of `systemctl status startup1.service`. – TBR Feb 22 '18 at 06:41
  • startup1.service - startup1 Loaded: loaded (/lib/systemd/startup1.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2018-01-28 14:16:59 UTC; 8min ago Main PID: 1139 (startup1.sh) Tasks: 5 (limit: 4915) CGroup: /system.slice/startup1.service ├─1139 /bin/sh /usr/bin/startup1.sh ├─1327 /bin/sh /home/debian/bin/HLC/runscript_text_display_1.08.sh ├─1373 /bin/sh /home/debian/bin/HLC/init.sh ├─1400 /bin/bash /home/debian/bin/HLC/write_rtc_time.sh └─3272 /home/debian/bin/HLC/send_data_to_lcd.o – madhuri depuru Feb 22 '18 at 12:28
  • I meant to include it in the question, iow edit the question. By the limited information I can glean it actually looks like it's running just fine. – TBR Feb 22 '18 at 16:25
  • i am not undertanding the same..i could see active running..but my script is starting and getting failed in less than 10 sec – madhuri depuru Feb 23 '18 at 03:09

1 Answers1

1

I had the same issue last days. Your problem is related to the "Type" field in "[Service]" part. Your are using Type=simple which execute at the beginning without wait for the other resource necessary to use your script. By changing to Type=idle should solve the problem.

idle means that your script will execute after all the service are initiated.

A better approach is by looking the services that your script needs, and also writing the field "After=service_required_by_my_script.service service2_required_by_my_script.service ...and more" in the [Service] part.

Recommended literature:

Similar problem: