Ask Your Question
1

Passing parameters to init scripts?

asked 2014-06-24 15:53:19 -0500

kwhite gravatar image

So I know how to start a service using the service type, but what if I need to pass a parameter to the init script that the service starts from?

We have a Tomcat installation that either listens on port 8081 or 8181 depending on what parameter you pass to the init script. We typically run both of these tomcat instances at once calling the script with "service tomcat start 0" and then "service tomcat start 1" The 1 or 0 is passed through the to server.xml of tomcat to run it on the specified port.

I know I can recreate the init scripts to find a way around this, but I'm hoping there's a way to pass a parameter to the init script through puppet.

Any help?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-06-24 16:19:42 -0500

According to the Puppet Type Reference, you can use the flags property with the service type to pass options to the script. This behavior requires that the provider supports the flaggable feature. According to the reference, the default service and init providers do not support this feature.

edit flag offensive delete link more

Comments

So then it's not possible to pass a parameter to the init script. Where did you find the reference to the service and init providers? I had to go to github to even find that information, was hoping you had a better source of reference material than reading through source. Thanks!

kwhite gravatar imagekwhite ( 2014-06-30 12:46:42 -0500 )edit

The link is in the answer 'Puppet Type Reference'

ptierno gravatar imageptierno ( 2014-07-02 08:12:01 -0500 )edit

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: 2014-06-24 15:53:19 -0500

Seen: 269 times

Last updated: Jun 24 '14