我试图让 Byobu 在服务器启动时使用 Ubuntu Server 12.04 启动。
我已经想出了如何通过 screen 会话来做到这一点,但我希望它在Byobu 中具有所有添加的功能,而不是在 screen 中。
在start()屏幕的 init.d 脚本中,这是有效的行(在通过su - $USER -c "$USER_INIT; $1" >/dev/null && return 0---将环境更改为正确的用户后--- USER 和 USER_INIT 都正确填充,通过屏幕测试工作):
screen -U -S $SESSIONNAME -d -t $WCAPP -m $WCAPP
Run Code Online (Sandbox Code Playgroud)
替换screen为byobu或byobu-screen不起作用。我将后端设置为屏幕。
我不想编辑/.byobu/windows文件,因为在用户手动启动 byobu 后端之前它不会启动。
我使用的 $SESSIONNAME 是 weechat 而 $WCAPP 变量是 weechat-curses,我对使用文字值而不是传递变量没有任何争议。
谢谢你。
打开您的终端(CTRL+ ALT+ T),然后键入
nano /etc/rc.local
Run Code Online (Sandbox Code Playgroud)
然后在 exit 0 之前添加这一行
byobu -S boot-time mycommand &
Run Code Online (Sandbox Code Playgroud)
然后按ctrlx保存并关闭。