Page MenuHomeDevCentral

No OneTemporary

diff --git a/roles/webserver-alkane/php/files/restart-php-fpm.sh b/roles/webserver-alkane/php/files/restart-php-fpm.sh
index c121cbe..0abda70 100755
--- a/roles/webserver-alkane/php/files/restart-php-fpm.sh
+++ b/roles/webserver-alkane/php/files/restart-php-fpm.sh
@@ -1,31 +1,32 @@
#!/bin/sh
# -------------------------------------------------------------
# Restart php-fpm
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# Source file: roles/webserver-alkane/php/files/restart-php-fpm.sh
# Description: Deploy and restart php-fpm service
# -------------------------------------------------------------
set -e
# -------------------------------------------------------------
# Ensure user is root
#
# Note: POSIX shells don't always define $UID or $EUID.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ "${EUID:-$(id -u)}" -ne 0 ]; then
echo "This command must be run as root." >&2
exit 1
fi
# -------------------------------------------------------------
# Update through Salt the service if needed & restart php-fpm
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+rm -f /usr/local/etc/rc.d/php_fpm
grep -q auto-generated /usr/local/etc/rc.d/php-fpm || salt-call state.apply roles/webserver-alkane/php/service
/usr/local/etc/rc.d/php-fpm restart
diff --git a/roles/webserver-alkane/php/service.sls b/roles/webserver-alkane/php/service.sls
index dd87f51..b72bce2 100644
--- a/roles/webserver-alkane/php/service.sls
+++ b/roles/webserver-alkane/php/service.sls
@@ -1,46 +1,49 @@
# -------------------------------------------------------------
# Salt — Provision PHP websites — php-fpm service
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
# -------------------------------------------------------------
# Service
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% if grains['os'] == 'FreeBSD' %}
{% set instances = " ".join(pillar['php_fpm_instances'].keys()) %}
/usr/local/etc/rc.d/php-fpm:
file.managed:
- source: salt://roles/webserver-alkane/php/files/rc/php-fpm
- mode: 755
+/usr/local/etc/rc.d/php_fpm:
+ file.absent
+
/usr/local/bin/restart-php-fpm:
file.managed:
- source: salt://roles/webserver-alkane/php/files/restart-php-fpm.sh
- mode: 755
/etc/rc.conf.d/php_fpm:
file.directory
/etc/rc.conf.d/php_fpm/instances:
file.managed:
- source: salt://roles/webserver-alkane/php/files/rc/instances
- template: jinja
- context:
instances: {{ instances }}
{% for instance, config in pillar['php_fpm_instances'].items() %}
/etc/rc.conf.d/php_fpm/{{ instance }}:
file.managed:
- source: salt://roles/webserver-alkane/php/files/rc/per_instance
- template: jinja
- context:
instance: {{ instance }}
command: {{ config['command'] | default('') }}
{% endfor %}
{% endif %}

File Metadata

Mime Type
text/x-diff
Expires
Sun, Nov 24, 19:43 (3 h, 19 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2258818
Default Alt Text
(3 KB)

Event Timeline