summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-André Moreau <marcandre.moreau@gmail.com>2013-07-05 13:15:00 -0700
committerMarc-André Moreau <marcandre.moreau@gmail.com>2013-07-05 13:15:00 -0700
commit12381b1c0d7cc6a497a12b32c2d7e9be19ddb309 (patch)
treefa230d29593fe172527b3d8adbb884c9b7ed704d
parent071329592108d261f1010c3d65699c1b2973bcf9 (diff)
parent781e992c9e77ec90319b5b71799fb45c3d400dec (diff)
downloadxrdp-proprietary-12381b1c0d7cc6a497a12b32c2d7e9be19ddb309.tar.gz
xrdp-proprietary-12381b1c0d7cc6a497a12b32c2d7e9be19ddb309.zip
Merge pull request #86 from cocoon/master
Dynamically build initscript paths from given prefix
-rw-r--r--instfiles/Makefile.am1
-rw-r--r--instfiles/init.d/xrdp12
2 files changed, 8 insertions, 5 deletions
diff --git a/instfiles/Makefile.am b/instfiles/Makefile.am
index 7ba86d3d..1a73fd24 100644
--- a/instfiles/Makefile.am
+++ b/instfiles/Makefile.am
@@ -29,3 +29,4 @@ startscript_DATA = \
install-data-hook:
chmod 755 $(DESTDIR)$(sysconfdir)/xrdp/xrdp.sh
chmod 755 $(DESTDIR)$(sysconfdir)/init.d/xrdp
+ sed -i 's|__BASE__|$(prefix)|' $(sysconfdir)/init.d/xrdp;
diff --git a/instfiles/init.d/xrdp b/instfiles/init.d/xrdp
index 2cf20999..dcdb01a4 100644
--- a/instfiles/init.d/xrdp
+++ b/instfiles/init.d/xrdp
@@ -15,7 +15,9 @@
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/sbin/xrdp
+BASE=__BASE__
+DAEMON=${BASE}/sbin/xrdp
+SDAEMON=${BASE}/sbin/xrdp-sesman
PIDDIR=/var/run/xrdp/
SESMAN_START=yes
#USERID=xrdp
@@ -97,7 +99,7 @@ case "$1" in
if [ "$SESMAN_START" = "yes" ] ; then
log_progress_msg "sesman"
start-stop-daemon --start --quiet --oknodo --pidfile $PIDDIR/xrdp-sesman.pid \
- --exec /usr/sbin/xrdp-sesman >/dev/null
+ --exec $SDAEMON >/dev/null
value=$?
[ $value -gt 0 ] && exitval=$value
fi
@@ -117,9 +119,9 @@ case "$1" in
exitval=0
log_daemon_msg "Stopping RDP Session manager "
log_progress_msg "sesman"
- if pidofproc -p $PIDDIR/xrdp-sesman.pid /usr/sbin/xrdp-sesman > /dev/null; then
+ if pidofproc -p $PIDDIR/xrdp-sesman.pid $SDAEMON > /dev/null; then
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDDIR/xrdp-sesman.pid \
- --chuid $USERID:$USERID --exec /usr/sbin/xrdp-sesman
+ --chuid $USERID:$USERID --exec $SDAEMON
exitval=$?
else
log_progress_msg "apparently not running"
@@ -164,7 +166,7 @@ case "$1" in
fi
if [ "$SESMAN_START" = "yes" ] ; then
log_daemon_msg "Checking status of RDP Session Manager" "sesman"
- if pidofproc -p $PIDDIR/xrdp-sesman.pid /usr/sbin/xrdp-sesman > /dev/null; then
+ if pidofproc -p $PIDDIR/xrdp-sesman.pid $SDAEMON > /dev/null; then
log_progress_msg "running"
log_end_msg 0
else