Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3916630
D3337.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3337.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D3337: Allow to restart php-fpm on FreeBSD servers after PHP update
Attached
Detach File
Event Timeline
Log In to Comment