Page MenuHomeDevCentral

D3337.diff
No OneTemporary

D3337.diff

diff --git a/roles/webserver-alkane/php/files/restart-php-fpm.sh b/roles/webserver-alkane/php/files/restart-php-fpm.sh
new file mode 100755
--- /dev/null
+++ b/roles/webserver-alkane/php/files/restart-php-fpm.sh
@@ -0,0 +1,31 @@
+#!/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
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+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
--- a/roles/webserver-alkane/php/service.sls
+++ b/roles/webserver-alkane/php/service.sls
@@ -18,6 +18,11 @@
- source: salt://roles/webserver-alkane/php/files/rc/php-fpm
- mode: 755
+/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

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 01:36 (17 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2308701
Default Alt Text
D3337.diff (1 KB)

Event Timeline