I had installed (via terminal) Meocloud, a portuguese cloud program, and it works. The only problem is that the program (the way it was created) does not start automatically after every boot of the raspberry… it’s necessary everytime connect via ssh (e.g.) and in the terminal enter the command “meocloud start”… anyone knows how to, in a script, automatically access the terminal and enter the “meocloud start”?
Thanks in advance.
You can use rc.local to run program on startup.
how i can do that in the rc.local? what to write?
Check here:
I already tried but didn’t work, I’ll try again (later)… I’m still a little new in these wanderings, just have to insert the command in rc.local before the exit? or the path of the program with the start command (this i didn’t remenber to try:/)?
Try to enter the whole path to program, before the exit line.
Thank you. I will try.
Just remember:
applications are run as the root user when they are called from rc.local. We recommend you use ‘su osmc -c /path/to/your/program’ to run the application as the default OSMC user.
Alternative to what @ooZee wrote you could do it with crontab @reboot if it doesn’t depend on any other service
i have tried everything with rc.local and crontab… its doesn’t work
for ex: in crontab for testing i had tried like this:
20 * * * * root cd /opt/meocloud/cli && meocloud start
20 * * * * root /opt/meocloud/cli/meocloud
20 * * * * root /opt/meocloud/cli/restart_meocloud.sh
either changed the user to osmc… and nothing
is anything wrong (or right) on this?
What is the output of ls -lah /opt/meocloud/cli/meocloud
?
What can you find in sudo journalctl
for the time the cronjob should run?
the output:
-rwxr-xr-x 3 root root 2.4M Apr 24 2015 /opt/meocloud/cli/meocloud
in sudo journalctl:
(root) CMD (/opt/meocloud/cli/meocloud)
(CRON) info (No MTA installed, discarding output)
I didn’t notice… it was a compatibility problem because it was running the command and/or script in root… I solved it like this “sudo -u, --user=osmc meocloud start”