Page MenuHomePhabricator
Paste P1222

Upgrade phabricator, start, stop phd daemons
ActivePublic

Authored by mim on Aug 3 2014, 7:11 AM.
Tags
None
Referenced Files
F185601: Upgrade_phabricator,_start,_stop_phd_daemons
Aug 3 2014, 7:11 AM
Subscribers
None
#!/bin/sh
### BEGIN INIT INFO
# Provides: phd
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: starts|stops phd daemon for phabricator
# Description: Starts|stops phd daemon for phabricator also provides way to upgrade phabricator totally
### END INIT INFO
ROOT=`pwd`
PHABRICATOR_ENV=custom/myconfig
stop() {
sudo -u www-data PHABRICATOR_ENV=$PHABRICATOR_ENV $ROOT/phabricator/bin/phd stop
}
upgrade(){
/etc/init.d/php5-fpm stop
git -C $ROOT/phabricator pull
git -C $ROOT/arcanist pull
git -C $ROOT/libphutil pull
$ROOT/phabricator/bin/storage upgrade -f --user root --password password
/etc/init.d/php5-fpm start
}
start() {
sudo -u www-data PHABRICATOR_ENV=$PHABRICATOR_ENV $ROOT/phabricator/bin/phd start
}
case "$1" in
start)
log_begin_msg "Starting phd daemon..."
start
log_end_msg $?
;;
stop)
log_begin_msg "Stopping phd daemon..."
stop
log_end_msg 0
;;
log_begin_msg "Restarting phd daemon..."
stop
start
log_end_msg $?
;;
upgrade)
log_begin_msg "Restarting phd daemon..."
stop
upgrade
start
log_end_msg $?
;;
*)
echo "Usage: /etc/init.d/iptables {start|stop|restart|upgrade}" >&2
exit 1
;;
esac
exit 0

Event Timeline

mim changed the title of this paste from untitled to Upgrade phabricator, start, stop phd daemons .
mim updated the paste's language from autodetect to autodetect.
mim updated the paste's language from autodetect to bash.