I wrote a program in C to control LCD display and buttons, compiled it and it works. But I can't manage to get it to start automatically at boot. So, after compiling, I moved my program to /usr/bin and did:
$this->bbcode_second_pass_code('', 'chmod a+x board')
Then I created a script called board.service in /usr/lib/systemd/system/ with following content:
$this->bbcode_second_pass_code('', '
[Unit]
Description=playback_buttons
[Service]
ExecStart=/usr/bin/board
[Install]
WantedBy=multi-user.target')
And executed
$this->bbcode_second_pass_code('', 'systemctl enable board.service')
But nothing, it just doesn't work. Then I tried in different folder, /etc/systemd/system, and called it board2.service and again:
$this->bbcode_second_pass_code('', 'systemctl enable board2.service')
Still nothing. Then I tried to create a shell script with following content:
$this->bbcode_second_pass_code('', '
#!/bin/sh
/usr/bin/board
')
And then in board.service and board2.service I replaced ExecStart=/usr/bin/board with ExecStart=/usr/bin/board.sh. I tried to chmod board.sh also but no progress. But it works when I execute
$this->bbcode_second_pass_code('', '/usr/bin/board.sh')
Before this, I had a program for controlling buttons in a .sh script and I made it start on boot on this way successfully, but with this C program, it just doesn't work. What am I doing wrong?