From 09c8c78bf5bee61bf8655959416d8b504b2ecf07 Mon Sep 17 00:00:00 2001 From: fbt Date: Fri, 4 Apr 2014 15:40:45 +0400 Subject: [PATCH] local configuration should be separate take 2 --- conf.d/cjdroute.sh | 1 + conf.d/dhcpcd.sh | 1 + conf.d/udev.sh | 5 +++++ init.d/mpd | 4 ++++ init.d/privoxy | 22 ++++++++++++++++++++++ 5 files changed, 33 insertions(+) create mode 100644 conf.d/cjdroute.sh create mode 100644 conf.d/dhcpcd.sh create mode 100644 conf.d/udev.sh create mode 100755 init.d/mpd create mode 100755 init.d/privoxy diff --git a/conf.d/cjdroute.sh b/conf.d/cjdroute.sh new file mode 100644 index 0000000..cf79b82 --- /dev/null +++ b/conf.d/cjdroute.sh @@ -0,0 +1 @@ +cjdroute_listen_port='7530' diff --git a/conf.d/dhcpcd.sh b/conf.d/dhcpcd.sh new file mode 100644 index 0000000..624bacb --- /dev/null +++ b/conf.d/dhcpcd.sh @@ -0,0 +1 @@ +service_args='-C resolv.conf' diff --git a/conf.d/udev.sh b/conf.d/udev.sh new file mode 100644 index 0000000..ce16348 --- /dev/null +++ b/conf.d/udev.sh @@ -0,0 +1,5 @@ +# systemd-udevd: +#service_command='/usr/lib/systemd/sustemd-udevd' + +# eudev: +service_command='/sbin/udevd' diff --git a/init.d/mpd b/init.d/mpd new file mode 100755 index 0000000..56c8e70 --- /dev/null +++ b/init.d/mpd @@ -0,0 +1,4 @@ +#!/usr/bin/env watchman + +service_command='/bin/mpd' +service_pidfile='/run/mpd.pid' diff --git a/init.d/privoxy b/init.d/privoxy new file mode 100755 index 0000000..2336685 --- /dev/null +++ b/init.d/privoxy @@ -0,0 +1,22 @@ +#!/usr/bin/env watchman + +privoxy_username='privoxy' +privoxy_configfile='/etc/privoxy/config' + +service_command='/usr/bin/privoxy' +service_pidfile='/run/privoxy.pid' +service_args="--pidfile ${service_pidfile} --user ${privoxy_username} ${privoxy_configfile}" + +privoxy::configtest() { + "${service_command}" --config-test ${service_args} +} + +restart() { + privoxy::configtest || { + watchman.err "Config test failed, not restarting!" + return 1 + } + + watchman.stop + watchman.start +}