Ask Your Question
1

Howto force systemd as service provider globally?

asked 2013-02-03 12:27:56 -0500

Jakub Viták gravatar image

Sorry for newbie question. Is there a way to force systemd for service provider globally on host? It should be default on Archlinux nowdays. Thank you for any response in advance.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
4

answered 2013-02-03 19:00:20 -0500

Stefan gravatar image

You can force puppet to pick a provider by specifying the provider parameter explicitly, like:

service { 'sshd':
  ensure   => running,
  provider => systemd,
}

If you always want to use this provider you'll have to specify a parameter default for the service resource. The concept is described here. In your case this would look like this:

if $::operatingsystem == 'ArchLinux' {
  Service {
    provider => systemd,
  }
}

If you write this in a class, the resource default will only be valid within that class, so if you want to have a global default you should probably place that into your site.pp file.

I'd also encourage ... (more)

edit flag offensive delete link more
0

answered 2013-05-11 01:28:29 -0500

Use :

Service { 
  provider => systemd,
}

--> all your services will use the provider 'systemd', unless you override it, for example :

service { 'sshd':
  ensure   => running,
  provider => init,
}

Full docs

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-02-03 12:27:56 -0500

Seen: 3,089 times

Last updated: May 11 '13