gpt4 book ai didi

command - 如何在启动时运行命令?

转载 作者:行者123 更新时间:2023-12-04 14:02:13 24 4
gpt4 key购买 nike

我试图弄清楚如何在启动时运行命令,就像我将它输入到控制台一样。我在 Raspberry Pi 上使用 Rasbian,但我认为这个问题对于 Debian 来说是一样的。我试图运行的命令是:

sudo screen mono server.exe

我尝试了以下解决方案,但由于我刚开始使用 Linux,我不确定这是否正确。
 #! /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在底部,放任何你想要的。

关于command - 如何在启动时运行命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16823361/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com