Skip to content

Instantly share code, notes, and snippets.

@rikur
Last active December 4, 2015 06:37
Show Gist options
  • Save rikur/14ec246ccdccf5bc4207 to your computer and use it in GitHub Desktop.
Save rikur/14ec246ccdccf5bc4207 to your computer and use it in GitHub Desktop.
START PHD ON REBOOT:
--------------------
# cat /etc/init/phd.conf
# Phabricator daemons init script
# You will need to change PHD_HOME to suit your installation
description "Phabricator Daemon launcher"
author "kaismh"
start on started php5-fpm
stop on runlevel [!2345]
respawn
respawn limit 10 5
oom never
kill timeout 86400 #If it's given a stop order, this is how long it will take to stop.
setuid www-data
setgid www-data
env PHD_HOME=/var/www/phabricator/bin/
pre-start script
# Start phd
exec $PHD_HOME/phd start
end script
post-stop script
# Stop phd
exec $PHD_HOME/phd stop
end script
*********************************************************************************
*********************************************************************************
SSHD SETTINGS FOR PHABRICATOR: (NOTE, FIRST CHANGE DEFAULT SSH PORT TO SOMETHING LIKE 222)
# cat /etc/ssh/sshd_config.phabricator
# NOTE: You must have OpenSSHD 6.2 or newer; support for AuthorizedKeysCommand
# was added in this version.
# NOTE: Edit these to the correct values for your setup.
AuthorizedKeysCommand /var/phabricator/phabricator-ssh-hook.sh
AuthorizedKeysCommandUser git
AllowUsers git
# You may need to tweak these options, but mostly they just turn off everything
# dangerous.
Port 22
Protocol 2
PermitRootLogin no
AllowAgentForwarding no
AllowTcpForwarding no
PrintMotd no
PrintLastLog no
PasswordAuthentication no
AuthorizedKeysFile none
PidFile /var/run/sshd-phabricator.pid
*********************************************************************************
*********************************************************************************
START PHABRICATOR SSHD ON REBOOT:
# cat /etc/init/ssh-phabricator.conf
# ssh - OpenBSD Secure Shell server
#
# The OpenSSH server provides secure shell access to the system.
description "SSH for Phabricator git pushes"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
umask 022
env SSH_SIGSTOP=1
expect stop
# 'sshd -D' leaks stderr and confuses things in conjunction with 'console log'
console none
pre-start script
test -x /usr/sbin/sshd || { stop; exit 0; }
test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; }
mkdir -p -m0755 /var/run/sshd
end script
# if you used to set SSHD_OPTS in /etc/default/ssh, you can change the
# 'exec' line here instead
exec /usr/sbin/sshd -D -f /etc/ssh/sshd_config.phabricator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment