Add linux user with privilieges to start tdpsd

Add linux user with privilieges to start tdpsd

Postby mediakreativ » 07 Feb 2014, 20:51

Hello there,

can anybody describe me how to add a user via SSH which has the ability to view the Teamdrive Server installation and stop / start tdpsd?

Cheers, Christian
mediakreativ
 
Posts: 4
Joined: 08 Sep 2012, 03:55

Re: Add linux user with privilieges to start tdpsd

Postby mediakreativ » 15 Jan 2015, 19:43

Hello there,

and again I am unsure how to start tdpsd - cannot start is as a user, just as root.


Any idea what I am doing wrong?
mediakreativ
 
Posts: 4
Joined: 08 Sep 2012, 03:55

Re: Add linux user with privilieges to start tdpsd

Postby Spacey » 19 Feb 2015, 16:14

Hi,

I've got a special user which owns the tdps "setup". Here's the /etc/init.d/tdps startscript I'm using to autostart the server:


Code: Select all
#! /bin/sh
### BEGIN INIT INFO
# Provides:          TeamDrive Personal Server
# Required-Start:    networking
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      S 0 1 6
# Short-Description: TeamDrive Personal Server Daemon
# Description:       Starts/Stops/Restarts the TeamDrive Personal Server Daemon
### END INIT INFO
#
#
###############################################################################
# Version History / Change Log:
###############################################################################
#
# 2011-02-16    St. Fu.         CREATE: Create new script to support
#                                       TD service autorun under Ubuntu/Debian
#                                                                               Tested with i386 and AMD64 Linux
#                                                                               Script is under GPLv2
# 2013-07-30    St. Fu.                 UPDATE: Support for new Version
#
#
################################################################################

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="TeamDrive 1.1.058 Server Linux"
NAME=tdpsd
USER=setup
DIR=/home/setup/tdps
DAEMON=$DIR/tdpsd
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Export necessary for starting...
export LD_LIBRARY_PATH="$DIR:$LD_LIBRARY_PATH"

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

d_start() {
        start-stop-daemon --start --quiet \
                --background \
                --chuid $USER \
                --chdir $DIR \
                --exec $DAEMON \
                > /dev/null \
                || echo -n " already running"
}

d_stop() {
        start-stop-daemon --stop --quiet \
                --chuid $USER \
                --chdir $DIR \
                --exec $DAEMON \
                || echo -n " not running"
}

case "$1" in
  start)
        echo -n "Starting $DESC: $NAME"
        d_start
        echo "."
        ;;
  stop)
        echo -n "Stopping $DESC: $NAME"
        d_stop
        echo "."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: $NAME"
        d_stop
        sleep 15
        d_start
       echo "."
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        exit 3
        ;;
esac

exit 0


Please edit the variables to fit your needs and put it into the wanted runlevels.

Regards, Spacey
Spacey
 
Posts: 12
Joined: 27 Apr 2011, 16:42


Return to TeamDrive Personal Server

Who is online

Users browsing this forum: No registered users and 1 guest

cron