puppet service resource, enable, init script order

805 Views Asked by At

In puppet, if you enable a service like this:

service { 'myservice':
    ensure => running,
    enable => true,
    subscribe => File['/etc/init.d/myservice'];
}

file { '/etc/init.d/myservice':
    source => "puppet:///modules/myservice/myservice",
    ensure => file,
    owner => root,
    group => root,
    mode => '0755',
 }

Then puppet creates /etc/rc3.d/S??myservice and in my case, it always creates S65myservice. Where does the 65 come from? If puppet is choosing 65 consistently, it must be determined somewhere, but I don't know how it's making that decision. How do I make this service start later in the boot process? (for example S99myservice)

1

There are 1 best solutions below

0
Edward Ned Harvey On

The order can be changed by adding a chkconfig clause to the startup script, such as:

#!/bin/sh
#
# chkconfig: 35 59 80

The above service should start at run level 3 and 5 using startup order 59, and shutdown order 80.
http://lpetr.org/blog/archives/startup-order-of-services-on-rhel-or-centos