From 7a56c5466e9ddf53e53c831e00af361f8f3844f3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 22:28:34 +0100 Subject: [PATCH 01/30] use build.sh in documentation Signed-off-by: Nico Schottelius --- README | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README b/README index 389470a0..48b934f1 100644 --- a/README +++ b/README @@ -77,6 +77,7 @@ cdist was tested or is know to run on at least * [Debian](http://www.debian.org/) * [Gentoo](http://www.gentoo.org/) * [Mac OS X](http://www.apple.com/macosx/) + * [OpenBSD](http://www.openbsd.org) * [Redhat](http://www.redhat.com/) * [Ubuntu](http://www.ubuntu.com/) @@ -108,7 +109,7 @@ To install cdist, execute the following commands: export PATH=$PATH:$(pwd -P)/bin # If you want the manpages (requires gmake and asciidoc to be installed) - make man + ./build.sh man export MANPATH=$MANPATH:$(pwd -P)/doc/man @@ -150,7 +151,7 @@ To upgrade cdist in the current branch use git pull # Also update the manpages - make man + ./build.sh man export MANPATH=$MANPATH:$(pwd -P)/doc/man If you stay on a version branche (i.e. 1.0, 1.1., ...), nothing should break. From 7f2ca78b8238e037cab7fddf829cebb6172196f4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 22:34:11 +0100 Subject: [PATCH 02/30] spell correction Signed-off-by: Nico Schottelius --- .../{cdist-best-practise.text => cdist-best-practice.text} | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) rename doc/man/{cdist-best-practise.text => cdist-best-practice.text} (96%) diff --git a/doc/man/cdist-best-practise.text b/doc/man/cdist-best-practice.text similarity index 96% rename from doc/man/cdist-best-practise.text rename to doc/man/cdist-best-practice.text index af06084e..febe8f36 100644 --- a/doc/man/cdist-best-practise.text +++ b/doc/man/cdist-best-practice.text @@ -1,10 +1,10 @@ -cdist-best-practise(7) +cdist-best-practice(7) ====================== Nico Schottelius NAME ---- -cdist-best-practise - Practises used in real environments +cdist-best-practice - Practices used in real environments PASSWORDLESS CONNECTIONS @@ -61,7 +61,6 @@ machine-b % git clone git://your-git-server/cdist -------------------------------------------------------------------------------- - SEE ALSO -------- - cdist(7) From a55eb6ebc97713a4b9f9f4aab45cf761f119ad14 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 22:54:17 +0100 Subject: [PATCH 03/30] correct mantype linking and finish spell check Signed-off-by: Nico Schottelius --- build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 2c1570f5..4fc65b0d 100755 --- a/build.sh +++ b/build.sh @@ -41,6 +41,7 @@ case "$1" in man) set -e "$0" mandirs + "$0" mangen "$0" mantype "$0" man1 "$0" man7 @@ -61,7 +62,7 @@ case "$1" in ;; mantype) - for mansrc in ${MAN7TYPESRC}; do + for mansrc in conf/type/*/man.text; do dst="$(echo $mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')" ln -sf "../../../$mansrc" "$dst" done @@ -83,7 +84,7 @@ case "$1" in ;; man7) - for man in cdist.text cdist-best-practise.text cdist-hacker.text \ + for man in cdist.text cdist-best-practice.text cdist-hacker.text \ cdist-quickstart.text cdist-reference.text cdist-stages.text \ cdist-type.text do From 5ec1a6cc2d9f43b7b2cb7a65608a1d11ee7e08fb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 23:06:30 +0100 Subject: [PATCH 04/30] rephrase cdist and add prominent example section Signed-off-by: Nico Schottelius --- doc/man/cdist.text | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/man/cdist.text b/doc/man/cdist.text index 44be52b1..a4c88c1d 100644 --- a/doc/man/cdist.text +++ b/doc/man/cdist.text @@ -10,8 +10,13 @@ cdist - Configuration management system DESCRIPTION ----------- -Cdist is a very simple, elegant, cleanly designed configuration management -system. The easiest way to get started with cdist is to run cdist-quickstart. +Cdist is a usable configuration management system. +The easiest way to get started with cdist is to initialise +the environment and run cdist-quickstart: + +-------------------------------------------------------------------------------- +eval `./bin/cdist-env` && cdist-quickstart +-------------------------------------------------------------------------------- Cdist configurations are written in the shell scripting language. The mapping of configurations to hosts is defined in so called manifests, From 8f88ed269198b83b101993355e9bd31d294e749c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 23:17:35 +0100 Subject: [PATCH 05/30] template for cdist-cache Signed-off-by: Nico Schottelius --- bin/cdist-cache | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 bin/cdist-cache diff --git a/bin/cdist-cache b/bin/cdist-cache new file mode 100755 index 00000000..d4ea18bb --- /dev/null +++ b/bin/cdist-cache @@ -0,0 +1,56 @@ +#!/bin/sh +# +# 2010 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Let's build a cconfig tree from a configuration +# And save it into the cache tree +# + +. cdist-config +[ $# -eq 2 ] || __cdist_usage " " +set -u + +__cdist_target_host="$1"; shift +__cdist_manifest="$1"; shift + +################################################################################ +# Export information for cdist-type-emulator or manifest +# + +# Config dir should not get reset - FIXME: why did I do this? +export __cdist_conf_dir + +# Used to record the source in the object +export __cdist_manifest + +# Export information for manifests - __cdist_out_dir comes from cdist-config +export __global="$__cdist_out_dir" + +################################################################################ +# The actual run +# + +# Ensure binaries exist and are up-to-date +cdist-type-build-emulation "${__cdist_out_type_bin_dir}" \ + || __cdist_exit_err "Failed to build type emulation binaries" + +# prepend our path, so all cdist tools come before other tools +export PATH="${__cdist_out_type_bin_dir}:$PATH" + +__cdist_exec_fail_on_error "${__cdist_manifest}" From a9ce26f96858ec15fa88d3b26401bf1adc8ab10f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 23:35:11 +0100 Subject: [PATCH 06/30] integrate cdist-cache Signed-off-by: Nico Schottelius --- .gitignore | 9 ++------- bin/cdist-cache | 33 +++++++-------------------------- bin/cdist-config | 2 ++ bin/cdist-deploy-to | 1 + 4 files changed, 12 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index fdf9184f..68f829dc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,13 +2,8 @@ .*.swp # Ignore generated manpages -doc/man/*.[1-9] doc/man/.marker doc/man/man*/ -doc/html - -conf/type/*/*.7 -conf/type/*/man.html - - +# Ignore cache for version control +cache/ diff --git a/bin/cdist-cache b/bin/cdist-cache index d4ea18bb..120b0df2 100755 --- a/bin/cdist-cache +++ b/bin/cdist-cache @@ -23,34 +23,15 @@ # . cdist-config -[ $# -eq 2 ] || __cdist_usage " " +[ $# -eq 1 ] || __cdist_usage "" set -u __cdist_target_host="$1"; shift -__cdist_manifest="$1"; shift -################################################################################ -# Export information for cdist-type-emulator or manifest -# - -# Config dir should not get reset - FIXME: why did I do this? -export __cdist_conf_dir - -# Used to record the source in the object -export __cdist_manifest - -# Export information for manifests - __cdist_out_dir comes from cdist-config -export __global="$__cdist_out_dir" - -################################################################################ -# The actual run -# - -# Ensure binaries exist and are up-to-date -cdist-type-build-emulation "${__cdist_out_type_bin_dir}" \ - || __cdist_exit_err "Failed to build type emulation binaries" - -# prepend our path, so all cdist tools come before other tools -export PATH="${__cdist_out_type_bin_dir}:$PATH" +mkdir -p "${__cdist_local_base_cache_dir}" +__cdist_abs_cache_dir="$(cd "$__cdist_local_base_cache_dir" && pwd -P)" +__cdist_abs_ddir="$__cdist_abs_cache_dir/$__cdist_target_host" -__cdist_exec_fail_on_error "${__cdist_manifest}" +echo "Saving cache to $__cdist_abs_ddir ..." +rm -rf "$__cdist_abs_ddir" +mv "$__cdist_local_base_dir" "$__cdist_abs_ddir" diff --git a/bin/cdist-config b/bin/cdist-config index 86039f00..ccab81cc 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -41,6 +41,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" # : ${__cdist_name_bin:=bin} +: ${__cdist_name_cache:=cache} : ${__cdist_name_code:=code} : ${__cdist_name_code_finished:=codedone} : ${__cdist_name_conf_dir:=conf} @@ -100,6 +101,7 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") # Local Base # : ${__cdist_local_base_dir:=$__cdist_tmp_dir} +: ${__cdist_local_base_cache_dir:=$__cdist_abs_mydir/../$__cdist_name_cache} : ${__cdist_conf_dir:="$(cd "$__cdist_abs_mydir/../conf" && pwd -P)"} diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 9a2fd303..3a2c37c9 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -58,5 +58,6 @@ cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \ "${__cdist_remote_out_object_base_dir}" cdist-code-run-all "$__cdist_target_host" +cdist-cache "$__cdist_target_host" echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host" From a11e9791650be176d0c270edf7d8dca9b58319d4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 23:36:42 +0100 Subject: [PATCH 07/30] update todos Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 3556f371..ada791ca 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,8 +1,12 @@ Core: - support $__self = relative_type/object_id - - cache Cache: + - add manpage + - add example how to use + - export variable $__cache + -> to all hosts or this host? + Assume you want to configure stuff one host ("monitor node"), depending on the configuration of other hosts ("cluster nodes"). From 76725c1b0db5923069fdc5734c37551a2efa68a6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 23:43:23 +0100 Subject: [PATCH 08/30] begin to document cache Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 25 ++------------------- doc/man/cdist-cache.text | 47 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 23 deletions(-) create mode 100644 doc/man/cdist-cache.text diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index ada791ca..6b0891a2 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,27 +1,6 @@ -Core: - - support $__self = relative_type/object_id - Cache: - - add manpage - add example how to use - export variable $__cache -> to all hosts or this host? - - Assume you want to configure stuff one host ("monitor node"), - depending on the configuration of other hosts ("cluster nodes"). - - For instance, the monitor host would like to know, - which hosts are configured with the provider - "apache" and option --start true. - - This requires the monitor node to be able to - query all other configured nodes. It can't - ask for all hosts, because cdist does not - know which hosts are configured or may exist. - - Example implementation - - If cdist keeps ("caches") the configuration of every - node it configures, each new node can query the - cache for existing nodes that acquired the given - configuration. +Core: + - support $__self = relative_type/object_id diff --git a/doc/man/cdist-cache.text b/doc/man/cdist-cache.text new file mode 100644 index 00000000..cbf4c9d7 --- /dev/null +++ b/doc/man/cdist-cache.text @@ -0,0 +1,47 @@ +cdist-cache(1) +============== +Nico Schottelius + + +NAME +---- +cdist-cache - Cache output of last run + + +SYNOPSIS +-------- +cdist-cache TARGET_HOST + + +DESCRIPTION +----------- + + Assume you want to configure stuff one host ("monitor node"), + depending on the configuration of other hosts ("cluster nodes"). + + For instance, the monitor host would like to know, + which hosts are configured with the provider + "apache" and option --start true. + + This requires the monitor node to be able to + query all other configured nodes. It can't + ask for all hosts, because cdist does not + know which hosts are configured or may exist. + + Example implementation + + If cdist keeps ("caches") the configuration of every + node it configures, each new node can query the + cache for existing nodes that acquired the given + configuration. + + +SEE ALSO +-------- +cdist(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 652c0c1615d9b73eee55cdeb2445be1a179db871 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 23:52:13 +0100 Subject: [PATCH 09/30] document stuff for next release Signed-off-by: Nico Schottelius --- build.sh | 2 +- doc/changelog | 4 +++- doc/man/cdist-cache.text | 22 +++------------------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/build.sh b/build.sh index 4fc65b0d..b91db496 100755 --- a/build.sh +++ b/build.sh @@ -86,7 +86,7 @@ case "$1" in man7) for man in cdist.text cdist-best-practice.text cdist-hacker.text \ cdist-quickstart.text cdist-reference.text cdist-stages.text \ - cdist-type.text + cdist-type.text cdist-cache.text do ln -sf ../$man ${MAN7DSTDIR} done diff --git a/doc/changelog b/doc/changelog index 5cfae26f..93d0f7e4 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,3 +1,6 @@ +1.5.0: + * Add cache functionality + 1.4.1: 2011-03-25 * New type __key_value (Steven Armstrong) * New type __apt_ppa (Steven Armstrong) @@ -41,7 +44,6 @@ * Document cdist-object-gencode-all * Document cdist-manifest-run - 1.1.0: 2011-03-16 * Replace type __file with __file, __directory, __link * Document cdist-env diff --git a/doc/man/cdist-cache.text b/doc/man/cdist-cache.text index cbf4c9d7..54619199 100644 --- a/doc/man/cdist-cache.text +++ b/doc/man/cdist-cache.text @@ -15,25 +15,9 @@ cdist-cache TARGET_HOST DESCRIPTION ----------- - - Assume you want to configure stuff one host ("monitor node"), - depending on the configuration of other hosts ("cluster nodes"). - - For instance, the monitor host would like to know, - which hosts are configured with the provider - "apache" and option --start true. - - This requires the monitor node to be able to - query all other configured nodes. It can't - ask for all hosts, because cdist does not - know which hosts are configured or may exist. - - Example implementation - - If cdist keeps ("caches") the configuration of every - node it configures, each new node can query the - cache for existing nodes that acquired the given - configuration. +cdist-cache moves away the objects created during last run so the +next run can use the previous information and compare them with +the current status. SEE ALSO From 38a9c5d60fb492945aeb6b2ddf7f8466d991f40f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 23:53:38 +0100 Subject: [PATCH 10/30] ++todo Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 6b0891a2..05a44503 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,6 +1,9 @@ Cache: - add example how to use - export variable $__cache - -> to all hosts or this host? + -> for current host + -> add function to cdist-config, import from cdist-cache + + Core: - support $__self = relative_type/object_id From 2a0cba4e4b37ed115accd5ce24cefc9a24cc9f7d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 00:07:23 +0100 Subject: [PATCH 11/30] rephrase features Signed-off-by: Nico Schottelius --- README | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/README b/README index 48b934f1..c498e3b8 100644 --- a/README +++ b/README @@ -52,22 +52,28 @@ You can [browse the documentation for the latest version online](man) as well. ### Features -Stuff that should probably be included in every configuration management, -but is not. Or: Why I began to write cdist: - - * Speed - * Elegant code - * Clean design + * Elegant code and clean design + * Type and core cleanly seperated + * Small codebase in core * Good documentation (man pages) + * Consistency in behaviour, naming and documentation * Meaningful error messages + * Either standard error messages from tools or added description for clearification * The no surprise factor - * Consistency in behaviour, naming and documentation + * No magic guessing of what the user wants + * Simple and well-known DSL + * Posix shell * Easy integration into bare metal installations - * Simple and well-known DSL: posix shell - * It must be very easy to extend and debug cdist - * Focus on reuse of existing functionality (like sh, ssh, find, rm, ...) - * Easy upgrade: ***There is no need to update cdist on target hosts!*** - * cdist only needs to be update on the master server + * requires only ssh + sh + * Easy upgrade + * ***There is no need to update cdist on target hosts!*** + * cdist only needs to be updated on the master server(s) + * Very easy to extend + * Can be done via types, which can be stacked on top of others + * Reuse of existing functionality + * sh, ssh, find, rm, mv, ... + * Very easy to debug + * Just add set -x in the scripts ### OS support From 216ea21933903be61e1fa0f4e19fb1848aca1f4f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 18:44:31 +0100 Subject: [PATCH 12/30] a lot of more stuff in 1.5.0 :-) Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index 93d0f7e4..a99a0c3d 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,5 +1,6 @@ 1.5.0: * Add cache functionality + * Restructured execution: Run whole object at once (REPHRASE) 1.4.1: 2011-03-25 * New type __key_value (Steven Armstrong) From 74266df8aa3e9fa1fe16c8b18bd21124c88ff889 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 18:46:58 +0100 Subject: [PATCH 13/30] rereformulate Signed-off-by: Nico Schottelius --- doc/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog b/doc/changelog index a99a0c3d..b5908a36 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,6 +1,6 @@ 1.5.0: * Add cache functionality - * Restructured execution: Run whole object at once (REPHRASE) + * Restructured execution: Run whole object at once (REPHRASE) (Steven Armstrong) 1.4.1: 2011-03-25 * New type __key_value (Steven Armstrong) From 0a14aa080ce9d88366f691d8b521772b9e81f0c2 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 23:04:06 +0100 Subject: [PATCH 14/30] prepare version change Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index ccab81cc..991d23bb 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.4.1" +__cdist_version="1.5.0pre" # Fail if something bogus is going on set -u From 4ba452874a666b6b2d774eee1eeb3b39d22df723 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 23:45:41 +0100 Subject: [PATCH 15/30] add template for fancy idea __process Signed-off-by: Nico Schottelius --- conf/type/__process/explorer/cksum | 34 ++++++++++++++ conf/type/__process/explorer/exists | 30 +++++++++++++ conf/type/__process/gencode-local | 44 +++++++++++++++++++ conf/type/__process/gencode-remote | 46 +++++++++++++++++++ conf/type/__process/man.text | 61 ++++++++++++++++++++++++++ conf/type/__process/parameter/optional | 4 ++ 6 files changed, 219 insertions(+) create mode 100755 conf/type/__process/explorer/cksum create mode 100755 conf/type/__process/explorer/exists create mode 100755 conf/type/__process/gencode-local create mode 100755 conf/type/__process/gencode-remote create mode 100644 conf/type/__process/man.text create mode 100644 conf/type/__process/parameter/optional diff --git a/conf/type/__process/explorer/cksum b/conf/type/__process/explorer/cksum new file mode 100755 index 00000000..dcad99ba --- /dev/null +++ b/conf/type/__process/explorer/cksum @@ -0,0 +1,34 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Retrieve the md5sum of a file to be created, if it is already existing. +# + +destination="/$__object_id" + +if [ -e "$destination" ]; then + if [ -f "$destination" ]; then + cksum < "$destination" + else + echo "NO REGULAR FILE" + fi +else + echo "NO FILE FOUND, NO CHECKSUM CALCULATED." +fi diff --git a/conf/type/__process/explorer/exists b/conf/type/__process/explorer/exists new file mode 100755 index 00000000..f8b85671 --- /dev/null +++ b/conf/type/__process/explorer/exists @@ -0,0 +1,30 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Check whether file exists or not +# + +destination="/$__object_id" + +if [ -e "$destination" ]; then + echo yes +else + echo no +fi diff --git a/conf/type/__process/gencode-local b/conf/type/__process/gencode-local new file mode 100755 index 00000000..1168919e --- /dev/null +++ b/conf/type/__process/gencode-local @@ -0,0 +1,44 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# __file is a very basic type, which will probably be reused quite often +# + +destination="/$__object_id" + +if [ -f "$__object/parameter/source" ]; then + source="$(cat "$__object/parameter/source")" + + if [ -f "$source" ]; then + local_cksum="$(cksum < "$source")" + remote_cksum="$(cat "$__object/explorer/cksum")" + + if [ "$local_cksum" != "$remote_cksum" ]; then + # FIXME: The username is ugly and hardcoded, replace after 1.0! + # Probably a better aproach is to have the user configured + # ~/.ssh/config to contain the right username + # Probably describe it in cdist-quickstart... + echo scp "$source" "root@${__target_host}:${destination}" + fi + else + echo "Source \"$source\" does not exist." >&2 + exit 1 + fi +fi diff --git a/conf/type/__process/gencode-remote b/conf/type/__process/gencode-remote new file mode 100755 index 00000000..7c5cf7ce --- /dev/null +++ b/conf/type/__process/gencode-remote @@ -0,0 +1,46 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# __file is a very basic type, which will probably be reused quite often +# + +destination="/$__object_id" + +# No source? Create empty file +if [ ! -f "$__object/parameter/source" ]; then + if [ no = "$(cat "$__object/explorer/exists")" ]; then + echo touch \"$destination\" + fi +fi + +# Mode settings +if [ -f "$__object/parameter/mode" ]; then + echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\" +fi + +# Group +if [ -f "$__object/parameter/group" ]; then + echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\" +fi + +# Owner +if [ -f "$__object/parameter/owner" ]; then + echo chown \"$(cat "$__object/parameter/owner")\" \"$destination\" +fi diff --git a/conf/type/__process/man.text b/conf/type/__process/man.text new file mode 100644 index 00000000..67ab53d1 --- /dev/null +++ b/conf/type/__process/man.text @@ -0,0 +1,61 @@ +cdist-type__file(7) +=================== +Nico Schottelius + + +NAME +---- +cdist-type__file - Create files + + +DESCRIPTION +----------- +This cdist type allows you to create files on the target. + + +REQUIRED PARAMETERS +------------------- +None. + + +OPTIONAL PARAMETERS +------------------- +group:: + Group to chgrp to. + +mode:: + Unix permissions, suitable for chmod. + +owner:: + User to chown to. + +source:: + If supplied, copy this file from the host running cdist to the target. + If not supplied, an empty file or directory will be created. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Create /etc/cdist-configured as an empty file +__file /etc/cdist-configured + +# Use __file from another type +__file /etc/issue --source "$__type/files/archlinux" + +# Supply some more settings +__file /etc/shadow --source "$__type/files/shadow" \ + --owner root --group shadow --mode 0640 +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__process/parameter/optional b/conf/type/__process/parameter/optional new file mode 100644 index 00000000..06120518 --- /dev/null +++ b/conf/type/__process/parameter/optional @@ -0,0 +1,4 @@ +group +mode +owner +source From 6c6ece859bb035429a67446dd41bf183d0a93370 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 23:51:45 +0100 Subject: [PATCH 16/30] update documentation for __process Signed-off-by: Nico Schottelius --- conf/type/__process/man.text | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/conf/type/__process/man.text b/conf/type/__process/man.text index 67ab53d1..2273f6f9 100644 --- a/conf/type/__process/man.text +++ b/conf/type/__process/man.text @@ -1,52 +1,33 @@ -cdist-type__file(7) -=================== +cdist-type__process(7) +====================== Nico Schottelius NAME ---- -cdist-type__file - Create files +cdist-type__process - Start or stop process DESCRIPTION ----------- -This cdist type allows you to create files on the target. +This cdist type allows you to define the state of a process. REQUIRED PARAMETERS ------------------- -None. +state:: + State of the process: Either stopped or running. OPTIONAL PARAMETERS ------------------- -group:: - Group to chgrp to. - -mode:: - Unix permissions, suitable for chmod. - -owner:: - User to chown to. - -source:: - If supplied, copy this file from the host running cdist to the target. - If not supplied, an empty file or directory will be created. - +None EXAMPLES -------- -------------------------------------------------------------------------------- -# Create /etc/cdist-configured as an empty file -__file /etc/cdist-configured - -# Use __file from another type -__file /etc/issue --source "$__type/files/archlinux" - -# Supply some more settings -__file /etc/shadow --source "$__type/files/shadow" \ - --owner root --group shadow --mode 0640 +__process /usr/sbin/sshd --state running --start "/etc/rc.d/sshd start" -------------------------------------------------------------------------------- From 06fe371b1df80492b300093b7db77ee47ad7dc39 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 23:56:17 +0100 Subject: [PATCH 17/30] create type explorer "runs" Signed-off-by: Nico Schottelius --- conf/type/__process/explorer/cksum | 34 ------------------- conf/type/__process/explorer/{exists => runs} | 10 ++---- 2 files changed, 3 insertions(+), 41 deletions(-) delete mode 100755 conf/type/__process/explorer/cksum rename conf/type/__process/explorer/{exists => runs} (85%) diff --git a/conf/type/__process/explorer/cksum b/conf/type/__process/explorer/cksum deleted file mode 100755 index dcad99ba..00000000 --- a/conf/type/__process/explorer/cksum +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# 2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# Retrieve the md5sum of a file to be created, if it is already existing. -# - -destination="/$__object_id" - -if [ -e "$destination" ]; then - if [ -f "$destination" ]; then - cksum < "$destination" - else - echo "NO REGULAR FILE" - fi -else - echo "NO FILE FOUND, NO CHECKSUM CALCULATED." -fi diff --git a/conf/type/__process/explorer/exists b/conf/type/__process/explorer/runs similarity index 85% rename from conf/type/__process/explorer/exists rename to conf/type/__process/explorer/runs index f8b85671..685dd19e 100755 --- a/conf/type/__process/explorer/exists +++ b/conf/type/__process/explorer/runs @@ -18,13 +18,9 @@ # along with cdist. If not, see . # # -# Check whether file exists or not +# Check whether a process runs # -destination="/$__object_id" +process="$__object_id" -if [ -e "$destination" ]; then - echo yes -else - echo no -fi +pgrep -f "$process" || true From e4467de8fd9dfe044e65d2cce1972c102513441e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 00:05:30 +0100 Subject: [PATCH 18/30] describe how __process should work Signed-off-by: Nico Schottelius --- conf/type/__process/man.text | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/conf/type/__process/man.text b/conf/type/__process/man.text index 2273f6f9..623ec4b2 100644 --- a/conf/type/__process/man.text +++ b/conf/type/__process/man.text @@ -21,13 +21,28 @@ state:: OPTIONAL PARAMETERS ------------------- -None +stop:: + Executable to use for stopping the process. + +start:: + Executable to use for starting the process. + EXAMPLES -------- -------------------------------------------------------------------------------- +# Start /usr/sbin/sshd if not running +__process /usr/sbin/sshd --state running + +# Start /usr/sbin/sshd if not running with a different binary __process /usr/sbin/sshd --state running --start "/etc/rc.d/sshd start" + +# Stop the process using kill (the type default) +__process /usr/sbin/sshd --state stopped + +# Stop the process using /etc/rc.d/sshd stop +__process /usr/sbin/sshd --state stopped --stop "/etc/rc.d/sshd stop" -------------------------------------------------------------------------------- From e7c1d3f16b774c3b33f7b41aa7dbec4041dd6d5c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 00:07:39 +0100 Subject: [PATCH 19/30] add parameter Signed-off-by: Nico Schottelius --- conf/type/__process/gencode-local | 44 -------------------------- conf/type/__process/parameter/optional | 6 ++-- conf/type/__process/parameter/required | 1 + 3 files changed, 3 insertions(+), 48 deletions(-) delete mode 100755 conf/type/__process/gencode-local create mode 100644 conf/type/__process/parameter/required diff --git a/conf/type/__process/gencode-local b/conf/type/__process/gencode-local deleted file mode 100755 index 1168919e..00000000 --- a/conf/type/__process/gencode-local +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# -# 2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# __file is a very basic type, which will probably be reused quite often -# - -destination="/$__object_id" - -if [ -f "$__object/parameter/source" ]; then - source="$(cat "$__object/parameter/source")" - - if [ -f "$source" ]; then - local_cksum="$(cksum < "$source")" - remote_cksum="$(cat "$__object/explorer/cksum")" - - if [ "$local_cksum" != "$remote_cksum" ]; then - # FIXME: The username is ugly and hardcoded, replace after 1.0! - # Probably a better aproach is to have the user configured - # ~/.ssh/config to contain the right username - # Probably describe it in cdist-quickstart... - echo scp "$source" "root@${__target_host}:${destination}" - fi - else - echo "Source \"$source\" does not exist." >&2 - exit 1 - fi -fi diff --git a/conf/type/__process/parameter/optional b/conf/type/__process/parameter/optional index 06120518..4189bb2c 100644 --- a/conf/type/__process/parameter/optional +++ b/conf/type/__process/parameter/optional @@ -1,4 +1,2 @@ -group -mode -owner -source +stop +start diff --git a/conf/type/__process/parameter/required b/conf/type/__process/parameter/required new file mode 100644 index 00000000..ff72b5c7 --- /dev/null +++ b/conf/type/__process/parameter/required @@ -0,0 +1 @@ +state From 97dd649f447a917c63200cce74d35aadfdc2b63b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 22:55:58 +0200 Subject: [PATCH 20/30] update todos Signed-off-by: Nico Schottelius --- doc/dev/todo/TAKEME | 4 +++- doc/dev/todo/niconext | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index 2881c06c..138f7714 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -5,7 +5,8 @@ Feel free to pick one! CORE ---- -Only build manpages if necessary for types as well as for the core! +- Only build manpages if necessary for types as well as for the core! +- support $__self = relative_type/object_id TYPES ------ @@ -17,3 +18,4 @@ Types to be written/extended: -> aka sed. - __cron + diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 05a44503..e9a6ddfc 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -5,5 +5,5 @@ Cache: -> add function to cdist-config, import from cdist-cache -Core: - - support $__self = relative_type/object_id +remove --preseed from package_apt and add debconf_set_selection or similar + -> much cleaner! From d21cfa66a03e681bf3f24774eb1995c49c85a717 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 22:58:42 +0200 Subject: [PATCH 21/30] +indent Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 6294870a..b3ed1f3d 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -155,7 +155,7 @@ if [ -e "${__cdist_object_dir}" ]; then # Allow diff to fail set +e diff -ru "${__cdist_new_object_dir}/${__cdist_name_parameter}" \ - "${__cdist_object_dir}/${__cdist_name_parameter}" \ + "${__cdist_object_dir}/${__cdist_name_parameter}" \ > "$__cdist_tmp_file"; ret=$? set -e From ec2971787090c11c5eb029a0a225ed1b9b56cc09 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 22:59:00 +0200 Subject: [PATCH 22/30] in theory finish __process Signed-off-by: Nico Schottelius --- conf/type/__process/gencode-remote | 46 ++++++++++++++++-------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/conf/type/__process/gencode-remote b/conf/type/__process/gencode-remote index 7c5cf7ce..219230db 100755 --- a/conf/type/__process/gencode-remote +++ b/conf/type/__process/gencode-remote @@ -21,26 +21,30 @@ # __file is a very basic type, which will probably be reused quite often # -destination="/$__object_id" +process="$__object_id" -# No source? Create empty file -if [ ! -f "$__object/parameter/source" ]; then - if [ no = "$(cat "$__object/explorer/exists")" ]; then - echo touch \"$destination\" - fi -fi +runs="$(cat "$__object/explorer/runs")" +state="$(cat "$__object/parameter/state")" -# Mode settings -if [ -f "$__object/parameter/mode" ]; then - echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\" -fi - -# Group -if [ -f "$__object/parameter/group" ]; then - echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\" -fi - -# Owner -if [ -f "$__object/parameter/owner" ]; then - echo chown \"$(cat "$__object/parameter/owner")\" \"$destination\" -fi +case "$state" in + running) + # Does not run, start it! + if [ -z "$runs" ]; then + if [ -f "$__object/parameter/start" ]; then + cat "$__object/parameter/start" + else + echo "$process" + fi + fi + ;; + stopped) + # Runs, kill it! + if [ "$runs" ]; then + if [ -f "$__object/parameter/stop" ]; then + cat "$__object/parameter/stop" + else + echo kill "${runs}" + fi + fi + ;; +esac From 4cd70b7abbf19a3a1b71d4e5176ec8b67f515576 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 23:10:29 +0200 Subject: [PATCH 23/30] document pgrep fun Signed-off-by: Nico Schottelius --- doc/dev/logs/2011-03-27.pgrep | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/dev/logs/2011-03-27.pgrep diff --git a/doc/dev/logs/2011-03-27.pgrep b/doc/dev/logs/2011-03-27.pgrep new file mode 100644 index 00000000..fedfa81e --- /dev/null +++ b/doc/dev/logs/2011-03-27.pgrep @@ -0,0 +1,12 @@ +Some pgrep fun when grepping for -f /usr/lib/postfix/master: + +[23:08] kr:cdist% cat cache/localhost/out/object/__process/usr/lib/postfix/master/.cdist/explorer/runs | grep -e 2529 -e 2537 -e 2538 -e 2539 +nico 2529 0.0 0.0 14848 1816 pts/45 S+ 23:08 0:00 /bin/sh /home/users/nico/oeffentlich/rechner/projekte/cdist/bin/cdist-run-remote localhost __object="/var/lib/cdist/out/object/__process/usr/lib/postfix/master" __object_id="usr/lib/postfix/master" cdist-remote-explorer-run __type_explorer /var/lib/cdist/conf/type/__process/explorer /var/lib/cdist/out/object/__process/usr/lib/postfix/master/explorer +nico 2537 0.0 0.0 41976 2324 pts/45 S+ 23:08 0:00 ssh root@localhost export PATH="/var/lib/cdist/bin:$PATH"; __object="/var/lib/cdist/out/object/__process/usr/lib/postfix/master" __object_id="usr/lib/postfix/master" cdist-remote-explorer-run __type_explorer /var/lib/cdist/conf/type/__process/explorer /var/lib/cdist/out/object/__process/usr/lib/postfix/master/explorer +root 2538 0.0 0.0 11440 1264 ? Ss 23:08 0:00 bash -c export PATH="/var/lib/cdist/bin:$PATH"; __object="/var/lib/cdist/out/object/__process/usr/lib/postfix/master" __object_id="usr/lib/postfix/master" cdist-remote-explorer-run __type_explorer /var/lib/cdist/conf/type/__process/explorer /var/lib/cdist/out/object/__process/usr/lib/postfix/master/explorer +root 2539 0.0 0.0 11440 1524 ? S 23:08 0:00 /bin/sh /var/lib/cdist/bin/cdist-remote-explorer-run __type_explorer /var/lib/cdist/conf/type/__process/explorer /var/lib/cdist/out/object/__process/usr/lib/postfix/master/explorer +2529 +2537 +2538 +2539 + From 0e8d36f5928a5869f67eb79c55f3e1ff69973f08 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 23:12:25 +0200 Subject: [PATCH 24/30] add -x to pgrep Signed-off-by: Nico Schottelius --- conf/type/__process/explorer/runs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/type/__process/explorer/runs b/conf/type/__process/explorer/runs index 685dd19e..6d2bdf8c 100755 --- a/conf/type/__process/explorer/runs +++ b/conf/type/__process/explorer/runs @@ -23,4 +23,5 @@ process="$__object_id" -pgrep -f "$process" || true +ps aux +pgrep -x -f "$process" || true From 40b7b158c0c38708574a2d4354490de83df23c3c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 23:13:18 +0200 Subject: [PATCH 25/30] -debug Signed-off-by: Nico Schottelius --- conf/type/__process/explorer/runs | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/type/__process/explorer/runs b/conf/type/__process/explorer/runs index 6d2bdf8c..19d259a6 100755 --- a/conf/type/__process/explorer/runs +++ b/conf/type/__process/explorer/runs @@ -23,5 +23,4 @@ process="$__object_id" -ps aux pgrep -x -f "$process" || true From b8002efa6d630006b333bb7e650f7092fcd3659e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 23:29:10 +0200 Subject: [PATCH 26/30] add support for __process --name (in theory) Signed-off-by: Nico Schottelius --- conf/type/__process/explorer/runs | 8 ++++++-- conf/type/__process/gencode-remote | 13 +++++++++++-- conf/type/__process/man.text | 3 +++ conf/type/__process/parameter/optional | 1 + 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/conf/type/__process/explorer/runs b/conf/type/__process/explorer/runs index 19d259a6..240ebef9 100755 --- a/conf/type/__process/explorer/runs +++ b/conf/type/__process/explorer/runs @@ -21,6 +21,10 @@ # Check whether a process runs # -process="$__object_id" +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi -pgrep -x -f "$process" || true +pgrep -x -f "$name" || true diff --git a/conf/type/__process/gencode-remote b/conf/type/__process/gencode-remote index 219230db..f8da1795 100755 --- a/conf/type/__process/gencode-remote +++ b/conf/type/__process/gencode-remote @@ -21,7 +21,11 @@ # __file is a very basic type, which will probably be reused quite often # -process="$__object_id" +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi runs="$(cat "$__object/explorer/runs")" state="$(cat "$__object/parameter/state")" @@ -33,7 +37,7 @@ case "$state" in if [ -f "$__object/parameter/start" ]; then cat "$__object/parameter/start" else - echo "$process" + echo "$name" fi fi ;; @@ -47,4 +51,9 @@ case "$state" in fi fi ;; + *) + echo "Unknown state: $state" >&2 + exit 1 + ;; + esac diff --git a/conf/type/__process/man.text b/conf/type/__process/man.text index 623ec4b2..5f49865b 100644 --- a/conf/type/__process/man.text +++ b/conf/type/__process/man.text @@ -21,6 +21,9 @@ state:: OPTIONAL PARAMETERS ------------------- +name:: + Process name to match on when using pgrep -f -x. + stop:: Executable to use for stopping the process. diff --git a/conf/type/__process/parameter/optional b/conf/type/__process/parameter/optional index 4189bb2c..3411afb4 100644 --- a/conf/type/__process/parameter/optional +++ b/conf/type/__process/parameter/optional @@ -1,2 +1,3 @@ +name stop start From 271aa95a4da8f20f258fdb428faa4660197fbefa Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 23:32:28 +0200 Subject: [PATCH 27/30] add --name example to manpage Signed-off-by: Nico Schottelius --- conf/type/__process/man.text | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf/type/__process/man.text b/conf/type/__process/man.text index 5f49865b..d144498d 100644 --- a/conf/type/__process/man.text +++ b/conf/type/__process/man.text @@ -46,6 +46,11 @@ __process /usr/sbin/sshd --state stopped # Stop the process using /etc/rc.d/sshd stop __process /usr/sbin/sshd --state stopped --stop "/etc/rc.d/sshd stop" + +# Ensure cups is running, which runs with -C ...: +__process cups --start "/etc/rc.d/cups start" --state running \ + --name "/usr/sbin/cupsd -C /etc/cups/cupsd.conf" + -------------------------------------------------------------------------------- From 741e505b1e90acd584fbf232ff4945bdea40c98a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 23:33:27 +0200 Subject: [PATCH 28/30] more interesting stuff for 1.5.0 Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index b5908a36..7faf789b 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,5 +1,6 @@ 1.5.0: * Add cache functionality + * New type __process * Restructured execution: Run whole object at once (REPHRASE) (Steven Armstrong) 1.4.1: 2011-03-25 From 417ce618217a49a83d4d83cb5260bfba2a5a3abc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 08:54:41 +0200 Subject: [PATCH 29/30] -'' Signed-off-by: Nico Schottelius --- conf/type/__process/man.text | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/type/__process/man.text b/conf/type/__process/man.text index d144498d..3f7004c7 100644 --- a/conf/type/__process/man.text +++ b/conf/type/__process/man.text @@ -50,7 +50,6 @@ __process /usr/sbin/sshd --state stopped --stop "/etc/rc.d/sshd stop" # Ensure cups is running, which runs with -C ...: __process cups --start "/etc/rc.d/cups start" --state running \ --name "/usr/sbin/cupsd -C /etc/cups/cupsd.conf" - -------------------------------------------------------------------------------- From dbe74dcc3330117d01df306833c019361c448742 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 08:56:53 +0200 Subject: [PATCH 30/30] compile all manpages in parallel! Signed-off-by: Nico Schottelius --- build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index b91db496..4b0311c5 100755 --- a/build.sh +++ b/build.sh @@ -51,9 +51,10 @@ case "$1" in manbuild) for src in ${MAN1DSTDIR}/*.text ${MAN7DSTDIR}/*.text; do echo "Compiling manpage and html for $src" - $A2XM "$src" - $A2XH "$src" + $A2XM "$src" & + $A2XH "$src" & done + wait ;; mandirs)