This repository has been archived by the owner on Oct 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 195
Debian Installation (Pre Jessie)
silverwind edited this page Mar 18, 2017
·
5 revisions
This is an example configuration on a Debian system. It runs droppy through its own user and on system startup. All commands shall be run as root. /srv/droppy
will be used to store data and configuration in this example.
npm install -g droppy
groupadd -r droppy
useradd -r -s /bin/false -d /srv/droppy -g droppy droppy
mkdir -p /srv/droppy/config /srv/droppy/files
chown -R droppy:droppy /srv/droppy
chmod 755 /srv/droppy
$EDITOR /etc/init.d/droppy
#!/bin/sh
### BEGIN INIT INFO
# Provides: droppy
# Required-Start: $network $remote_fs $local_fs
# Required-Stop: $network $remote_fs $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: droppy
# Description: droppy
### END INIT INFO
PROCESS="droppy"
RUNAS="droppy:droppy"
CMD="/usr/bin/env droppy start -c /srv/droppy/config -f /srv/droppy/files"
do_start() {
start-stop-daemon --start --background -c $RUNAS --name $PROCESS --exec $CMD
}
do_stop() {
start-stop-daemon --stop --name $PROCESS
}
case "$1" in
start)
do_start
;;
stop)
do_stop
;;
restart)
do_stop
do_start
;;
*)
echo "Usage: "$1" {start|stop|restart}"
exit 1
;;
esac
exit 0
chmod 755 /etc/init.d/droppy
update-rc.d droppy defaults
apt-get install libcap2-bin
setcap 'cap_net_bind_service=+ep' $(which node)
su droppy -c 'droppy config'
service droppy start