Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

My doubt is: does it apply to every *.conf file or to all of them? 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.


Update with OS and init information:

$ 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
NAME="Ubuntu"
VERSION="12.10, Quantal Quetzal"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu quantal (12.10)"
VERSION_ID="12.10"

$ init --version
init (upstart 1.5)
Copyright (C) 2012 Scott James Remnant, Canonical Ltd.
share|improve this question
    
To what version of what OS are you referring? –  Jonathan Ben-Avraham May 7 '13 at 10:40
    
This depends very much on which init daemon you're using (or which OS and distribution). For example, upstart init (Ubuntu) and openrc init (Gentoo) behave very differently. –  jpaugh May 7 '13 at 10:41
    
I am on Ubuntu 12.10, @JonathanBen-Avraham . Just updated the post with this info. –  fedorqui May 7 '13 at 10:49
    
It is upstart 1.5, @jpaugh. Just updated the post with this info. –  fedorqui May 7 '13 at 10:50
    
I'm pretty sure upstart only runs files ending with .conf, but that's from reading the man pages, and I'm out of touch with Ubuntu. –  jpaugh May 7 '13 at 10:52

1 Answer 1

up vote 2 down vote accepted

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

Test:

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 

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
# 
share|improve this answer
2  
+1 for finding your own answer. –  jpaugh May 7 '13 at 11:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.