summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--instfiles/Makefile.am24
-rw-r--r--instfiles/xrdp-sesman.service17
-rw-r--r--instfiles/xrdp-sesman.service.in17
-rw-r--r--instfiles/xrdp.service16
-rw-r--r--instfiles/xrdp.service.in16
5 files changed, 55 insertions, 35 deletions
diff --git a/instfiles/Makefile.am b/instfiles/Makefile.am
index 552e411d..ce1ff719 100644
--- a/instfiles/Makefile.am
+++ b/instfiles/Makefile.am
@@ -1,8 +1,28 @@
EXTRA_DIST = \
keymap-names.txt \
xrdp.sh \
- xrdp-sesman.service \
- xrdp.service
+ xrdp-sesman.service.in \
+ xrdp.service.in
+
+#
+# substitute directories in service file
+#
+CLEANFILES= \
+ xrdp-sesman.service \
+ xrdp.service
+
+SUBST_VARS = sed \
+ -e 's|@sbindir[@]|$(sbindir)|g' \
+ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
+ -e 's|@localstatedir[@]|$(localstatedir)|g'
+
+subst_verbose = $(subst_verbose_@AM_V@)
+subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@)
+subst_verbose_0 = @echo " SUBST $@";
+
+SUFFIXES = .in
+.in:
+ $(subst_verbose)$(SUBST_VARS) $< > $@
#
# files for all platforms
diff --git a/instfiles/xrdp-sesman.service b/instfiles/xrdp-sesman.service
deleted file mode 100644
index ff8d5b0c..00000000
--- a/instfiles/xrdp-sesman.service
+++ /dev/null
@@ -1,17 +0,0 @@
-[Unit]
-Description=xrdp session manager
-Documentation=man:xrdp-sesman(8) man:sesman.ini(5)
-After=network.target
-StopWhenUnneeded=true
-BindsTo=xrdp.service
-
-[Service]
-Type=forking
-PIDFile=/var/run/xrdp-sesman.pid
-EnvironmentFile=-/etc/sysconfig/xrdp
-EnvironmentFile=-/etc/default/xrdp
-ExecStart=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS
-ExecStop=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS --kill
-
-[Install]
-WantedBy=multi-user.target
diff --git a/instfiles/xrdp-sesman.service.in b/instfiles/xrdp-sesman.service.in
new file mode 100644
index 00000000..8f754d60
--- /dev/null
+++ b/instfiles/xrdp-sesman.service.in
@@ -0,0 +1,17 @@
+[Unit]
+Description=xrdp session manager
+Documentation=man:xrdp-sesman(8) man:sesman.ini(5)
+After=network.target
+StopWhenUnneeded=true
+BindsTo=xrdp.service
+
+[Service]
+Type=forking
+PIDFile=@localstatedir@/run/xrdp-sesman.pid
+EnvironmentFile=-@sysconfdir@/sysconfig/xrdp
+EnvironmentFile=-@sysconfdir@/default/xrdp
+ExecStart=@sbindir@/xrdp-sesman $SESMAN_OPTIONS
+ExecStop=@sbindir@/xrdp-sesman $SESMAN_OPTIONS --kill
+
+[Install]
+WantedBy=multi-user.target
diff --git a/instfiles/xrdp.service b/instfiles/xrdp.service
deleted file mode 100644
index ccf07c73..00000000
--- a/instfiles/xrdp.service
+++ /dev/null
@@ -1,16 +0,0 @@
-[Unit]
-Description=xrdp daemon
-Documentation=man:xrdp(8) man:xrdp.ini(5)
-Requires=xrdp-sesman.service
-After=network.target xrdp-sesman.service
-
-[Service]
-Type=forking
-PIDFile=/var/run/xrdp.pid
-EnvironmentFile=-/etc/sysconfig/xrdp
-EnvironmentFile=-/etc/default/xrdp
-ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS
-ExecStop=/usr/sbin/xrdp $XRDP_OPTIONS --kill
-
-[Install]
-WantedBy=multi-user.target
diff --git a/instfiles/xrdp.service.in b/instfiles/xrdp.service.in
new file mode 100644
index 00000000..576c1c25
--- /dev/null
+++ b/instfiles/xrdp.service.in
@@ -0,0 +1,16 @@
+[Unit]
+Description=xrdp daemon
+Documentation=man:xrdp(8) man:xrdp.ini(5)
+Requires=xrdp-sesman.service
+After=network.target xrdp-sesman.service
+
+[Service]
+Type=forking
+PIDFile=@localstatedir@/run/xrdp.pid
+EnvironmentFile=-@sysconfdir@/sysconfig/xrdp
+EnvironmentFile=-@sysconfdir@/default/xrdp
+ExecStart=@sbindir@/xrdp $XRDP_OPTIONS
+ExecStop=@sbindir@/xrdp $XRDP_OPTIONS --kill
+
+[Install]
+WantedBy=multi-user.target