diff --git a/doc/dev.md b/doc/dev.md index 41025af..4fb25f4 100644 --- a/doc/dev.md +++ b/doc/dev.md @@ -237,5 +237,41 @@ the originally UpStart "service" program tend to be available on many systems and is privileged. ### 6.2. Functions -#### 6.2.1. exec_serv \ \ +<<<<<<< HEAD +#### 6.2.1. exec_serv +That function execute the given action to the given service. The service have +to be the first parameter and the action, the second parameter. No more +parameter will be acceted and an error will be triggered if there's any more +than two. + +The function returns the exit code of the service command. + +#### 6.2.2. svc_start +Start the services given in parmeters. You can give as many services you want. + +That function relies on the previously documented exec_serv function. + +#### 6.2.3. svc_reload +Reload the configuration of the services given in parmeters. You can give as +many services you want. Be careful using this as some services don't have that +capability. + +That function relies on the previously documented exec_serv function. + +#### 6.2.2. svc_restart +Restart the services given in parmeters. It consist generally in a stop +immediately followed by a start. You can give as many services you want. + +That function relies on the previously documented exec_serv function. + +#### 6.2.3. svc_stop +Stop the services given in parmeters. You can give as many services you want. + +That function relies on the previously documented exec_serv function. + +### 6.3. Other functionnalities +That file don't profide any other things that the previously listed functions. +======= +#### 6.2.1. exec_serv \ \ +>>>>>>> 0ed780d80de8e1be1d0d99d045c8d4b4d27d52ac diff --git a/lib/services.sh b/lib/services.sh index da67bb5..310e749 100644 --- a/lib/services.sh +++ b/lib/services.sh @@ -29,8 +29,12 @@ exec_serv() prnt I "Lancement de la commande $command du services $svcname" $lineexec +<<<<<<< HEAD unset lineexec +======= + return $? +>>>>>>> 0a2c9f5bc3d32cd765a3c67aa81e060c9ec28426 } export exec_serv @@ -48,6 +52,17 @@ svc_start() export -f svc_start +# ------------------------------------------------------------------------------ +# Reload one or more services +svc_reload() +{ + for svc in $@; do + exec_serv $svc reload + done +} +export -f svc_reload + + # ------------------------------------------------------------------------------ # Restart one or more services svc_restart()