Move service definition after template is put in place

The service block fails on initial run if the init.d file is not already in place. Swapping the order of these operations seems to fix things.