startup process error

Hi,

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 http://stackoverflow.com/questions/11152657/angstrom-start-up-processes-beaglebone

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

[Unit]
Description=ball and plate
After=syslog.target network.target
[Service]
WorkingDirectory=/opt/bap
Type=simple
ExecStart=/opt/bap ./bap
[Install]
WantedBy=multi-user.target

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
debian@beaglebone:/opt/bap$ 

How to fix it?

Jan

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 → http://www.embeddedhobbyist.com/debian-tips/beaglebone-black/beaglebone-black-init-scripts-default-gatewayand-ntpdate/

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:

[Unit]
Description=Ball and Plate

[Service]
WorkingDirectory=/opt/bap
ExecStart=/opt/bap runbap
SyslogIdentifier=bap

and my /opt/bap/bap.sh is

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

The service is installed, but fails on execution.