1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/watchdog_ynh.git synced 2024-06-22 05:42:53 +02:00

Merge pull request #4 from YunoHost-Apps/testing

Testing
This commit is contained in:
Salamandar 2024-06-21 19:17:55 +02:00 committed by GitHub
commit c9c5e06df3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 190 additions and 76 deletions

View file

@ -1,6 +1,8 @@
# All available README files by language # All available README files by language
- [Read the README in English](README.md) - [Read the README in English](README.md)
- [Lea el README en español](README_es.md)
- [Irakurri README euskaraz](README_eu.md)
- [Lire le README en français](README_fr.md) - [Lire le README en français](README_fr.md)
- [Le o README en galego](README_gl.md) - [Le o README en galego](README_gl.md)
- [Leggi il “README” in italiano](README_it.md) - [阅读中文(简体)的 README](README_zh_Hans.md)

View file

@ -9,7 +9,7 @@ It shall NOT be edited by hand.
[![Install Watchdog with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=watchdog) [![Install Watchdog with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=watchdog)
*[Read this README is other languages.](./ALL_README.md)* *[Read this README in other languages.](./ALL_README.md)*
> *This package allows you to install Watchdog quickly and simply on a YunoHost server.* > *This package allows you to install Watchdog quickly and simply on a YunoHost server.*
> *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* > *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.*
@ -17,14 +17,14 @@ It shall NOT be edited by hand.
## Overview ## Overview
A watchdog service makes sure your server is still running and reboots it if necessary. A watchdog service makes sure your server is still running and reboots it if necessary.
It better (only?) works if your server has a hardware watchdog device. It better (only?) works if your server has a [hardware watchdog device](https://en.wikipedia.org/wiki/Watchdog_timer).
The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted. The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted.
This app has only been tested on Raspberry Pi. This app has only been tested on Raspberry Pi.
**Shipped version:** 5.16~ynh1 **Shipped version:** 5.16~ynh2
## Documentation and resources ## Documentation and resources
- Upstream app code repository: <https://sourceforge.net/projects/watchdog/> - Upstream app code repository: <https://sourceforge.net/projects/watchdog/>

46
README_es.md Normal file
View file

@ -0,0 +1,46 @@
<!--
Este archivo README esta generado automaticamente<https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
No se debe editar a mano.
-->
# Watchdog para Yunohost
[![Nivel de integración](https://dash.yunohost.org/integration/watchdog.svg)](https://dash.yunohost.org/appci/app/watchdog) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/watchdog.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/watchdog.maintain.svg)
[![Instalar Watchdog con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=watchdog)
*[Leer este README en otros idiomas.](./ALL_README.md)*
> *Este paquete le permite instalarWatchdog rapidamente y simplement en un servidor YunoHost.*
> *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.*
## Descripción general
A watchdog service makes sure your server is still running and reboots it if necessary.
It better (only?) works if your server has a [hardware watchdog device](https://en.wikipedia.org/wiki/Watchdog_timer).
The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted.
This app has only been tested on Raspberry Pi.
**Versión actual:** 5.16~ynh2
## Documentaciones y recursos
- Repositorio del código fuente oficial de la aplicación : <https://sourceforge.net/projects/watchdog/>
- Catálogo YunoHost: <https://apps.yunohost.org/app/watchdog>
- Reportar un error: <https://github.com/YunoHost-Apps/watchdog_ynh/issues>
## Información para desarrolladores
Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing
Para probar la rama `testing`, sigue asÍ:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing --debug
o
sudo yunohost app upgrade watchdog -u https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing --debug
```
**Mas informaciones sobre el empaquetado de aplicaciones:** <https://yunohost.org/packaging_apps>

46
README_eu.md Normal file
View file

@ -0,0 +1,46 @@
<!--
Ohart ongi: README hau automatikoki sortu da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>ri esker
EZ editatu eskuz.
-->
# Watchdog YunoHost-erako
[![Integrazio maila](https://dash.yunohost.org/integration/watchdog.svg)](https://dash.yunohost.org/appci/app/watchdog) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/watchdog.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/watchdog.maintain.svg)
[![Instalatu Watchdog YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=watchdog)
*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)*
> *Pakete honek Watchdog YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.*
> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.*
## Aurreikuspena
A watchdog service makes sure your server is still running and reboots it if necessary.
It better (only?) works if your server has a [hardware watchdog device](https://en.wikipedia.org/wiki/Watchdog_timer).
The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted.
This app has only been tested on Raspberry Pi.
**Paketatutako bertsioa:** 5.16~ynh2
## Dokumentazioa eta baliabideak
- Jatorrizko aplikazioaren kode-gordailua: <https://sourceforge.net/projects/watchdog/>
- YunoHost Denda: <https://apps.yunohost.org/app/watchdog>
- Eman errore baten berri: <https://github.com/YunoHost-Apps/watchdog_ynh/issues>
## Garatzaileentzako informazioa
Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing).
`testing` abarra probatzeko, ondorengoa egin:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing --debug
edo
sudo yunohost app upgrade watchdog -u https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing --debug
```
**Informazio gehiago aplikazioaren paketatzeari buruz:** <https://yunohost.org/packaging_apps>

View file

@ -17,14 +17,14 @@ Il NE doit PAS être modifié à la main.
## Vue densemble ## Vue densemble
Un service de surveillance *watchdog* s'assure que votre serveur tourne toujours, et le redémarre si nécessaire. Un service de surveillance *watchdog* s'assure que votre serveur tourne toujours, et le redémarre si nécessaire.
Il tournera préférentiellement (uniquement?) si votre serveur est équipé d'un *watchdog* matériel. Il tournera préférentiellement (uniquement?) si votre serveur est équipé d'un [*watchdog*](https://fr.wikipedia.org/wiki/Chien_de_garde_(informatique)) matériel.
Le service inclut ira régulièrement écrire dans `/dev/watchdog`. S'il s'arrête, le plantage est alors détecté et résolu par un redémarrage du système. Le service inclut ira régulièrement écrire dans `/dev/watchdog`. S'il s'arrête, le plantage est alors détecté et résolu par un redémarrage du système.
Cette application n'a été testée que sur Raspberry Pi. Cette application n'a été testée que sur Raspberry Pi.
**Version incluse:** 5.16~ynh1 **Version incluse:** 5.16~ynh2
## Documentations et ressources ## Documentations et ressources
- Dépôt de code officiel de lapp: <https://sourceforge.net/projects/watchdog/> - Dépôt de code officiel de lapp: <https://sourceforge.net/projects/watchdog/>

View file

@ -17,14 +17,14 @@ NON debe editarse manualmente.
## Vista xeral ## Vista xeral
A watchdog service makes sure your server is still running and reboots it if necessary. A watchdog service makes sure your server is still running and reboots it if necessary.
It better (only?) works if your server has a hardware watchdog device. It better (only?) works if your server has a [hardware watchdog device](https://en.wikipedia.org/wiki/Watchdog_timer).
The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted. The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted.
This app has only been tested on Raspberry Pi. This app has only been tested on Raspberry Pi.
**Versión proporcionada:** 5.16~ynh1 **Versión proporcionada:** 5.16~ynh2
## Documentación e recursos ## Documentación e recursos
- Repositorio de orixe do código: <https://sourceforge.net/projects/watchdog/> - Repositorio de orixe do código: <https://sourceforge.net/projects/watchdog/>

46
README_zh_Hans.md Normal file
View file

@ -0,0 +1,46 @@
<!--
注意:此 README 由 <https://github.com/YunoHost/apps/tree/master/tools/readme_generator> 自动生成
请勿手动编辑。
-->
# YunoHost 上的 Watchdog
[![集成程度](https://dash.yunohost.org/integration/watchdog.svg)](https://dash.yunohost.org/appci/app/watchdog) ![工作状态](https://ci-apps.yunohost.org/ci/badges/watchdog.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/watchdog.maintain.svg)
[![使用 YunoHost 安装 Watchdog](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=watchdog)
*[阅读此 README 的其它语言版本。](./ALL_README.md)*
> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Watchdog。*
> *如果您还没有 YunoHost请参阅[指南](https://yunohost.org/install)了解如何安装它。*
## 概况
A watchdog service makes sure your server is still running and reboots it if necessary.
It better (only?) works if your server has a [hardware watchdog device](https://en.wikipedia.org/wiki/Watchdog_timer).
The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted.
This app has only been tested on Raspberry Pi.
**分发版本:** 5.16~ynh2
## 文档与资源
- 上游应用代码库: <https://sourceforge.net/projects/watchdog/>
- YunoHost 商店: <https://apps.yunohost.org/app/watchdog>
- 报告 bug <https://github.com/YunoHost-Apps/watchdog_ynh/issues>
## 开发者信息
请向 [`testing` 分支](https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing) 发送拉取请求。
如要尝试 `testing` 分支,请这样操作:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing --debug
sudo yunohost app upgrade watchdog -u https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing --debug
```
**有关应用打包的更多信息:** <https://yunohost.org/packaging_apps>

View file

@ -1,5 +1,5 @@
A watchdog service makes sure your server is still running and reboots it if necessary. A watchdog service makes sure your server is still running and reboots it if necessary.
It better (only?) works if your server has a hardware watchdog device. It better (only?) works if your server has a [hardware watchdog device](https://en.wikipedia.org/wiki/Watchdog_timer).
The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted. The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted.

View file

@ -1,5 +1,5 @@
Un service de surveillance *watchdog* s'assure que votre serveur tourne toujours, et le redémarre si nécessaire. Un service de surveillance *watchdog* s'assure que votre serveur tourne toujours, et le redémarre si nécessaire.
Il tournera préférentiellement (uniquement?) si votre serveur est équipé d'un *watchdog* matériel. Il tournera préférentiellement (uniquement?) si votre serveur est équipé d'un [*watchdog*](https://fr.wikipedia.org/wiki/Chien_de_garde_(informatique)) matériel.
Le service inclut ira régulièrement écrire dans `/dev/watchdog`. S'il s'arrête, le plantage est alors détecté et résolu par un redémarrage du système. Le service inclut ira régulièrement écrire dans `/dev/watchdog`. S'il s'arrête, le plantage est alors détecté et résolu par un redémarrage du système.

View file

@ -1,3 +1,3 @@
Your device boot configuration has been updated to enable the hardware watchdog. Your device boot configuration has been updated to enable the hardware watchdog.
Please reboot it. Please reboot your server.

3
doc/POST_INSTALL_fr.md Normal file
View file

@ -0,0 +1,3 @@
La configuration de démarrage de votre appareil a été mise à jour pour activer le chien de garde matériel.
Veuillez redémarrer votre server.

View file

@ -1,3 +1,5 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
packaging_format = 2 packaging_format = 2
id = "watchdog" id = "watchdog"
@ -6,7 +8,7 @@ name = "Watchdog"
description.en = "Automatically reboot your server in case of freeze" description.en = "Automatically reboot your server in case of freeze"
description.fr = "Redémarre automatiquement votre serveur en cas de plantage" description.fr = "Redémarre automatiquement votre serveur en cas de plantage"
version = "5.16~ynh1" version = "5.16~ynh2"
maintainers = ["tituspijean"] maintainers = ["tituspijean"]
@ -16,7 +18,7 @@ license = "GPL-2.0-or-later"
code = "https://sourceforge.net/projects/watchdog/" code = "https://sourceforge.net/projects/watchdog/"
[integration] [integration]
yunohost = ">= 11.2" yunohost = ">=11.2"
architectures = "all" architectures = "all"
multi_instance = false multi_instance = false
ldap = "not_relevant" ldap = "not_relevant"
@ -30,4 +32,4 @@ ram.runtime = "50M"
[resources] [resources]
[resources.apt] [resources.apt]
packages = "watchdog" packages = ["watchdog"]

View file

@ -18,6 +18,10 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="/etc/watchdog.conf" ynh_backup --src_path="/etc/watchdog.conf"
# Remove other various files specific to the app... such as :
ynh_backup --src_path="/var/log/$app"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -1,7 +1,5 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#================================================= #=================================================
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
@ -9,8 +7,14 @@ source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# INSTALL DEPENDENCIES # WATCHDOG DEVICE CHECK
#================================================= #=================================================
ynh_script_progression --message="Checking the hardware watchdog device presence..."
# Don't issue this error in CI
if [ "${PACKAGE_CHECK_EXEC:-0}" -eq 0 ] && [ ! -f /dev/watchdog ]; then
ynh_die --message="Your server doesn't seem to have a '/dev/watchdog' device, this certainly means that it has no hardware watchdog device. However, this package is only relevant if such a device exists, we're sorry."
fi
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION
@ -22,28 +26,19 @@ if [[ $(grep -ic "Raspberry Pi" /proc/cpuinfo) -ge 1 && $(grep -ic "dtparam=watc
echo "dtparam=watchdog=on" >> /boot/config.txt echo "dtparam=watchdog=on" >> /boot/config.txt
fi fi
yunohost service add $app
#=================================================
# APP INITIAL CONFIGURATION
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding app's configuration file..."
ynh_add_config --template="watchdog.conf" --destination="/etc/watchdog.conf" ynh_add_config --template="watchdog.conf" --destination="/etc/watchdog.conf"
chmod 400 "/etc/watchdog.conf" chmod 400 "/etc/watchdog.conf"
chown root: "/etc/watchdog.conf" chown root: "/etc/watchdog.conf"
systemctl enable "$app.service" --quiet
yunohost service add "$app"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting app's systemd service..." ynh_script_progression --message="Starting app's systemd service..."
# Enable and start a systemd service ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd"
systemctl enable $app.service --quiet
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -1,35 +1,25 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#================================================= #=================================================
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# REMOVE SYSTEM CONFIGURATIONS
#================================================= #=================================================
# REMOVE SYSTEMD SERVICE # REMOVE SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Removing system configurations related to $app..." ynh_script_progression --message="Removing system configurations related to $app..."
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) # Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null if ynh_exec_warn_less yunohost service status $app >/dev/null; then
then yunohost service remove "$app"
ynh_script_progression --message="Removing $app service integration..."
yunohost service remove $app
fi fi
ynh_remove_systemd_config ynh_remove_systemd_config
ynh_remove_nginx_config ynh_remove_nginx_config
# Remove other various files specific to the app... such as :
ynh_secure_remove --file="/var/log/$app"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -1,7 +1,5 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#================================================= #=================================================
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
@ -17,12 +15,11 @@ ynh_script_progression --message="Restoring system configurations related to $ap
ynh_restore_file --origin_path="/etc/watchdog.conf" ynh_restore_file --origin_path="/etc/watchdog.conf"
systemctl enable $app.service --quiet systemctl enable "$app.service" --quiet
yunohost service add "$app"
yunohost service add $app ynh_restore_file --origin_path="/var/log/$app"
#=================================================
# GENERIC FINALIZATION
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
#================================================= #=================================================

View file

@ -1,7 +1,5 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#================================================= #=================================================
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
@ -9,14 +7,6 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
#================================================= #=================================================
# STOP SYSTEMD SERVICE # STOP SYSTEMD SERVICE
#================================================= #=================================================
@ -29,26 +19,19 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#================================================= #=================================================
ynh_script_progression --message="Upgrading system configurations related to $app..." ynh_script_progression --message="Upgrading system configurations related to $app..."
yunohost service add $app
#=================================================
# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...)
#=================================================
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Updating a configuration file..."
ynh_add_config --template="watchdog.conf" --destination="/etc/watchdog.conf" ynh_add_config --template="watchdog.conf" --destination="/etc/watchdog.conf"
chmod 400 "/etc/watchdog.conf" chmod 400 "/etc/watchdog.conf"
chown root: "/etc/watchdog.conf" chown root: "/etc/watchdog.conf"
systemctl enable "$app.service" --quiet
yunohost service add "$app"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." ynh_script_progression --message="Starting $app's systemd service..."
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT