我添加了一个名为 的脚本kafka,它运行两个永无止境的服务(kafka 服务器和 zookeeper)
我已经添加了这个脚本放到/etc/init.d
而且还增加了profile对
nano ~/.profile
Run Code Online (Sandbox Code Playgroud)
现在,当我打开我的Ubuntu, 并输入我的密码后,屏幕看起来像是被锁定了,等待脚本结束。
但是现在我无法访问我的虚拟机上的任何内容。
题:
如果有任何方法可以解决此问题并删除我添加的脚本?
它永远保持这样......
我想在 Ubuntu 服务器 16.04 启动后(而不是登录后)在名为Zookeeper的用户下启动 Zookeeper 守护进程。所以我改变了文件/etc/rc.local如下:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo 'never'; defrag_file_pathname
su -c '$ZOOKEEPER_HOME/bin/zkServer.sh start' zookeeper & …Run Code Online (Sandbox Code Playgroud) 我创建了一个/etc/rc.local:
$ cat /etc/rc.local
#!/bin/bash
echo "Starting"
randomString=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
echo "Finished"
Run Code Online (Sandbox Code Playgroud)
这在交互式运行时运行:
$ /etc/rc.local
Starting
Finished: lkFcvByNaIu7zmxuCYB3BQmJ05LwuVWL
Run Code Online (Sandbox Code Playgroud)
但是,当从 systemd 运行时,它会挂起并且不会返回。
如果我 ctrl+C 看起来它挂在fold命令上:
$ systemctl status rc-local
? rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/lib/systemd/system/rc-local.service; enabled-runtime; vendor preset: enabl
Drop-In: /lib/systemd/system/rc-local.service.d
??debian.conf
Active: activating (start) since Mon 2019-03-11 12:04:06 UTC; 12s ago
Docs: man:systemd-rc-local-generator(8)
Cntrl PID: 936 (rc.local)
Tasks: 5 (limit: 1152)
CGroup: /system.slice/rc-local.service …Run Code Online (Sandbox Code Playgroud) 我已经看到了几种在 Ubuntu 12.04 中添加程序或守护程序以启动的方法,但我不确定每种方法,主要是因为我不了解底层的启动过程。我需要
在 Windows 中,我们可以添加应用程序/批处理脚本以在启动时自动打开。Ubuntu 或 Linux 中是否有类似的东西?
当您启动机器并按 shift 调出 grub 菜单,然后按 e 在以 开头的菜单中进行更改时setparams 'Ubuntu, with Linux 3.16.0-30genric',您如何防止人们对该菜单进行更改,例如添加ro recovery nomodeset
我主要必须使用终端,但问题是我的 Ubuntu 20.04 桌面启动很慢。Ubuntu 和制造商的标志出现后加载需要一些时间。
Ubuntu Server 是否比 Desktop 消耗更少的 RAM,并且它是否提供更快的登录?