-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Included Etherpad Lite installation scripts.
- Loading branch information
Sem
committed
Dec 21, 2011
1 parent
1af94f7
commit 5c89c02
Showing
8 changed files
with
467 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#sh node.sh | ||
#sh npm.sh | ||
#sh etherpad-lite.sh | ||
echo "Copy this API KEY:" | ||
echo "" | ||
cat /usr/share/etherpad-lite/APIKEY.txt | ||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/sh | ||
|
||
### BEGIN INIT INFO | ||
# Provides: etherpad-lite | ||
# Required-Start: $local_fs $remote_fs $network $syslog | ||
# Required-Stop: $local_fs $remote_fs $network $syslog | ||
# Default-Start: 2 3 4 5 | ||
# Default-Stop: 0 1 6 | ||
# Short-Description: starts etherpad lite | ||
# Description: starts etherpad lite using start-stop-daemon | ||
### END INIT INFO | ||
|
||
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/node/bin" | ||
LOGFILE="/var/log/etherpad-lite/etherpad-lite.log" | ||
EPLITE_DIR="/usr/share/etherpad-lite" | ||
EPLITE_BIN="bin/safeRun.sh" | ||
USER="etherpad-lite" | ||
GROUP="etherpad-lite" | ||
DESC="Etherpad Lite" | ||
NAME="etherpad-lite" | ||
|
||
set -e | ||
|
||
. /lib/lsb/init-functions | ||
|
||
start() { | ||
echo "Starting $DESC... " | ||
|
||
start-stop-daemon --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile /var/run/$NAME.pid --exec $EPLITE_DIR/$EPLITE_BIN -- $LOGFILE || true | ||
echo "done" | ||
} | ||
|
||
#We need this function to ensure the whole process tree will be killed | ||
killtree() { | ||
local _pid=$1 | ||
local _sig=${2-TERM} | ||
for _child in $(ps -o pid --no-headers --ppid ${_pid}); do | ||
killtree ${_child} ${_sig} | ||
done | ||
kill -${_sig} ${_pid} | ||
} | ||
|
||
stop() { | ||
echo "Stopping $DESC... " | ||
while test -d /proc/$(cat /var/run/$NAME.pid); do | ||
killtree $(cat /var/run/$NAME.pid) 15 | ||
sleep 0.5 | ||
done | ||
rm /var/run/$NAME.pid | ||
echo "done" | ||
} | ||
|
||
status() { | ||
status_of_proc -p /var/run/$NAME.pid "" "etherpad-lite" && exit 0 || exit $? | ||
} | ||
|
||
case "$1" in | ||
start) | ||
start | ||
;; | ||
stop) | ||
stop | ||
;; | ||
restart) | ||
stop | ||
start | ||
;; | ||
status) | ||
status | ||
;; | ||
*) | ||
echo "Usage: $NAME {start|stop|restart|status}" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
# Install etherpad-lite | ||
git clone git://github.com/Pita/etherpad-lite.git /usr/share/etherpad-lite | ||
sh /usr/share/etherpad-lite/bin/installDeps.sh | ||
|
||
# Configure Etherpad settings | ||
cp settings.json.template /usr/share/etherpad-lite/settings.json | ||
nano /usr/share/etherpad-lite/settings.json | ||
|
||
# Create a user called etherpad-lite | ||
useradd -r -d /bin/false etherpad-lite | ||
|
||
# Create a log folder for the service /var/log/etherpad-lite | ||
mkdir /var/log/etherpad-lite | ||
|
||
# Ensure the etherpad-lite user have full access to the log and the git folder | ||
chown -R etherpad-lite /var/log/etherpad-lite | ||
|
||
# Copy following script to /etc/init.d/ and configure the variables | ||
cp ep-daemon /etc/init.d/etherpad-lite | ||
|
||
# Make sure the script is marked as executable | ||
chmod +x /etc/init.d/etherpad-lite | ||
|
||
# Enable it with | ||
update-rc.d etherpad-lite defaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
############################################################## | ||
# | ||
# Author: Ruslan Khissamov, email: rrkhissamov@gmail.com | ||
# | ||
############################################################## | ||
# Update System | ||
echo 'System Update' | ||
apt-get -y update | ||
echo 'Update completed' | ||
# Install help app | ||
apt-get -y install libssl-dev git-core pkg-config build-essential curl gcc g++ | ||
# Download & Unpack Node.js - v. 0.6.2 | ||
echo 'Download Node.js - v. 0.6.2' | ||
mkdir /tmp/node-install | ||
cd /tmp/node-install | ||
wget http://nodejs.org/dist/v0.6.2/node-v0.6.2.tar.gz | ||
tar -zxf node-v0.6.2.tar.gz | ||
echo 'Node.js download & unpack completed' | ||
# Install Node.js | ||
echo 'Install Node.js' | ||
cd node-v0.6.2 | ||
./configure && make && make install | ||
echo 'Node.js install completed' |
Oops, something went wrong.