QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1424|回复: 14

请问在linux下如何让一个程序开机后自动运行?

[复制链接]
发表于 2004-11-24 19:12:06 | 显示全部楼层 |阅读模式
自己编译好了一个webserver,想让它在linux启动后自动运行?
请问该怎么做阿?
发表于 2004-11-24 21:02:42 | 显示全部楼层
主菜单──首选项──更多首选项──会话──启动程序──增加:
/路径/webserver即可。(以上为RH ES3系统)

另外,可否将你的webserver共享一下?!

================
回复

使用道具 举报

发表于 2004-11-24 21:05:36 | 显示全部楼层
主菜单──首选项──更多首选项──会话──启动程序──增加:
/路径/webserver即可。(以上为RH ES3系统)

另外,可否将你的webserver共享一下?!

================
回复

使用道具 举报

发表于 2004-11-24 21:51:36 | 显示全部楼层
在/etc/rc.d/rc.local里加入要运行的命令
回复

使用道具 举报

 楼主| 发表于 2004-11-24 22:28:30 | 显示全部楼层
to wkp : 我就用的goahead阿! 开源的,你直接到它的网站上去下载嘛webserver.goahead.com
回复

使用道具 举报

 楼主| 发表于 2004-11-25 16:52:38 | 显示全部楼层
假设我的程序在/usr/src 下, 文件名为webs ,在rclocal里该怎么加阿?我象这样加了
/usr/src/webs  但是重启后程序并没有运行阿!
回复

使用道具 举报

发表于 2004-11-25 16:57:15 | 显示全部楼层
/usr/src目录下一般都是源码,你确定可执行文件在那下面吗?
回复

使用道具 举报

 楼主| 发表于 2004-11-25 17:14:00 | 显示全部楼层
对阿,我执行过的,在命令窗口下输入/usr/src/webs,可以运行,webs就是可执行文件!
回复

使用道具 举报

发表于 2004-11-25 17:20:43 | 显示全部楼层
加入到rc.local不行吗,你是什么发行版,rc.local本身有可执行权限吗?
回复

使用道具 举报

 楼主| 发表于 2004-11-25 17:27:24 | 显示全部楼层
这是我修改后的rc.local文件!
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
                                                                                
touch /var/lock/subsys/local
/usr/src/webs       <------这行是我加的,
回复

使用道具 举报

发表于 2004-11-25 17:35:54 | 显示全部楼层
看上去没问题啊,这个webserver就是这么直接启动吗。
回复

使用道具 举报

 楼主| 发表于 2004-11-25 18:09:34 | 显示全部楼层
呵呵,就是的,启动了的,只不过由于页面没有在执行目录下,所以不能访问网页!可能在编译的时候改一下参数才行!谢谢板主了!
回复

使用道具 举报

发表于 2004-11-25 21:58:43 | 显示全部楼层
你可以先启动好然后关机前选择保存状态,以后应该就会自动启动了。如果你通过gdm登录,/etc/gdm/xsession哪个文件的最后可能要修改一下。我现在不在linux,记不得在哪里修改了……
回复

使用道具 举报

发表于 2005-2-1 16:09:04 | 显示全部楼层
我也加了一行
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
                                                                                
touch /var/lock/subsys/local
/etc/X11/xinit/xinitrc.d/xinput  --->我加了这行

我想让我的输入法自启动,但是我加过后,注销再登录,怎么没看到我的输入法自动运行 啊,但是我直接点该文件却能启动输入法
回复

使用道具 举报

发表于 2005-2-1 20:42:02 | 显示全部楼层
/etc/X11/xinit/xinitrc.d/xinput 这个是由X来启动的,具体在美化那里有X的启动机理!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-25 21:18 , Processed in 0.114213 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表