在Fedora 8 Core上运行startupscript

时间:2021-11-06 07:07:58

I'm using Amazon EC2 with a Fedora 8 Core AMI. I have an EBS volume mounted at /ebsmnt, and a startupscript located at /ebsmnt/startupscript.sh . Currently I have to login to the server, cd to /ebsmnt/ and run the script manually. How can I make Fedora run this script automatically at startup, without any interaction from me? (by having it on /ebsmnt/ I don't have to recompile the AMI everytime I wish to make changes to the script). I'm not too familiar with *nix, so a step by step guide would be very much appreciated.

我正在使用带有Fedora 8 Core AMI的Amazon EC2。我在/ ebsmnt上安装了一个EBS卷,在/ebsmnt/startupscript.sh上安装了一个启动脚本。目前我必须登录服务器,cd到/ ebsmnt /并手动运行脚本。如何让Fedora在启动时自动运行此脚本,而不与我进行任何交互? (通过将它放在/ ebsmnt /我不必每次都要重新编译AMI我希望对脚本进行更改)。我对* nix不太熟悉,所以非常感谢一步一步的指导。

1 个解决方案

#1


The contents of the file /etc/rc.local are executed on startup.
note: You will have to add the full path to the script.

文件/etc/rc.local的内容在启动时执行。注意:您必须添加脚本的完整路径。

Does the script understand the "Start" and "Stop" parameters? If so it could be added to the runlevels.

脚本是否理解“开始”和“停止”参数?如果是这样,它可以添加到运行级别。

#1


The contents of the file /etc/rc.local are executed on startup.
note: You will have to add the full path to the script.

文件/etc/rc.local的内容在启动时执行。注意:您必须添加脚本的完整路径。

Does the script understand the "Start" and "Stop" parameters? If so it could be added to the runlevels.

脚本是否理解“开始”和“停止”参数?如果是这样,它可以添加到运行级别。