startup process error


I want to autostart the program on boot on BBB debian.
My executable is located in /opt/bap and I can start it from terminal by ./bap
Following the instruction from here

the file bap.service in /lib/systemd/system/ has the content:

Description=ball and plate
ExecStart=/opt/bap ./bap

then I did:

systemctl enable bap.service
systemctl start bap.service

All was good, but
debian@beaglebone:/opt/bap$ sudo systemctl status bap.service
bap.service - ball and plate
	  Loaded: loaded (/lib/systemd/system/bap.service; enabled)
	  Active: failed (Result: exit-code) since Fri, 26 Sep 2014 03:03:42 +0000; 4s ago
	 Process: 6515 ExecStart=/opt/bap ./bap (code=exited, status=203/EXEC)
	  CGroup: name=systemd:/system/bap.service

Sep 26 03:03:42 beaglebone (bap)[6515]: Failed at step EXEC spawning /opt/ba...d

How to fix it?


Can't start in in a cron job ?

I need it to autostart when the BBB is powered on.

I can not say for systemd, I’ve toyed with it myself but documentation online does not seem to be very . . . complete or useful

So, init.d →

init scripts work just fine side by side with systemd. Ideal solution ? Hell if i know, but it will work.

Good suggestion and it works. Couldn’t make it with systemd however and I’m curious why.
It is a GUI application and possibly I made some syntax error.
my bap.service file is:

Description=Ball and Plate

ExecStart=/opt/bap runbap

and my /opt/bap/ is

#! /bin/bash
echo “waiting…”
sleep 20
echo “changing cpufreq”
sudo cpufreq-set -g performance
sudo cpufreq-info

The service is installed, but fails on execution.