jordansissel / puppet-pleaserun

A custom type for puppet that allows you to use pleaserun to create init, launchd, upstart, systemd, and may more 'init' script thingies.
6 stars 2 forks source link

Question on passing args to the program? #4

Open stack72 opened 9 years ago

stack72 commented 9 years ago

Hey

I'm trying to make changes to the type and provider. In a nutshell, I want to be able to pass args to the program e.g

/usr/local/bin/puppet-forge-server -D -m /opt/forge/modules -x https://forgeapi.puppetlabs.com --log-dir /opt/forge/log --cache-basedir /opt/forge/cache

In the puppet provider, I am doing the following:

pleaserun {'puppet-forge-server':
    ensure          => present,
    name            => 'puppet-forge-server',
    program         => '/usr/local/bin/puppet-forge-server',
    args            => ['--overwrite --install -D -m /opt/forge/modules -x https://forgeapi.puppetlabs.com --log-dir /opt/forge/log --cache-basedir /opt/forge/cache']
  } 

On inspecting the /etc/init.d file, I see the following at the top

name=puppet-forge-server
program=/usr/local/bin/puppet-forge-server
args=--overwrite\\\ --install\\\ -D\\\ -m\\\ /opt/forge/modules\\\ -x\\\ https://forgeapi.puppetlabs.com\\\ --log-dir\\\ /opt/forge/log\\\ --cache-basedir\\\ /opt/forge/cache
pidfile="/var/run/$name.pid"

the file and the service work as expected, but looking via ps ax, I see that no args are attached to the app

screen shot 2015-03-03 at 14 26 29

Thoughts?

P.

jordansissel commented 9 years ago

Weird. Seems like a bug.

jordansissel commented 9 years ago

My test suite used to catch things like this, but it broke some time ago and docker's been changing a bit since then so the suite doesn't even function shakes fist at bitrot.

I'll try to test this manually this week, time permitting. Can you attach the output of sh -x /etc/init.d/puppet-forge-server ? Maybe I can eyeball the bug.

jordansissel commented 9 years ago

I'm trying to do a bit of more learning with test-kitchen (Huge <3 to @fnichol and others who've helped steer me in the right direction).

Once I get more comfortable with tk, it'll be easier to automatically test these kinds of things.