summaryrefslogtreecommitdiffstats
path: root/roles/docker_img_puppet/files/puppet_container/service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'roles/docker_img_puppet/files/puppet_container/service.rb')
-rwxr-xr-xroles/docker_img_puppet/files/puppet_container/service.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/roles/docker_img_puppet/files/puppet_container/service.rb b/roles/docker_img_puppet/files/puppet_container/service.rb
new file mode 100755
index 000000000..40779c270
--- /dev/null
+++ b/roles/docker_img_puppet/files/puppet_container/service.rb
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+
+require 'fileutils'
+
+if __FILE__ == $0
+ abort "\nUsage: #{File.basename($0)} <name> <action>\n\n" unless ARGV.size == 2
+
+ name = ARGV[0]
+ action = ARGV[1]
+
+ SERVICE_IPC_DIR = '/var/run/ctr-ipc/service'
+
+ FileUtils.mkdir_p(SERVICE_IPC_DIR)
+
+ File.open("#{SERVICE_IPC_DIR}/#{name}", 'w') do |f|
+ f.print action
+ end
+end