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

asked Feb 22, 2018 at 5:58
5
  • try to avoid adding images instead of data in questions. Commented Feb 22, 2018 at 6:04
  • Please include the output of systemctl status startup1.service. Commented Feb 22, 2018 at 6: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 Commented Feb 22, 2018 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. Commented Feb 22, 2018 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 Commented Feb 23, 2018 at 3:09

1 Answer 1

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:

answered Feb 23, 2018 at 9:18
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.