Creating multiple files for actor

This commit is contained in:
Adolfo Gómez García 2014-11-23 08:33:19 +01:00
parent 0c8a1447bf
commit 7afa2b8042
14 changed files with 45 additions and 3 deletions

View File

@ -18,7 +18,15 @@ CACHES := $(shell find $(SOURCEDIR) -name '__pycache__')
clean:
rm -rf $(PYC) $(CACHES) $(DESTDIR)
install:
install-xrdp-udsactor:
mkdir -p $(BINDIR)
cp scripts/uds-sesman.sh $(BINDIR)/uds-sesman
cp scripts/uds-wait-session.sh $(BINDIR)/uds-wait-session
chmod 0755 $(BINDIR)/uds-sesman
chmod 0755 $(BINDIR)/uds-wait-session
install-udsactor:
rm -rf $(DESTDIR)
mkdir -p $(LIBDIR)
mkdir -p $(BINDIR)

View File

@ -1 +1,2 @@
/udsactor/
/udsactor-xrdp/

View File

@ -13,5 +13,11 @@ Architecture: all
Depends: policykit-1(>=0.100), python-requests (>=0.8.2), python-qt4 (>=4.9), python-six(>=1.1), python-prctl(>=1.1.1), python (>=2.7), ${misc:Depends}
Description: Actor for Universal Desktop Services (UDS) Broker
This package provides the required components to allow this machine to work on an environment managed by UDS Broker.
.
Package: udsactor-xrdp
Section: x11
Priority: optional
Architecture: all
Depends: xrdp (>= 0.6.0), udsactor (>= ${Source-Version}), libpam-modules-bin (>=1.0), ${misc:Depends}
Description: UDS Actor component for xrdp
This package provides connection between uds actor and xrdp, so session can be managed

View File

@ -1 +1,2 @@
udsactor_1.7.0_all.deb admin optional
udsactor-xrdp_1.7.0_all.deb x11 optional

View File

@ -21,7 +21,8 @@ install: build
dh_testroot
dh_prep
dh_installdirs
$(MAKE) DESTDIR=$(CURDIR)/debian/udsactor install
$(MAKE) DESTDIR=$(CURDIR)/debian/udsactor install-udsactor
$(MAKE) DESTDIR=$(CURDIR)/debian/udsactor-xrdp install-xrdp-udsactor
binary-arch: build install
# emptyness
binary-indep: build install

View File

@ -0,0 +1,13 @@
#!/bin/sh
env > /tmp/env.txt
if [ "$PAM_TYPE" = "open_session" ]; then
nohup /usr/bin/udsactor login $PAM_USER &
# Wait in backgroud to TTY to close (close_session is not being invoked right now)
nohup /usr/bin/uds-wait-session &
elif [ "$PAM_TYPE" = "close_session" ]; then
nohup /usr/bin/udsactor logout $PAM_USER &
fi
return 0

View File

@ -0,0 +1,12 @@
#!/bin/sh
while :
do
sleep 5 # Wait 5 seconds between checks
found=`ps -f -u$PAM_USER | grep -v grep | grep -v uds-wait-session | grep "$PAM_TTY" | wc -l`
if [ "$found" = "0" ]; then
/usr/bin/udsactor logout $PAM_USER
exit 0
fi
done