I have a project and it is running a c program on the PI. The program is meant to start running at startup.

So far I have tried to do this with rclocal, but this is depricated. Afterwards I tried using SystemD, but I kept getting startup issues when the service tried to start. Now I would like to try crontab, but this is only documented for python.

Anybody who can help me out/got a solution?

  • 2
    If the program should run at startup, and keep running - like a service - then you need to solve your issues with systemd or switch to another init system. May 25, 2018 at 7:39
  • 2
    You can't "run a c program"; you can run a compiled program, and the language is irrelevant. crontab will run ANY executable. If you want an answer you need to say what YOU tried
    – Milliways
    May 25, 2018 at 8:59
  • Seems you have problems with any way to start your program at boot. The best way is to use systemd so I would suggest to fix the problems with it. What in detail was it?
    – Ingo
    May 25, 2018 at 10:59
  • We made a service with systemd, Enabeld it, so it should start running. But when the program started, it crashed. Afterwards we tried to run the program in the terminal. This worked fine.
    – J. Joly
    May 25, 2018 at 11:10
  • What did systemctl status yourservice and journalctl --pager-end --unit=yourservice say? How looks the yourservice.service file? Please address me with @ingo. Otherwise I don't get a notification about your comment.
    – Ingo
    May 25, 2018 at 13:26

1 Answer 1


I don't understand what you mean when you suggest crontab is only documented for Python. You clearly have not looked at the documentation as there is no mention of Python.

man 1 crontab

man 5 crontab

The documentation should always be looked at first.

Add an entry such as the following to your crontab (crontab -e).

@reboot /home/pi/myprog

Where myprog is your program and needs to be executable (chmod +x myprog).

If myprog references files make sure you give the full path (or cd into the expected working directory in the crontab command).

  • I've looked up some stuff for the raspberry pi. If you follow this link: link there stands documentation Cron for linux. So that was how I made my conclusion.
    – J. Joly
    May 25, 2018 at 11:17
  • 2
    The linked page does say "for example". The man pages are always worth studying.
    – joan
    May 25, 2018 at 11:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.