如何在启动时运行命令? [英] How can I run a command at boot?
本文介绍了如何在启动时运行命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图弄清楚如何在启动时运行命令,就像我在控制台中键入命令一样.我在我的Raspberry Pi上使用了Rasbian,但我认为这个问题对于Debian来说通常是相同的.我要运行的命令是:
I'm trying to figure out how to run a command at boot, like I would type it into the console. I'm using Rasbian with my Raspberry Pi, but I think this question is the same for Debian in general. The command I'm trying to run is:
sudo screen mono server.exe
我尝试了以下解决方案,但是由于我刚开始使用Linux,所以不确定是否正确.
I tried the following solution, but since I just started with Linux, I'm not sure if this is correct.
#! /bin/sh
# /etc/init.d/server
### BEGIN INIT INFO
# Provides: server
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Simple script to start a program at boot
# Description: ..
### END INIT INFO
# If you want a command to always run, put it here
sudo screen mono server.exe
exit 0
推荐答案
简单
运行cd ~
然后编辑.profile
在底部,放任何您想要的东西.
Simple
Run cd ~
Then edit .profile
At the bottom, put whatever you would like.
这篇关于如何在启动时运行命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文