Acabei de encontrar a resposta: no meu upstart 1.5, ele apenas funciona com *.conf
files.
Teste:
Eu criei dois arquivos /etc/init/zzservice.conf
e /etc/init/yyservice.conf.20130507
. Primeiro um trabalharia enquanto o segundo não. Funcionou quando mudei o nome do segundo para /etc/init/yyservice.conf
, ou seja, terminando com .conf
.
# cat /etc/init/zzservice.conf
script
exec su - root -c 'echo "this is a test" > /tmp/testservice'
end script
start on (started network-interface
or started network-manager
or started networking)
stop on (stopping network-interface
or stopping network-manager
or stopping networking)
# service zzservice restart
stop: Unknown instance:
zzservice start/running, process 5839
#
# service yyservice restart
yyservice: unrecognized service
#
# mv yyservice.conf.20130507 yyservice.conf
#
# service yyservice restart
stop: Unknown instance:
yyservice start/running, process 5866
#