1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/friendica_ynh.git synced 2024-09-03 18:36:14 +02:00

fix this damn pidfile

This commit is contained in:
OniriCorpe 2024-02-14 07:41:50 +01:00
parent b928c940d0
commit b1590f230c
4 changed files with 16 additions and 1 deletions

View file

@ -17,6 +17,8 @@ PrivateTmp=true
InaccessibleDirectories=/home /root /boot /opt /mnt /media
ReadOnlyDirectories=/etc /usr
Restart=always
StartLimitBurst=2
StartLimitInterval=5
# Sandboxing options to harden security
# Depending on specificities of your service/app, you may need to tweak these

View file

@ -85,9 +85,15 @@ pushd "$install_dir"
# Enable LDAP Auth addon
ynh_exec_as "$app" "php$phpversion" bin/console.php addon enable ldapauth
popd
# add the path to the pidfile (we can't do that using the autoinstall)
# in fact we can using 'autoinstall -f <prepared.config.php>' but i'm tired
if [ -f "$install_dir/config/local.config.php" ] && ! grep -q -e "pidfile" "$install_dir/config/local.config.php"; then
ynh_replace_string --match_string="'basepath' => '$install_dir'," --replace_string="'basepath' => '$install_dir', 'pidfile' => '$install_dir/daemon.pid'," --target_file="$install_dir/config/local.config.php"
ynh_store_file_checksum --file="$install_dir/config/local.config.php"
fi
#=================================================
# START SYSTEMD SERVICE
#=================================================

View file

@ -17,6 +17,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
chmod -R 775 "$install_dir/view/smarty3"

View file

@ -73,6 +73,12 @@ if [ -f "$install_dir/config/local.config.php" ] && ! grep -q -e "'url' => 'http
ynh_store_file_checksum --file="$install_dir/config/local.config.php"
fi
# add the path to the pidfile if missing
if [ -f "$install_dir/config/local.config.php" ] && ! grep -q -e "pidfile" "$install_dir/config/local.config.php"; then
ynh_replace_string --match_string="'basepath' => '$install_dir'," --replace_string="'basepath' => '$install_dir', 'pidfile' => '$install_dir/daemon.pid'," --target_file="$install_dir/config/local.config.php"
ynh_store_file_checksum --file="$install_dir/config/local.config.php"
fi
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================