给定文件/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