Merge branch 'master' of ssh://apo.geoffray-levasseur.org/share/services/git/legos
This commit is contained in:
38
doc/dev.md
38
doc/dev.md
@@ -237,5 +237,41 @@ the originally UpStart "service" program tend to be available on many systems
|
|||||||
and is privileged.
|
and is privileged.
|
||||||
|
|
||||||
### 6.2. Functions
|
### 6.2. Functions
|
||||||
#### 6.2.1. exec_serv \<service\> \<command\>
|
<<<<<<< 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 \<service\> \<command\>
|
||||||
|
>>>>>>> 0ed780d80de8e1be1d0d99d045c8d4b4d27d52ac
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,12 @@ exec_serv()
|
|||||||
|
|
||||||
prnt I "Lancement de la commande $command du services $svcname"
|
prnt I "Lancement de la commande $command du services $svcname"
|
||||||
$lineexec
|
$lineexec
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
unset lineexec
|
unset lineexec
|
||||||
|
=======
|
||||||
|
return $?
|
||||||
|
>>>>>>> 0a2c9f5bc3d32cd765a3c67aa81e060c9ec28426
|
||||||
}
|
}
|
||||||
export exec_serv
|
export exec_serv
|
||||||
|
|
||||||
@@ -48,6 +52,17 @@ svc_start()
|
|||||||
export -f 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
|
# Restart one or more services
|
||||||
svc_restart()
|
svc_restart()
|
||||||
|
|||||||
Reference in New Issue
Block a user