summaryrefslogtreecommitdiff
path: root/sysutils/sd-agent/files
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/sd-agent/files')
-rw-r--r--sysutils/sd-agent/files/patch-agent.py17
-rw-r--r--sysutils/sd-agent/files/sd-agent.in50
2 files changed, 67 insertions, 0 deletions
diff --git a/sysutils/sd-agent/files/patch-agent.py b/sysutils/sd-agent/files/patch-agent.py
new file mode 100644
index 000000000000..25d5ef9282c9
--- /dev/null
+++ b/sysutils/sd-agent/files/patch-agent.py
@@ -0,0 +1,17 @@
+--- agent.py.orig 2014-10-24 11:01:07 UTC
++++ agent.py
+@@ -64,10 +64,10 @@
+
+ config = ConfigParser.ConfigParser()
+
+- if os.path.exists('/etc/sd-agent/conf.d/'):
+- configPath = '/etc/sd-agent/conf.d/'
+- elif os.path.exists('/etc/sd-agent/config.cfg'):
+- configPath = '/etc/sd-agent/config.cfg'
++ if os.path.exists('%%PREFIX%%/etc/sd-agent/conf.d/'):
++ configPath = '%%PREFIX%%/etc/sd-agent/conf.d/'
++ elif os.path.exists('%%PREFIX%%/etc/sd-agent/config.cfg'):
++ configPath = '%%PREFIX%%/etc/sd-agent/config.cfg'
+ else:
+ configPath = path + '/config.cfg'
+
diff --git a/sysutils/sd-agent/files/sd-agent.in b/sysutils/sd-agent/files/sd-agent.in
new file mode 100644
index 000000000000..c5165a3f1f40
--- /dev/null
+++ b/sysutils/sd-agent/files/sd-agent.in
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# PROVIDE: %%RCNAME%%
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+name=%%RCNAME%%
+rcvar=%%RCNAME%%_enable
+pidfile="/var/run/sd-agent/sd-agent.pid"
+logfile="/var/log/sd-agent/sd-agent.log"
+
+start_precmd="${name}_prestart"
+start_cmd="${name}_start"
+stop_cmd="${name}_stop"
+status_cmd="${name}_status"
+
+load_rc_config $name
+: ${%%RCNAME%%_enable:=no}
+
+%%RCNAME%%_user=sd-agent
+%%RCNAME%%_group=sd-agent
+
+command='%%PREFIX%%/libexec/sd-agent/agent.py'
+
+%%RCNAME%%_prestart()
+{
+ install -d -o ${%%RCNAME%%_user} -g ${%%RCNAME%%_group} \
+ $(dirname $pidfile)
+ install -d -o ${%%RCNAME%%_user} -g ${%%RCNAME%%_group} \
+ $(dirname $logfile)
+}
+
+%%RCNAME%%_start()
+{
+ su -m ${%%RCNAME%%_user} -c "$command start init"
+}
+
+%%RCNAME%%_stop()
+{
+ $command stop init
+}
+
+%%RCNAME%%_status()
+{
+ $command status init
+}
+
+run_rc_command "$1"