From 47d21ad829dacef40de266f2862e6b9e2318def6 Mon Sep 17 00:00:00 2001 From: levasseur Date: Fri, 23 Jul 2021 14:18:21 +0200 Subject: [PATCH] doc improvements, small esthetic changes, mk_archive created --- LICENSE | 2 +- README.md | 45 ++++++++++++++++++++++++-------------- README.txt | 4 ++-- doc/dev.md | 1 + init.sh | 2 +- mk_archive.sh | 15 +++++++++++++ modules/install_mkagent.sh | 2 +- 7 files changed, 50 insertions(+), 21 deletions(-) create mode 100644 doc/dev.md create mode 100755 mk_archive.sh diff --git a/LICENSE b/LICENSE index 3791893..85ddce6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 20221 Geoffray Levasseur +Copyright 2019-2021 Geoffray Levasseur This is distributed with BSD-3-Clause license with the following terms and condition: diff --git a/README.md b/README.md index cea414f..7bc58f0 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ it's requirements turns it naturally to Linux systems. It have long been tested using Debian GNU/Linux, Devuan and different flavor of Ubuntu. ## Getting started -You should consider reading the [Beginner's guide](./doc/user.md). If you need +You should consider reading that document entirely before use. If you need to create additional modules to meet your needs, consider reading the [Developer's guide](./doc/dev.md). @@ -40,31 +40,33 @@ In that situation, no change should be done to the system. - **-j, --jump**: Jump the checks and goes directly to system transformation. That option should only be run after successfull checks (eg. after using the **--checkonly** option). -- **-k, --keep-going**: The scripts will continue even if errors occurs. Thus -some unrecoverable errors might stop the script anyway if it not allowing it to -work. Please use with care as it might leads to unexpected results. +- **-k, --keep-going**: The scripts will try to continue even if errors occurs. +Thus some unrecoverable errors might stop the script anyway if it not allowing +it to work. Please use with care as it might leads to unexpected results. ### Loading order and process -The first things the script do is loading its libraries contained in the "lib" +The first thing the script do is loading its libraries contained in the "lib" directory. Any file situated in that directory ending with the .sh extention will be loaded in alphabetical order. For that reason, error management -functions are place in a file called aaa_error.sh, so it can be loaded first and -catch errors that could occurs while loading library files. +functions are placed in a file called aaa_error.sh, so it can be loaded first +and catch errors that could occurs while loading library files. In the opposite +the zzz_main_fct.sh file have to be loaded last, because it's widely using +previously declared libraries. After that a basic command line parameter treatment is done. That allows the use of --version and --help options in user space. Those options just display informations and don't require any superuser rights and exit at that point of -execution. Everything that follows will do and the script will exit with error -at that point if not superuser. +execution. Everything after that will require administrator rights and the +script will exit with error at that point if not superuser. Next will be the log file creation and the loading of configuration files. At this point a deeper analysis of command line option will be done, triggering errors in case of unconsistency or incompatible options. Finally checking processes are launched in their declaration order (cf. -configuration file) and if not error and after a confirmation prompt, final -configuration process, those that actually makes changes, are launched. +configuration file). If no error occurs and after a confirmation prompt, final +treatment processes, those that actually makes changes, are launched. Without the --keep-going option any error will imediatelly stop execution. Some errors that could make the script impossible to execute will stop execution, @@ -80,9 +82,13 @@ the execution of init.sh. If one of your module change the hostname, the new name can only be took into account after a new execution of init.sh. Most of the variable you can declare to configure your host depends on the -module you will use. Please refer to module header to see hat's available for +module you will use. Please refer to module header to see what's available for your use case. +After a module version upgrade you should check again headers as variable name +or stucture might change. A variable ca also be deleted, new variables could +appears, and so on. + It is heavily recommended to use includes technique to shorten your configuration file and make a file for your organisation and an other one for the Linux distribution you use. Remember that the declaration order matters, @@ -131,14 +137,14 @@ Versionning modules is up to you but the recommended behavior follows somme standard rules. Considering a numbering as x.y.z: - x might be incremented in case of major change, rewriting or deferent approach -on the way to have the job done +on the way to have the job done, used variable could massively change ; - y might be incremented in case simple functionnality addition or basic -improvements +improvements, existing variable might not change but new ones could appears ; - z might be incremented only when correcting problems and/or bugs (+n fix => +n -to increment) +to increment), variable should not change. Unless only configuration files have been changed, any change in the code -implies any increment of a version number in the code **and** a git commit. +implies an increment of a version number in the code **and** a git commit. ```shell # Description @template@ module @@ -183,3 +189,10 @@ The following table is giving a list of error code with explanation: | 150..200 | Error in module checks | ## Contact and more information + +Everything except configuration files are licensed under BSD-3 license. Please +check licence file. + +Please check https://www.geoffray-levasseur.org/init + +You can mail author to fatalerrors geoffray-levasseur org diff --git a/README.txt b/README.txt index 39cdabf..3795a16 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -This is ubuntu deployment scripts for LEGOS git repository -created on 2021-05-31-11:31:04 +This is deployment scripts for LEGOS git repository created on 2021-05-31-11:31:04 +An english version for general purpose is available at https://www.geoffray-levasseur.org/init Check README.md for details. diff --git a/doc/dev.md b/doc/dev.md new file mode 100644 index 0000000..5f14ffb --- /dev/null +++ b/doc/dev.md @@ -0,0 +1 @@ +A faire. diff --git a/init.sh b/init.sh index 7fc2eac..b4b54b1 100755 --- a/init.sh +++ b/init.sh @@ -1,6 +1,6 @@ #!/bin/bash # Init: initialise a computer and conform it -# Copyright (c) 2021 Geoffray Levasseur +# Copyright (c) 2019-2021 Geoffray Levasseur # trace ERR through pipes set -o pipefail diff --git a/mk_archive.sh b/mk_archive.sh new file mode 100755 index 0000000..ef6f18d --- /dev/null +++ b/mk_archive.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# That script is used to create an archive for init deployment + +VERSION=$(grep "VERSION=" init.sh | cut -d'=' -f 2 | sed s/\"//g) +TMPDIR="/tmp/init-$VERSION" + +mkdir $TMPDIR + +cp -av conf lib modules doc init.sh README.* LICENSE $TMPDIR + +tar --gzip -cvf ~/init.sh-$VERSION.tar.gz $TMPDIR + +rm -rfv $TMPDIR + +echo "L'archive ~/init.sh-$VERSION.tar.gz a été créé avec succès dans votre home directory." diff --git a/modules/install_mkagent.sh b/modules/install_mkagent.sh index 39c8214..20ba72f 100644 --- a/modules/install_mkagent.sh +++ b/modules/install_mkagent.sh @@ -6,7 +6,7 @@ # * MK_PORT: Port check_mk agent will use to communicate with server # ------------------------------------------------------------------------------ -export VER_install_mkagent="0.0.1" +export VER_install_mkagent="0.0.2" install_mkagent() {