我在哪里可以在 Ubuntu 中配置服务启动选项?

del*_*ray 12 linux init ubuntu linux-kvm

我不习惯使用 Ubuntu 或 Debian 作为服务器。我更习惯于 Red Hat/Fedora 方式,甚至是 Gentoo(哎呀)。

在 Red Hat 安装下,您通常可以使用由服务命名的 /etc/sysconfig 中的配置文件来配置大多数从 init 启动的服务。在 Ubuntu 下有没有等价的东西?

具体来说,就命令行选项而言,我试图控制 libvirtd 和 kvm 进程的启动方式。我需要在某处添加 --listen 选项。

Den*_*son 11

Ubuntu 和 Debian 使用Upstart作为 的替代品init,但init支持旧脚本。您可以在脚本中添加/etc/init.d与服务同名的选项。也期待在/etc/init.conf控制运行级别是服务启动和停止的,他们是如何重生等文件


小智 7

首先使用以下命令找到要更改的配置:

systemctl list-unit-files
Run Code Online (Sandbox Code Playgroud)

然后使用以下命令更改特定配置:

sudo systemctl edit --full rocketchat.service
Run Code Online (Sandbox Code Playgroud)