run c program at startup

2019-09-06 18:44发布

问题:

I am a beginner to linux programming. What I want to do is, run a C "Hello World" program at startup. Once the user logs in, run that C program. How can I achieve this?

I am running Ubuntu 8.04.

回答1:

"Desktop Application Autostart Specification"



回答2:

you can create a script inside /etc/init.d/myScriptName which inside this script you start you program

remember to give chmod +x to your script to give execution permissions



回答3:

I've done that on my machine.

First, in your menu bar, click System, then Preferences, then click Sessions.

A list of startup programs will be shown. click + button and add your script.

This might differ on linux distro. But at least you got the idea.



回答4:

I solved it by writing a bash script



标签: linux