Files in /etc/init – are all files executed or just the ones with conf extension


I have some files in /etc/init that I am still testing. As far as I know all files in this directory are executed on boot.

My question is: does it apply to every *.conf file or to all of the files in the directory? What if I want to backup one file: would /etc/init/someinit.conf.20130507 be executed?

I checked the man page but could not find any clear explanation about it.

These are my OS and init informations:

$ uname -a
Linux me 3.5.0-21-generic #32-Ubuntu SMP Tue Dec 11 18:51:59 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/os-release
VERSION="12.10, Quantal Quetzal"
PRETTY_NAME="Ubuntu quantal (12.10)"

$ init --version
init (upstart 1.5)
Copyright (C) 2012 Scott James Remnant, Canonical Ltd.

Best Answer

Just found the answer: in my upstart 1.5 it just works with *.conf files.


I created two files /etc/init/zzservice.conf and /etc/init/yyservice.conf.20130507. First one would work while the second not. It worked when I changed the name of the second to /etc/init/yyservice.conf, that is, finishing with .conf.

# cat /etc/init/zzservice.conf 

  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