drupal/rc.drupal

Tue, 28 Aug 2012 18:36:35 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:36:35 +0200
changeset 579
6b18bb69901e
permissions
-rw-r--r--

Correct the paths of patched scripts, refine password generation,
mitigate fdatasync(2) detection problems, correct dependencies, remove
outdated autoconf components, correct conf file paths and attributes,
complete and correct log file rotation handing, and note warnings
useful for diagnosing builds.

michael@529 1 #!@l_prefix@/bin/openpkg rc
michael@529 2 ##
michael@529 3 ## rc.drupal -- Run-Commands
michael@529 4 ##
michael@529 5
michael@529 6 %config
michael@529 7 drupal_enable="$openpkg_rc_def"
michael@529 8 drupal_cron="@l_drupal_cron@"
michael@529 9 drupal_backup="daily"
michael@529 10
michael@529 11 %status -u @l_susr@ -o
michael@529 12 drupal_usable="no"
michael@529 13 drupal_active="no"
michael@529 14 @l_prefix@/sbin/apache -t \
michael@529 15 -f @l_prefix@/etc/drupal/drupal-apache.conf 2>/dev/null && \
michael@529 16 drupal_usable="yes"
michael@529 17 [ -f @l_prefix@/var/drupal/run/apache.pid ] && \
michael@529 18 kill -0 `cat @l_prefix@/var/drupal/run/apache.pid` && \
michael@529 19 drupal_active="yes"
michael@529 20 echo "drupal_enable=\"$drupal_enable\""
michael@529 21 echo "drupal_usable=\"$drupal_usable\""
michael@529 22 echo "drupal_active=\"$drupal_active\""
michael@529 23
michael@529 24 %start -u @l_susr@
michael@529 25 rcService drupal enable yes || exit 0
michael@529 26 rcService drupal active yes && exit 0
michael@529 27 @l_prefix@/sbin/apache \
michael@529 28 -f @l_prefix@/etc/drupal/drupal-apache.conf
michael@529 29
michael@529 30 %stop -u @l_susr@
michael@529 31 rcService drupal enable yes || exit 0
michael@529 32 rcService drupal active no && exit 0
michael@529 33 [ -f @l_prefix@/var/drupal/run/apache.pid ] && \
michael@529 34 kill -TERM `cat @l_prefix@/var/drupal/run/apache.pid`
michael@529 35 sleep 2
michael@529 36
michael@529 37 %restart -u @l_susr@
michael@529 38 rcService drupal enable yes || exit 0
michael@529 39 rcService drupal active no && exit 0
michael@529 40 rc drupal stop start
michael@529 41
michael@529 42 %quarterly -u @l_rusr@
michael@529 43 rcService drupal enable yes || exit 0
michael@529 44 if [ ".$drupal_cron" = .yes ]; then
michael@529 45 @l_prefix@/sbin/drupal-cron
michael@529 46 fi
michael@529 47
michael@529 48 %hourly -u @l_rusr@
michael@529 49 rcService drupal enable yes || exit 0
michael@529 50 if [ ".$drupal_backup" = .hourly ]; then
michael@529 51 @l_prefix@/sbin/drupal-setup backup || exit $?
michael@529 52 fi
michael@529 53
michael@529 54 %daily -u @l_rusr@
michael@529 55 rcService drupal enable yes || exit 0
michael@529 56 if [ ".$drupal_backup" = .daily ]; then
michael@529 57 @l_prefix@/sbin/drupal-setup backup || exit $?
michael@529 58 fi
michael@529 59
michael@529 60 %weekly -u @l_rusr@
michael@529 61 rcService drupal enable yes || exit 0
michael@529 62 if [ ".$drupal_backup" = .weekly ]; then
michael@529 63 @l_prefix@/sbin/drupal-setup backup || exit $?
michael@529 64 fi
michael@529 65

mercurial