【问题标题】:Ubuntu Xenial upstart service not found未找到 Ubuntu Xenial 新贵服务
【发布时间】:2017-03-24 11:07:52
【问题描述】:

我有一个新贵服务,只需将我的 conf 存储在/etc/init/test.conf,它就可以正常工作。现在我已经升级到 Xenial 16.04.2 LTS,我遇到了找不到服务的问题。

现在需要 systemd 脚本吗?如果您仍然可以仅使用 conf 文件来获得新贵,我该怎么做才能解决这个问题?

下面是一个示例 from digital ocean,它演示了这个问题:

ubuntu@vagrant:~$ sudo ls -la /etc/init/test.conf 
-rw-r--r-- 1 root root 126 Mar 24 10:54 /etc/init/test.conf
ubuntu@vagrant:~$ sudo cat /etc/init/test.conf 
description "Job that runs the foo daemon"
start on runlevel [2345]
exec echo Test Job ran at  `date` >> /var/log/testjob.log
ubuntu@vagrant:~$ sudo service test status
● test.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)
ubuntu@vagrant:~$ sudo service test start
Failed to start test.service: Unit test.service not found.

【问题讨论】:

  • 不解释就投反对票?

标签: linux ubuntu ubuntu-14.04 ubuntu-16.04 upstart


【解决方案1】:

Xenial Xerus 使用 systemd 而不是 upstart。来自the release notes for Xenial

Ubuntu 15.10 或 Debian Jessie 的用户可能已经熟悉 systemd,它现在是大多数主流 GNU/Linux 发行版的默认初始化系统。在 Ubuntu 上,systemd 取代了 Canonical 的 Upstart。

如果您使用自定义初始化脚本,或定期配置长时间运行的服务,您将需要了解 systemd 的基础知识。如需概览,请阅读Systemd Essentials: Working with Services, Units, and the Journal

This guide 也可能很有用,从 Vivid 出来的时候开始。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-12-07
    • 2013-09-23
    • 1970-01-01
    • 2018-03-24
    • 2017-01-13
    • 2015-05-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多