4

I'm working on a project and I hope you can help me solve a problem.

I have four programs that are written in C. They have been compiled using gcc and they work as they should. Because the four programs are drivers for some devices, I need to start them again if the PC resets for any reason, or if the power supply is lost.

In the programs I have some parts where I am printing some statuses, and for the moment I start the programs using a console.

How can I start the programs on startup in Linux Mint?

Is it possible on startup to activate four consoles and with the consoles so start the program? If not do I have to transfer the output of the programs in file? (Four devices is connected to the PC via four serial ports.)

3

You could include execution of your programs in /etc/rc.local file for them to be started automatically. Furthermore, you'd need to redirect the output to meaningful files so that you can inspect them later. In other words, in /etc/rc.local add something like this before the exit 0 line:

/path/to/program/program1 >> /path/to/output/file/program1.output
/path/to/program/program2 >> /path/to/output/file/program2.output
/path/to/program/program3 >> /path/to/output/file/program3.output
/path/to/program/program4 >> /path/to/output/file/program4.output

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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