run c program at startup

2019-09-06 18:34发布

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.

标签: linux
4条回答
一夜七次
2楼-- · 2019-09-06 18:47

I solved it by writing a bash script

查看更多
啃猪蹄的小仙女
4楼-- · 2019-09-06 18:58

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.

查看更多
我只想做你的唯一
5楼-- · 2019-09-06 19:00

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

查看更多
登录 后发表回答