#!/bin/sh ### BEGIN INIT INFO # Provides: xrdp # Required-Start: $remote_fs $syslog $network # Required-Stop: $remote_fs $syslog $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: xrdp (X Remote Desktop Protocol) full server # Description: The xrdp daemon uses the Remote Desktop Protocol # to present a graphical login to a remote client, # allowing connections to an xorgxrdp or VNC server # or another RDP server. The xrdp-sesman daemon # authenticates the users against PAM and starts # the session and, if necessary, X11 server. ### END INIT INFO #- # Copyright © 2015, 2019 mirabilos <thorsten.glaser@teckids.org> # Published under The MirOS Licence. # absolute basics LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin export LC_ALL PATH unset LANGUAGE # exit cleanly if disabled or not installed test -x /usr/sbin/xrdp || exit 0 # Debian/LSB init script foobar DESC='Remote Desktop Protocol server' NAME=xrdp . /lib/init/vars.sh test -t 0 && VERBOSE=yes . /lib/lsb/init-functions # read options SESMAN_START=yes SESMAN_OPTIONS= XRDP_OPTIONS= test -r /etc/default/xrdp && . /etc/default/xrdp # prepare for actions case $1 in (status) # nothing to do here ;; (start|stop|force-reload|restart|try-restart) # check for root; create run-time directories . /usr/share/xrdp/socksetup ;; (*) # syntax error echo >&2 "Usage: $0 {start|stop|status|restart|try-restart|force-reload}" exit 3 ;; esac # take action rv=0 case $1 in (start) test x"$VERBOSE" = x"no" || log_daemon_msg "Starting $DESC" test x"$SESMAN_START" = x"yes" && \ if start-stop-daemon --start --quiet \ --pidfile /run/xrdp/xrdp-sesman.pid \ --startas /usr/sbin/xrdp-sesman --name xrdp-sesman \ --exec /usr/sbin/xrdp-sesman --test; then test x"$VERBOSE" = x"no" || log_progress_msg "xrdp-sesman" start-stop-daemon --start --quiet \ --pidfile /run/xrdp/xrdp-sesman.pid \ --startas /usr/sbin/xrdp-sesman --name xrdp-sesman \ --exec /usr/sbin/xrdp-sesman -- $SESMAN_OPTIONS rc=$? test $rc -gt 0 && rv=$rc else test x"$VERBOSE" = x"no" || \ log_progress_msg "sesman already running" fi if start-stop-daemon --start --quiet \ --pidfile /run/xrdp/xrdp.pid \ --chuid xrdp:xrdp \ --startas /usr/sbin/xrdp --name xrdp \ --exec /usr/sbin/xrdp --test; then test x"$VERBOSE" = x"no" || log_progress_msg "xrdp" start-stop-daemon --start --quiet \ --pidfile /run/xrdp/xrdp.pid \ --chuid xrdp:xrdp \ --startas /usr/sbin/xrdp --name xrdp \ --exec /usr/sbin/xrdp -- $XRDP_OPTIONS >/dev/null rc=$? test $rc -gt 0 && rv=$rc else test x"$VERBOSE" = x"no" || \ log_progress_msg "xrdp already running" fi test x"$VERBOSE" = x"no" || log_end_msg $rv ;; (stop) test x"$VERBOSE" = x"no" || log_daemon_msg "Stopping $DESC" test x"$VERBOSE" = x"no" || log_progress_msg "xrdp" start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \ --pidfile /run/xrdp/xrdp.pid \ --name xrdp --exec /usr/sbin/xrdp rc=$? if test $rc -gt 1; then rv=$rc else start-stop-daemon --stop --quiet --oknodo \ --retry=0/30/KILL/5 --exec /usr/sbin/xrdp rc=$? test $rc -gt 1 && test $rv -lt $rc && rv=$rc fi test x"$VERBOSE" = x"no" || log_progress_msg "xrdp-sesman" start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \ --pidfile /run/xrdp/xrdp-sesman.pid \ --name xrdp-sesman --exec /usr/sbin/xrdp-sesman rc=$? if test $rc -gt 1; then rv=$rc else start-stop-daemon --stop --quiet --oknodo \ --retry=0/30/KILL/5 --exec /usr/sbin/xrdp-sesman rc=$? test $rc -gt 1 && test $rv -lt $rc && rv=$rc fi rm -f /run/xrdp/xrdp-sesman.pid /run/xrdp/xrdp.pid rm -rf /run/xrdp/sockdir test x"$VERBOSE" = x"no" || log_end_msg $rv ;; (status) if test x"$SESMAN_START" = x"yes"; then status_of_proc -p /run/xrdp/xrdp-sesman.pid \ /usr/sbin/xrdp-sesman xrdp-sesman rc=$? test $rc -gt $rv && rv=$rc fi status_of_proc -p /run/xrdp/xrdp.pid /usr/sbin/xrdp xrdp rc=$? test $rc -gt $rv && rv=$rc exit $rv ;; (force-reload|restart) test x"$VERBOSE" = x"no" || log_daemon_msg "Restarting $DESC" if test x"$SESMAN_START" = x"yes"; then test x"$VERBOSE" = x"no" || log_progress_msg "xrdp-sesman" start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \ --pidfile /run/xrdp/xrdp-sesman.pid \ --name xrdp-sesman --exec /usr/sbin/xrdp-sesman if test $? -lt 2; then start-stop-daemon --stop --quiet --oknodo \ --retry=0/30/KILL/5 --exec /usr/sbin/xrdp-sesman fi rm -f /run/xrdp/xrdp-sesman.pid start-stop-daemon --start --quiet \ --pidfile /run/xrdp/xrdp-sesman.pid \ --startas /usr/sbin/xrdp-sesman --name xrdp-sesman \ --exec /usr/sbin/xrdp-sesman -- $SESMAN_OPTIONS rc=$? test $rc -gt 0 && rv=$rc fi test x"$VERBOSE" = x"no" || log_progress_msg "xrdp" start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \ --pidfile /run/xrdp/xrdp.pid \ --name xrdp --exec /usr/sbin/xrdp if test $? -lt 2; then start-stop-daemon --stop --quiet --oknodo \ --retry=0/30/KILL/5 --exec /usr/sbin/xrdp fi rm -f /run/xrdp/xrdp.pid start-stop-daemon --start --quiet \ --pidfile /run/xrdp/xrdp.pid \ --chuid xrdp:xrdp \ --startas /usr/sbin/xrdp --name xrdp \ --exec /usr/sbin/xrdp -- $XRDP_OPTIONS >/dev/null rc=$? test $rc -gt 0 && rv=$rc test x"$VERBOSE" = x"no" || log_end_msg $rv ;; (try-restart) test x"$VERBOSE" = x"no" || log_daemon_msg "Trying to restart $DESC" if ! status_of_proc -p /run/xrdp/xrdp.pid \ /usr/sbin/xrdp xrdp >/dev/null 2>&1; then test x"$VERBOSE" = x"no" || log_progress_msg "is not running." test x"$VERBOSE" = x"no" || log_end_msg 1 exit 0 fi if status_of_proc -p /run/xrdp/xrdp-sesman.pid \ /usr/sbin/xrdp-sesman xrdp-sesman >/dev/null 2>&1; then test x"$VERBOSE" = x"no" || log_progress_msg "xrdp-sesman" start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \ --pidfile /run/xrdp/xrdp-sesman.pid \ --name xrdp-sesman --exec /usr/sbin/xrdp-sesman if test $? -lt 2; then start-stop-daemon --stop --quiet --oknodo \ --retry=0/30/KILL/5 --exec /usr/sbin/xrdp-sesman fi rm -f /run/xrdp/xrdp-sesman.pid start-stop-daemon --start --quiet \ --pidfile /run/xrdp/xrdp-sesman.pid \ --startas /usr/sbin/xrdp-sesman --name xrdp-sesman \ --exec /usr/sbin/xrdp-sesman -- $SESMAN_OPTIONS rc=$? test $rc -gt 0 && rv=$rc fi test x"$VERBOSE" = x"no" || log_progress_msg "xrdp" start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \ --pidfile /run/xrdp/xrdp.pid \ --name xrdp --exec /usr/sbin/xrdp if test $? -lt 2; then start-stop-daemon --stop --quiet --oknodo \ --retry=0/30/KILL/5 --exec /usr/sbin/xrdp fi rm -f /run/xrdp/xrdp.pid start-stop-daemon --start --quiet \ --pidfile /run/xrdp/xrdp.pid \ --chuid xrdp:xrdp \ --startas /usr/sbin/xrdp --name xrdp \ --exec /usr/sbin/xrdp -- $XRDP_OPTIONS >/dev/null rc=$? test $rc -gt 0 && rv=$rc test x"$VERBOSE" = x"no" || log_end_msg $rv ;; esac # make “/etc/init.d/xrdp status” work for nōn-root (sleep 3; chmod a+r /run/xrdp/*.pid 2>/dev/null) & exit $rv
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
K01apache-htcacheclean | File | 2.43 KB | 0755 |
|
K01speech-dispatcher | File | 1.99 KB | 0755 |
|
S01acpid | File | 2.22 KB | 0755 |
|
S01anacron | File | 2.01 KB | 0755 |
|
S01apache2 | File | 7.99 KB | 0755 |
|
S01apport | File | 2.85 KB | 0755 |
|
S01avahi-daemon | File | 2.34 KB | 0755 |
|
S01bluetooth | File | 2.9 KB | 0755 |
|
S01console-setup.sh | File | 1.2 KB | 0755 |
|
S01cron | File | 2.99 KB | 0755 |
|
S01cups | File | 2.74 KB | 0755 |
|
S01cups-browsed | File | 1.92 KB | 0755 |
|
S01dbus | File | 3.08 KB | 0755 |
|
S01gdm3 | File | 2.96 KB | 0755 |
|
S01grub-common | File | 985 B | 0755 |
|
S01irqbalance | File | 2.58 KB | 0755 |
|
S01kerneloops | File | 3.06 KB | 0755 |
|
S01mysql | File | 5.48 KB | 0755 |
|
S01openvpn | File | 8.92 KB | 0755 |
|
S01plymouth | File | 1.33 KB | 0755 |
|
S01pulseaudio-enable-autospawn | File | 469 B | 0755 |
|
S01rsync | File | 4.31 KB | 0755 |
|
S01rsyslog | File | 2.8 KB | 0755 |
|
S01saned | File | 2.17 KB | 0755 |
|
S01spice-vdagent | File | 2.43 KB | 0755 |
|
S01ssh | File | 3.85 KB | 0755 |
|
S01unattended-upgrades | File | 1.36 KB | 0755 |
|
S01uuidd | File | 1.28 KB | 0755 |
|
S01vm-agent | File | 8.28 KB | 0550 |
|
S01vsftpd | File | 2.02 KB | 0755 |
|
S01whoopsie | File | 485 B | 0755 |
|
S01xrdp | File | 7.12 KB | 0755 |
|