From cf054b08881f74b314ef723d3a5a0b696a0c3246 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 24 Sep 2021 07:51:02 -0700 Subject: [PATCH] wordpress: Run service only if when installed and configured - This avoids attempting to run the service soon after FreedomBox is installed. Tests: - When old freedombox.deb is installed, the service is enabled. When upgraded to newer .deb with the changes, the service is still enabled but no start attempt is made by systemd. - After installation of WordPress, the service is running as expected. - On a fresh installation, WordPress service is working as expected. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- .../data/usr/lib/systemd/system/wordpress-freedombox.service | 1 + 1 file changed, 1 insertion(+) diff --git a/plinth/modules/wordpress/data/usr/lib/systemd/system/wordpress-freedombox.service b/plinth/modules/wordpress/data/usr/lib/systemd/system/wordpress-freedombox.service index c25e0ac2a..b7bcdaf72 100644 --- a/plinth/modules/wordpress/data/usr/lib/systemd/system/wordpress-freedombox.service +++ b/plinth/modules/wordpress/data/usr/lib/systemd/system/wordpress-freedombox.service @@ -3,6 +3,7 @@ [Unit] Description=WordPress Scheduled Events Trigger (Cron) Documentation=https://rtcamp.com/tutorials/wordpress/wp-cron-crontab/ +ConditionPathExists=/etc/wordpress/config-default.php [Service] CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SETUID CAP_SETGID CAP_SETPCAP CAP_CHOWN CAP_FSETID CAP_SETFCAP CAP_DAC_OVERRIDE CAP_DAC_READ_SEARCH CAP_FOWNER CAP_IPC_OWNER CAP_NET_ADMIN CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE CAP_KILL CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_LINUX_IMMUTABLE CAP_IPC_LOCK CAP_SYS_CHROOT CAP_BLOCK_SUSPEND CAP_LEASE CAP_SYS_PACCT CAP_SYS_TTY_CONFIG CAP_SYS_BOOT CAP_MAC_ADMIN CAP_MAC_OVERRIDE CAP_SYS_NICE CAP_SYS_RESOURCE