Просмотр исходного кода

Merge pull request #13 from YunoHost-Apps/fix-systemd

Fix systemd
DeMiro5001 4 месяцев назад
Родитель
Сommit
7a62637c81
4 измененных файлов с 10 добавлено и 2 удалено
  1. 1 1
      scripts/change_url
  2. 4 0
      scripts/install
  3. 4 0
      scripts/restore
  4. 1 1
      scripts/upgrade

+ 1 - 1
scripts/change_url

@@ -41,7 +41,7 @@ chown "$app:$app" "$install_dir/.env"
 #=================================================
 ynh_script_progression "Starting $app's systemd service..."
 
-ynh_systemctl --service="$app" --action="start"
+ynh_systemctl --service="$app" --action="start" --wait_until="No requirements found in frontmatter"
 
 #=================================================
 # END OF SCRIPT

+ 4 - 0
scripts/install

@@ -41,6 +41,8 @@ ynh_config_add --template=".env" --destination="$install_dir/.env"
 
 chmod 400 "$install_dir/.env"
 chown "$app:$app" "$install_dir/.env"
+mkdir -p "/var/log/$app"
+chown "$app:$app" "/var/log/$app"
 
 #=================================================
 # SYSTEM CONFIGURATION
@@ -51,6 +53,8 @@ ynh_config_add_nginx
 
 ynh_config_add_systemd
 
+ynh_systemctl --service="$app" --action="start" --wait_until="No requirements found in frontmatter" --timeout=600
+
 yunohost service add "$app" --description="User-friendly AI Interface (Supports Ollama, OpenAI API, ...)" --log="/var/log/$app/$app.log"
 
 ynh_config_add_logrotate

+ 4 - 0
scripts/restore

@@ -32,7 +32,11 @@ ynh_script_progression "Restoring system configurations related to $app..."
 ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
 
 ynh_restore "/etc/systemd/system/$app.service"
+
 systemctl enable "$app.service" --quiet
+
+ynh_systemctl --service="$app" --action="start" --wait_until="No requirements found in frontmatter" --timeout=600
+
 yunohost service add "$app" --description="User-friendly AI Interface (Supports Ollama, OpenAI API, ...)" --log="/var/log/$app/$app.log"
 
 ynh_restore "/etc/logrotate.d/$app"

+ 1 - 1
scripts/upgrade

@@ -44,7 +44,7 @@ ynh_config_add_logrotate
 #=================================================
 ynh_script_progression "Starting $app's systemd service..."
 
-ynh_systemctl --service="$app" --action="start"
+ynh_systemctl --service="$app" --action="start" --wait_until="No requirements found in frontmatter" --timeout=600
 
 #=================================================
 # END OF SCRIPT