![initctl 没有列出,启动作业](https://linux22.com/image/888171/initctl%20%E6%B2%A1%E6%9C%89%E5%88%97%E5%87%BA%EF%BC%8C%E5%90%AF%E5%8A%A8%E4%BD%9C%E4%B8%9A.png)
给定文件/etc/init/somejob.conf
定义为:
# somejob - testing job init
description "start or stop test"
script
$(readlink -f $(which echo)) hey
end script
不会出现initctl list
(重启后也不会出现)并且无法调用start
:
CANTANDO init # init-checkconf -d /etc/init/somejob.conf
DEBUG: upstart_path=/sbin/upstart
DEBUG: initctl_path=/sbin/initctl
DEBUG: Setting XDG_RUNTIME_DIR='/tmp/init-checkconf.vsmNHz1rYD'
DEBUG: Unsetting UPSTART_SESSION (unix:abstract=/com/ubuntu/upstart-session/1000/1734)
DEBUG: confdir=/tmp/init-checkconf.QM6a9aX0XM
DEBUG: file=/etc/init/somejob.conf
DEBUG: job=somejob
DEBUG: upstart_out=/tmp/init-checkconf-upstart-output.ja4gR1vtyW
DEBUG: upstart_cmd=/sbin/upstart --user --no-dbus --no-startup-event --verbose --confdir /tmp/init-checkconf.QM6a9aX0XM
DEBUG: Upstart pid=3573
DEBUG: Waiting for Upstart to initialise (attempt 1)
DEBUG: Joining Upstart session 'unix:abstract=/com/ubuntu/upstart-session/0/3573'
DEBUG: Waiting for Upstart to initialise (attempt 2)
DEBUG: Secondary Upstart (/sbin/upstart --user --no-dbus --no-startup-event --verbose --confdir /tmp/init-checkconf.QM6a9aX0XM) running with PID 3573
File /etc/init/somejob.conf: syntax ok
DEBUG: Restoring XDG_RUNTIME_DIR to '/run/user/1000'
DEBUG: Restoring UPSTART_SESSION to 'unix:abstract=/com/ubuntu/upstart-session/1000/1734'
DEBUG: Stopping secondary Upstart (running with PID 3573)
CANTANDO init # initctl reload-configuration
CANTANDO init # initctl list | grep some
CANTANDO init # start somejob
start: Unknown job: somejob
CANTANDO init # initctl start somejob
initctl: Unknown job: somejob
syslog
什么也没显示。
阅读新贵食谱和手册页我找不到使用以下方法安装服务需要的其他步骤暴发户除了添加文件之外/etc/init/servicename.conf
。有人能发现我遗漏了什么吗?
使用 Ubuntu 16.04,upstart 1.13.2