summaryrefslogtreecommitdiff
path: root/net-misc/dropbox/files
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/dropbox/files')
-rw-r--r--net-misc/dropbox/files/dropbox.conf14
-rw-r--r--net-misc/dropbox/files/dropbox.initd65
-rw-r--r--net-misc/dropbox/files/dropbox_at.service-r237
3 files changed, 116 insertions, 0 deletions
diff --git a/net-misc/dropbox/files/dropbox.conf b/net-misc/dropbox/files/dropbox.conf
new file mode 100644
index 00000000..c20c3c46
--- /dev/null
+++ b/net-misc/dropbox/files/dropbox.conf
@@ -0,0 +1,14 @@
+# /etc/conf.d/dropbox.conf: config file for /etc/init.d/dropbox
+
+# Users to run dropbox
+DROPBOX_USERS=""
+
+# integer [-20 .. 19 ] default 0
+# change the priority of the server -20 (high) to 19 (low)
+# see nice(1) for description
+#NICE=0
+
+# See start-stop-daemon(8) for possible settings
+#IONICE=2
+
+PID_DIR=/var/run/dropbox
diff --git a/net-misc/dropbox/files/dropbox.initd b/net-misc/dropbox/files/dropbox.initd
new file mode 100644
index 00000000..4f8dd706
--- /dev/null
+++ b/net-misc/dropbox/files/dropbox.initd
@@ -0,0 +1,65 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+depend() {
+ need localmount net
+ after bootmisc
+}
+
+start() {
+ local tmpnice="${NICE:+"--nicelevel "}${NICE}"
+ local tmpionice="${IONICE:+"--ionice "}${IONICE}"
+ local started=""
+
+ ebegin "Starting dropbox"
+ for dbuser in ${DROPBOX_USERS}; do
+ local homedir=$(eval echo ~${dbuser})
+ if test -d "${homedir}" && \
+ echo 0 > ${homedir}/.dropbox/dropbox.pid && \
+ start-stop-daemon -S -b \
+ ${tmpnice} ${tmpionice} \
+ -u ${dbuser} -v \
+ -p ${homedir}/.dropbox/dropbox.pid \
+ -e HOME=${homedir} \
+ -x /opt/bin/dropbox; then
+ started="${started} ${dbuser}"
+ else
+ eend $?
+ eerror "Failed to start dropbox for ${dbuser}"
+ if [ -n "${started}" ]; then
+ eerror "Stopping already started dropbox"
+ DROPBOX_USERS=${started} stop
+ fi
+ return 1
+ fi
+ done
+ if [ -z "${started}" ];then
+ eerror "No dropbox started"
+ eend 1
+ else
+ eend 0
+ fi
+}
+
+stop() {
+ local retval=0
+ ebegin "Stopping dropbox"
+ for dbuser in ${DROPBOX_USERS}; do
+ local homedir=$(eval echo ~${dbuser})
+ start-stop-daemon --stop \
+ --pidfile ${homedir}/.dropbox/dropbox.pid || retval=$?
+ done
+ eend ${retval}
+}
+
+status() {
+ for dbuser in ${DROPBOX_USERS}; do
+ local homedir=$(eval echo ~${dbuser})
+ if [ -e ${homedir}/.dropbox/dropbox.pid ] ; then
+ echo "dropboxd for USER $dbuser: running."
+ else
+ echo "dropboxd for USER $dbuser: not running."
+ fi
+ done
+}
diff --git a/net-misc/dropbox/files/dropbox_at.service-r2 b/net-misc/dropbox/files/dropbox_at.service-r2
new file mode 100644
index 00000000..a21362f3
--- /dev/null
+++ b/net-misc/dropbox/files/dropbox_at.service-r2
@@ -0,0 +1,37 @@
+# Copyright (c) 2015, Joe Roback
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+[Unit]
+Description=Dropbox as a system service
+After=local-fs.target network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/env "/home/%i/.dropbox-dist/dropboxd"
+Restart=on-failure
+RestartSec=1
+User=%i
+
+[Install]
+WantedBy=multi-user.target