diff --git a/actor/linux/.gitignore b/actor/linux/.gitignore new file mode 100644 index 000000000..380277148 --- /dev/null +++ b/actor/linux/.gitignore @@ -0,0 +1 @@ +/udsactor-*[1-9].*.spec diff --git a/actor/linux/Makefile b/actor/linux/Makefile new file mode 100644 index 000000000..92d898f88 --- /dev/null +++ b/actor/linux/Makefile @@ -0,0 +1,98 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Directories +SOURCEDIR := ../src +LIBDIR := $(DESTDIR)/usr/share/UDSActor +BINDIR := $(DESTDIR)/usr/bin +SBINDIR = $(DESTDIR)/usr/sbin +APPSDIR := $(DESTDIR)/usr/share/applications +CFGDIR := $(DESTDIR)/etc/udsactor +INITDIR := $(DESTDIR)/etc/init.d +POLKITDIR := $(DESTDIR)/usr/share/polkit-1/actions/ +XDGAUTOSTARTDIR := $(DESTDIR)/etc/xdg/autostart +KDEAUTOSTARTDIR := $(DESTDIR)/usr/share/autostart + +PYC := $(shell find $(SOURCEDIR) -name '*.py[co]') +CACHES := $(shell find $(SOURCEDIR) -name '__pycache__') + +clean: + rm -rf $(PYC) $(CACHES) $(DESTDIR) +install-udsactor-xrdp: + 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-nx: + mkdir -p $(BINDIR) + cp scripts/udsnxstart.sh $(BINDIR)/udsnxstart + cp scripts/udsnxstop.sh $(BINDIR)/udsnxstop + + chmod 0755 $(BINDIR)/udsnxstart + chmod 0755 $(BINDIR)/udsnxstop +install-udsactor: + rm -rf $(DESTDIR) + mkdir -p $(LIBDIR) + mkdir -p $(BINDIR) + mkdir -p $(SBINDIR) + mkdir -p $(APPSDIR) + mkdir -p $(CFGDIR) + mkdir -p $(POLKITDIR) + mkdir -p $(XDGAUTOSTARTDIR) + mkdir -p $(KDEAUTOSTARTDIR) + + mkdir $(LIBDIR)/img + + # Cleans up .pyc and cache folders + rm -f $(PYC) $(CACHES) + + cp -r $(SOURCEDIR)/udsactor $(LIBDIR)/udsactor + cp $(SOURCEDIR)/img/uds.png $(LIBDIR)/img + + cp $(SOURCEDIR)/UDSActorConfig.py $(LIBDIR) + cp $(SOURCEDIR)/UDSActorUser.py $(LIBDIR) + # QT Dialogs & resources + cp $(SOURCEDIR)/*_ui.py $(LIBDIR) + cp $(SOURCEDIR)/UDSActor_rc.py $(LIBDIR) + + # Menu GUI app + cp desktop/UDS_Actor_Configuration.desktop $(APPSDIR) + + # Autostart elements for gnome/kde + cp desktop/UDSActorTool.desktop $(XDGAUTOSTARTDIR) + cp desktop/UDSActorTool.desktop $(KDEAUTOSTARTDIR) + + # scripts + cp scripts/udsactor $(BINDIR) + cp scripts/UDSActorConfig $(SBINDIR) + cp scripts/UDSActorConfig-pkexec $(SBINDIR) + cp scripts/UDSActorTool $(BINDIR) + cp scripts/UDSActorTool-startup $(BINDIR) + cp scripts/udsvapp ${BINDIR} + + # Policy to run as administrator + cp policy/org.openuds.pkexec.UDSActorConfig.policy $(POLKITDIR) + + # Fix permissions + chmod 755 $(BINDIR)/udsactor + chmod 755 $(BINDIR)/udsvapp + chmod 755 $(BINDIR)/UDSActorTool-startup + chmod 755 $(SBINDIR)/UDSActorConfig-pkexec + chmod 755 $(LIBDIR)/UDSActorConfig.py + chmod 755 $(LIBDIR)/UDSActorUser.py + chmod 644 $(POLKITDIR)/org.openuds.pkexec.UDSActorConfig.policy + + # If for red hat based, copy init.d +ifeq ($(DISTRO),rh) + mkdir -p $(INITDIR) + cp debian/udsactor.init $(INITDIR)/udsactor +endif + + # chmod 0755 $(BINDIR)/udsactor +uninstall: + rm -rf $(LIBDIR) + # rm -f $(BINDIR)/udsactor + rm -rf $(CFGDIR) diff --git a/actor/linux/build-packages.sh b/actor/linux/build-packages.sh new file mode 100755 index 000000000..69e6eb476 --- /dev/null +++ b/actor/linux/build-packages.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +VERSION=`cat ../../VERSION` +RELEASE=1 + +top=`pwd` + +# Debian based +dpkg-buildpackage -b + +cat udsactor-template.spec | + sed -e s/"version 0.0.0"/"version ${VERSION}"/g | + sed -e s/"release 1"/"release ${RELEASE}"/g > udsactor-$VERSION.spec + +# Now fix dependencies for opensuse +cat udsactor-template.spec | + sed -e s/"version 0.0.0"/"version ${VERSION}"/g | + sed -e s/"name udsactor"/"name udsactor-opensuse"/g | + sed -e s/"PyQt4"/"python-qt4"/g | + sed -e s/"libXScrnSaver"/"libXss1"/g > udsactor-opensuse-$VERSION.spec + + +# Right now, udsactor-xrdp-1.7.0.spec is not needed +for pkg in udsactor-$VERSION.spec udsactor-opensuse-$VERSION.spec; do + + rm -rf rpm + for folder in SOURCES BUILD RPMS SPECS SRPMS; do + mkdir -p rpm/$folder + done + + rpmbuild -v -bb --clean --buildroot=$top/rpm/BUILD/$pkg-root --target noarch $pkg 2>&1 +done + +#rm udsactor-$VERSION diff --git a/actor/linux/debian/.gitignore b/actor/linux/debian/.gitignore new file mode 100644 index 000000000..330b4e3bf --- /dev/null +++ b/actor/linux/debian/.gitignore @@ -0,0 +1,3 @@ +/udsactor/ +/udsactor-xrdp/ +/udsactor-nx/ diff --git a/actor/linux/debian/changelog b/actor/linux/debian/changelog new file mode 100644 index 000000000..a44d8d0eb --- /dev/null +++ b/actor/linux/debian/changelog @@ -0,0 +1,53 @@ +udsactor (3.0.0) stable; urgency=medium + + * Upgraded to 3.0.0 release + + -- Adolfo Gómez García Wed, 10 Jul 2019 9:24:10 +0200 + +udsactor (2.2.1) stable; urgency=medium + + * Upgraded to 2.2.1 release + + -- Adolfo Gómez García Thu, 2 Oct 2018 12:44:12 +0200 + +udsactor (2.2.0) stable; urgency=medium + + * Upgraded to 2.2.0 release + + -- Adolfo Gómez García Thu, 19 Oct 2017 16:44:12 +0200 + +udsactor (2.1.0) stable; urgency=medium + + * Fixes for 2.1.0 release + + -- Adolfo Gómez García Tue, 19 Jan 2017 08:00:22 +0200 + +udsactor (2.0.0) stable; urgency=medium + + * Upgrade for 2.0.0 + + -- Adolfo Gómez García Tue, 01 Mar 2016 03:39:21 +0100 + +udsactor (1.9.1) stable; urgency=medium + + * Upgrade for 1.9.1 + + -- Adolfo Gómez García Tue, 01 Mar 2016 03:19:21 +0100 + +udsactor (1.9.0) stable; urgency=medium + + * Upgrade for 1.9.0 (fixed package version) + + -- Adolfo Gómez García Tue, 05 May 2015 07:10:27 +0200 + +udsactor (1.7.5) stable; urgency=medium + + * Upgrade for 1.7.5 + + -- Adolfo Gómez García Thu, 23 Apr 2015 06:08:53 +0200 + +udsactor (1.7.0) stable; urgency=medium + + * Initial release. + + -- Adolfo Gómez García Mon, 17 Nov 2014 05:32:41 +0100 diff --git a/actor/linux/debian/compat b/actor/linux/debian/compat new file mode 100644 index 000000000..f11c82a4c --- /dev/null +++ b/actor/linux/debian/compat @@ -0,0 +1 @@ +9 \ No newline at end of file diff --git a/actor/linux/debian/control b/actor/linux/debian/control new file mode 100644 index 000000000..a41de8394 --- /dev/null +++ b/actor/linux/debian/control @@ -0,0 +1,17 @@ +Source: udsactor +Section: admin +Priority: optional +Maintainer: Adolfo Gómez García +Build-Depends: debhelper (>= 7), po-debconf +Standards-Version: 3.9.2 +Homepage: http://www.virtualcable.es + +Package: udsactor +Section: admin +Priority: optional +Architecture: all +Depends: policykit-1(>=0.100), python3-requests (>=0.8.2), python3-pyqt4 (>=4.9), python3-six(>=1.1), python3 (>=3.4), libxss1, xscreensaver, ${misc:Depends} +Recommends: python3-prctl(>=1.1.1) +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. + diff --git a/actor/linux/debian/copyright b/actor/linux/debian/copyright new file mode 100644 index 000000000..cef2d43fe --- /dev/null +++ b/actor/linux/debian/copyright @@ -0,0 +1,26 @@ +Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 +Name: udsactor +Maintainer: Adolfo Gómez García +Source: http://www.udsenterprise.com/ + +Copyright: 2014 Virtual Cable S.L.U. +License: BSD-3-clause + +License: GPL-2+ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. +. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +. +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +. +On Debian systems, the full text of the GNU General Public +License version 2 can be found in the file +`/usr/share/common-licenses/GPL-2'. \ No newline at end of file diff --git a/actor/linux/debian/docs b/actor/linux/debian/docs new file mode 100644 index 000000000..b2b2a781e --- /dev/null +++ b/actor/linux/debian/docs @@ -0,0 +1 @@ +readme.txt diff --git a/actor/linux/debian/files b/actor/linux/debian/files new file mode 100644 index 000000000..e868c3755 --- /dev/null +++ b/actor/linux/debian/files @@ -0,0 +1,2 @@ +udsactor_3.0.0_all.deb admin optional +udsactor_3.0.0_amd64.buildinfo admin optional diff --git a/actor/linux/debian/rules b/actor/linux/debian/rules new file mode 100755 index 000000000..fe2c7b60d --- /dev/null +++ b/actor/linux/debian/rules @@ -0,0 +1,46 @@ +#!/usr/bin/make -f +# -*- makefile -*- +configure: configure-stamp +configure-stamp: + dh_testdir + touch configure-stamp +build: build-arch build-indep +build-arch: build-stamp +build-indep: build-stamp +build-stamp: configure-stamp + dh_testdir + $(MAKE) + touch $@ +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + dh_clean +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + $(MAKE) DESTDIR=$(CURDIR)/debian/udsactor install-udsactor + $(MAKE) DESTDIR=$(CURDIR)/debian/udsactor-xrdp install-udsactor-xrdp + $(MAKE) DESTDIR=$(CURDIR)/debian/udsactor-nx install-udsactor-nx +binary-arch: build install + # emptyness +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installdebconf + dh_installinit --no-start + dh_python2=python + dh_compress + dh_link + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb +binary: binary-indep +.PHONY: build clean binary-indep binary install configure diff --git a/actor/linux/debian/source/format b/actor/linux/debian/source/format new file mode 100644 index 000000000..9f6742789 --- /dev/null +++ b/actor/linux/debian/source/format @@ -0,0 +1 @@ +3.0 (native) \ No newline at end of file diff --git a/actor/linux/debian/udsactor-nx.postinst b/actor/linux/debian/udsactor-nx.postinst new file mode 100644 index 000000000..9d629ce6c --- /dev/null +++ b/actor/linux/debian/udsactor-nx.postinst @@ -0,0 +1,37 @@ +#!/bin/sh + +NXNODECFG=/usr/NX/etc/node.cfg + +. /usr/share/debconf/confmodule + +set -e + +case "$1" in + configure) + TMPFILE=$(mktemp /tmp/node.cfg.XXXXX) + trap "rm -f $TMPFILE" 0 + cat $NXNODECFG | sed -e "s/.*udsnxst.*//; s/\(UserScriptAfterSessionStart *=.*\)/#\1/;s/\(UserScriptAfterSessionClose *=.*\)/#\1/" > $TMPFILE + echo >> $TMPFILE + echo "# Added by udsactor-nx (udsnxstart and udsnxstop)" >> $TMPFILE + echo UserScriptAfterSessionStart = \"/usr/bin/udsnxstart\" >> $TMPFILE + echo UserScriptAfterSessionClose = \"/usr/bin/udsnxstop\" >> $TMPFILE + cp $TMPFILE $NXNODECFG + invoke-rc.d nxserver restart + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +# Don't know why, but descriptors get "weird" when launched daemon, so we tell here to debconf to stop. +# Solved not starting the service right now, defered to next reboot + + +exit 0 \ No newline at end of file diff --git a/actor/linux/debian/udsactor-nx.postrm b/actor/linux/debian/udsactor-nx.postrm new file mode 100644 index 000000000..990308562 --- /dev/null +++ b/actor/linux/debian/udsactor-nx.postrm @@ -0,0 +1,30 @@ +#!/bin/sh + +NXNODECFG=/usr/NX/etc/node.cfg + +. /usr/share/debconf/confmodule + +set -e + +case "$1" in + purge) + ;; + remove) + if [ -f $NXNODECFG ]; then + TMPFILE=$(mktemp /tmp/node.cfg.XXXXX) + trap "rm -f $TMPFILE" 0 + cat $NXNODECFG | sed -e "s/.*udsnxst.*//" > $TMPFILE + cp $TMPFILE $NXNODECFG + invoke-rc.d nxserver restart + fi + ;; + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# diff --git a/actor/linux/debian/udsactor-xrdp.postinst b/actor/linux/debian/udsactor-xrdp.postinst new file mode 100644 index 000000000..3c92016e1 --- /dev/null +++ b/actor/linux/debian/udsactor-xrdp.postinst @@ -0,0 +1,39 @@ +#!/bin/sh + +SESMANFILE=/etc/pam.d/xrdp-sesman + +. /usr/share/debconf/confmodule + +set -e + +case "$1" in + configure) + trap "cp $SESMANFILE $SESMANFILE.uds.old" 0 + + TMPFILE=$(mktemp /tmp/sesman.XXXXX) + trap "rm -f $TMPFILE" 0 + grep -v uds $SESMANFILE > $TMPFILE # Removes all UDS lines from sesman if they exists + + echo >> $TMPFILE + echo "# Added by udsactor-xrdp" >> $TMPFILE + echo "session optional pam_exec.so /usr/bin/uds-sesman" >> $TMPFILE + cp $TMPFILE $SESMANFILE + trap "rm -f $TMPFILE" 0 + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +# Don't know why, but descriptors get "weird" when launched daemon, so we tell here to debconf to stop. +# Solved not starting the service right now, defered to next reboot + + +exit 0 diff --git a/actor/linux/debian/udsactor-xrdp.postrm b/actor/linux/debian/udsactor-xrdp.postrm new file mode 100644 index 000000000..7c0e40ec8 --- /dev/null +++ b/actor/linux/debian/udsactor-xrdp.postrm @@ -0,0 +1,30 @@ +#!/bin/sh -e + +SESMANFILE=/etc/pam.d/xrdp-sesman + +. /usr/share/debconf/confmodule + +set -e + +case "$1" in + purge) + ;; + remove) + if [ -f $SESMANFILE ]; then + TMPFILE=$(mktemp /tmp/sesman.XXXXX) + trap "rm -f $TMPFILE" 0 + grep -v uds $SESMANFILE > $TMPFILE # Removes all UDS lines from sesman if they exists + cp $TMPFILE $SESMANFILE + trap "rm -f $TMPFILE" 0 + fi + ;; + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# diff --git a/actor/linux/debian/udsactor.config b/actor/linux/debian/udsactor.config new file mode 100755 index 000000000..afc2dcc68 --- /dev/null +++ b/actor/linux/debian/udsactor.config @@ -0,0 +1,45 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule +db_version 2.0 + +# This conf script is capable of backing up +db_capb backup + +if [ -f /etc/udsactor/udsactor.cfg ] && [ "$1" != "reconfigure" ]; then + echo "/etc/udsactor/udsactor.cfg already exists, leaving untouched." + exit 0 +fi + +STATE=1 +while [ "$STATE" != 0 -a "$STATE" != 4 ]; do + case "$STATE" in + 1) + db_input high udsactor/host || true + ;; + 2) + db_input high udsactor/secure || true + ;; + 3) + db_input high udsactor/masterKey || true + ;; + esac + + if db_go; then + STATE=$(($STATE + 1)) + else + STATE=$(($STATE - 1)) + fi + +done + +# If "cancelled", exit +if [ "$STATE" = 0 ]; then + exit 0 +fi + +# If using reconfigure, and already exists an configuration file, move it to a backup +if [ -f /etc/udsactor/udsactor.cfg ] && [ "$1" = "reconfigure" ]; then + echo "/etc/udsactor.cfg backup to /etc/udsactor.cfg.back" + mv /etc/udsactor/udsactor.cfg /etc/udsactor/udsactor.cfg.back +fi \ No newline at end of file diff --git a/actor/linux/debian/udsactor.init b/actor/linux/debian/udsactor.init new file mode 100755 index 000000000..27576717d --- /dev/null +++ b/actor/linux/debian/udsactor.init @@ -0,0 +1,23 @@ +#!/bin/sh -e +### BEGIN INIT INFO +# Provides: udsactor +# Required-Start: $local_fs $remote_fs $network $syslog $named +# Required-Stop: $local_fs $remote_fs $network $syslog $named +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: UDS Actor +### END INIT INFO +# + +# . /lib/lsb/init-functions + +case "$1" in + start|stop|restart) + /usr/bin/udsactor $1 + ;; + force-reload) + /usr/bin/udsactor restart + ;; + *) echo "Usage: $0 {start|stop|restart|force-reload}" >&2; exit 1 ;; +esac + diff --git a/actor/linux/debian/udsactor.links b/actor/linux/debian/udsactor.links new file mode 100644 index 000000000..6dd3d539b --- /dev/null +++ b/actor/linux/debian/udsactor.links @@ -0,0 +1,2 @@ +/usr/share/UDSActor/UDSActorConfig.py /usr/sbin/UDSActorConfig +/usr/share/UDSActor/UDSActorUser.py /usr/bin/UDSActorTool \ No newline at end of file diff --git a/actor/linux/debian/udsactor.postinst b/actor/linux/debian/udsactor.postinst new file mode 100755 index 000000000..c7052a14d --- /dev/null +++ b/actor/linux/debian/udsactor.postinst @@ -0,0 +1,54 @@ +#!/bin/sh + +. /usr/share/debconf/confmodule + +set -e +case "$1" in + configure) + /usr/bin/python3 -m compileall /usr/share/UDSActor > /dev/nul 2>&1 + # If new "fresh" install or if configuration file has disappeared... + if [ "$2" = "" ] || [ ! -f /etc/udsactor/udsactor.cfg ]; then + db_get udsactor/host + host=$RET + db_get udsactor/secure + ssl=$RET + if [ "$ssl" = "true" ]; then + ssl=True; + else + ssl=False; + fi + db_get udsactor/masterKey + masterKey=$RET + + # If already has a config file there + if [ -f /etc/udsactor/udsactor.cfg ]; then + cp /etc/udsactor/udsactor.cfg /etc/udsactor/udsactor.cfg.dpkg-old + fi + + echo "[uds]" > /etc/udsactor/udsactor.cfg + echo "host = $host" >> /etc/udsactor/udsactor.cfg + echo "logLevel = 30000" >> /etc/udsactor/udsactor.cfg + echo "ssl = $ssl" >> /etc/udsactor/udsactor.cfg + echo "masterKey = $masterKey" >> /etc/udsactor/udsactor.cfg + + fi + + # Fix perms so only root can access "masterKey" + chmod 0700 /etc/udsactor + chmod 0600 /etc/udsactor/udsactor.cfg + chown root:root /etc/udsactor + chown root:root /etc/udsactor/udsactor.cfg + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/actor/linux/debian/udsactor.postrm b/actor/linux/debian/udsactor.postrm new file mode 100755 index 000000000..f888f5df3 --- /dev/null +++ b/actor/linux/debian/udsactor.postrm @@ -0,0 +1,14 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +set -e + +if [ "$1" = "purge" ] ; then + if [ -f /etc/udsactor/udsactor.cfg ]; then + mv /etc/udsactor/udsactor.cfg /etc/udsactor/udsactor.cfg.dpkg-backup + # Remove .pyc leaved behind + rm -rf /usr/share/UDSActor || true > /dev/null 2>&1 + fi +fi + diff --git a/actor/linux/debian/udsactor.prerm b/actor/linux/debian/udsactor.prerm new file mode 100755 index 000000000..4c1e6f4c1 --- /dev/null +++ b/actor/linux/debian/udsactor.prerm @@ -0,0 +1 @@ +#! /bin/bash -e diff --git a/actor/linux/debian/udsactor.templates b/actor/linux/debian/udsactor.templates new file mode 100644 index 000000000..4310a4b2c --- /dev/null +++ b/actor/linux/debian/udsactor.templates @@ -0,0 +1,20 @@ +Template: udsactor/host +Type: string +Default: +Description: UDS Server address: + The actor needs the address of the server in order to communicate with it. + Provide here full address (or i) of the UDS server + +Template: udsactor/secure +Type: boolean +Default: true +Description: Use secure (https) connection to communicate with UDS server? + If selected, the communication will be done using https. + If not selected, the communication will be done using http + +Template: udsactor/masterKey +Type: string +Default: +Description: Master Key: + This key is available on UDS Administration interface. + Look for it under configuration, on Security tab. diff --git a/actor/linux/desktop/UDSActorTool.desktop b/actor/linux/desktop/UDSActorTool.desktop new file mode 100644 index 000000000..6685c85c0 --- /dev/null +++ b/actor/linux/desktop/UDSActorTool.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Name=UDS Actor Tool +Comment=UDS Actor Userspace tools +Exec=/usr/bin/UDSActorTool-startup +Icon=/usr/share/UDSActor/img/uds-icon.png +Terminal=false +Type=Application +NoDisplay=true +X-KDE-autostart-after=panel +X-KDE-StartupNotify=false +X-DBUS-StartupType=None +X-KDE-UniqueApplet=false diff --git a/actor/linux/desktop/UDS_Actor_Configuration.desktop b/actor/linux/desktop/UDS_Actor_Configuration.desktop new file mode 100644 index 000000000..1d390576a --- /dev/null +++ b/actor/linux/desktop/UDS_Actor_Configuration.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=UDS Actor Configuration +Version=1.0 +Exec=/usr/sbin/UDSActorConfig-pkexec +Comment=UDS Actor Configuration Application. (Must be executed as root) +Icon=/usr/share/UDSActor/img/uds-icon.png +Type=Application +Terminal=false +StartupNotify=true +Encoding=UTF-8 +Categories=Settings;System; \ No newline at end of file diff --git a/actor/linux/policy/org.openuds.pkexec.UDSActorConfig.policy b/actor/linux/policy/org.openuds.pkexec.UDSActorConfig.policy new file mode 100644 index 000000000..9afd775a4 --- /dev/null +++ b/actor/linux/policy/org.openuds.pkexec.UDSActorConfig.policy @@ -0,0 +1,20 @@ + + + + + + + Run UDS Actor Configuration Program + Authentication is required to run UDS Actor Configuration + + no + no + auth_admin_keep + + /usr/sbin/UDSActorConfig + TRUE + + + \ No newline at end of file diff --git a/actor/linux/readme.txt b/actor/linux/readme.txt new file mode 100644 index 000000000..f8afac007 --- /dev/null +++ b/actor/linux/readme.txt @@ -0,0 +1,3 @@ +UDSActor is the client actor needed to get machines managed by UDS Broker. + +Please, visit http://www.udsenterprise.com for more information diff --git a/actor/linux/scripts/UDSActorConfig b/actor/linux/scripts/UDSActorConfig new file mode 100755 index 000000000..ce3392002 --- /dev/null +++ b/actor/linux/scripts/UDSActorConfig @@ -0,0 +1,6 @@ +#!/bin/sh + +FOLDER=/usr/share/UDSActor + +cd $FOLDER +exec python3 actor_config.py $@ diff --git a/actor/linux/scripts/UDSActorConfig-pkexec b/actor/linux/scripts/UDSActorConfig-pkexec new file mode 100644 index 000000000..4c26e14e4 --- /dev/null +++ b/actor/linux/scripts/UDSActorConfig-pkexec @@ -0,0 +1,3 @@ +#!/bin/sh +# pkexec env DISPLAY=$DISPLAY QT_X11_NO_MITSHM=1 "/usr/sbin/UDSActorConfig" "$@" +pkexec "/usr/sbin/UDSActorConfig" "$@" diff --git a/actor/linux/scripts/UDSActorTool b/actor/linux/scripts/UDSActorTool new file mode 100755 index 000000000..b8707563a --- /dev/null +++ b/actor/linux/scripts/UDSActorTool @@ -0,0 +1,6 @@ +#!/bin/sh + +FOLDER=/usr/share/UDSActor + +cd $FOLDER +exec python3 actor_tool.py $@ diff --git a/actor/linux/scripts/UDSActorTool-startup b/actor/linux/scripts/UDSActorTool-startup new file mode 100644 index 000000000..768e31e5a --- /dev/null +++ b/actor/linux/scripts/UDSActorTool-startup @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /usr/bin/UDSActorTool diff --git a/actor/linux/scripts/uds-sesman.sh b/actor/linux/scripts/uds-sesman.sh new file mode 100755 index 000000000..bb8de2e76 --- /dev/null +++ b/actor/linux/scripts/uds-sesman.sh @@ -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 diff --git a/actor/linux/scripts/uds-wait-session.sh b/actor/linux/scripts/uds-wait-session.sh new file mode 100755 index 000000000..93839e173 --- /dev/null +++ b/actor/linux/scripts/uds-wait-session.sh @@ -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 diff --git a/actor/linux/scripts/udsactor b/actor/linux/scripts/udsactor new file mode 100755 index 000000000..cbaedc711 --- /dev/null +++ b/actor/linux/scripts/udsactor @@ -0,0 +1,6 @@ +#!/bin/sh + +FOLDER=/usr/share/UDSActor + +cd $FOLDER +exec python3 actor_service.py $@ diff --git a/actor/linux/scripts/udsnxstart.sh b/actor/linux/scripts/udsnxstart.sh new file mode 100644 index 000000000..1462019f8 --- /dev/null +++ b/actor/linux/scripts/udsnxstart.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /usr/bin/udsactor login $2 & diff --git a/actor/linux/scripts/udsnxstop.sh b/actor/linux/scripts/udsnxstop.sh new file mode 100644 index 000000000..1e2a2aa46 --- /dev/null +++ b/actor/linux/scripts/udsnxstop.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /usr/bin/udsactor logout $2 & diff --git a/actor/linux/scripts/udsvapp b/actor/linux/scripts/udsvapp new file mode 100755 index 000000000..12a69d75d --- /dev/null +++ b/actor/linux/scripts/udsvapp @@ -0,0 +1,5 @@ +#!/bin/sh + +/usr/bin/udsactor login "$USER" +$@ +/usr/bin/udsactor logout "$USER" diff --git a/actor/linux/udsactor-template.spec b/actor/linux/udsactor-template.spec new file mode 100644 index 000000000..49611ba56 --- /dev/null +++ b/actor/linux/udsactor-template.spec @@ -0,0 +1,70 @@ +%define _topdir %(echo $PWD)/rpm +%define name udsactor +%define version 0.0.0 +%define release 1 +%define buildroot %{_topdir}/%{name}-%{version}-%{release}-root + +BuildRoot: %{buildroot} +Name: %{name} +Version: %{version} +Release: %{release} +Summary: Actor for Universal Desktop Services (UDS) Broker +License: BSD3 +Group: Admin +Requires: python-six python-requests PyQt4 libXScrnSaver +Vendor: Virtual Cable S.L.U. +URL: http://www.udsenterprise.com +Provides: udsactor + +%define _rpmdir ../ +%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm + + +%install +curdir=`pwd` +cd ../.. +make DESTDIR=$RPM_BUILD_ROOT DISTRO=rh install-udsactor +cd $curdir + +%clean +rm -rf $RPM_BUILD_ROOT +curdir=`pwd` +cd ../.. +make DESTDIR=$RPM_BUILD_ROOT DISTRO=rh clean +cd $curdir + + +%post +systemctl enable udsactor.service > /dev/null 2>&1 + +%preun +systemctl disable udsactor.service > /dev/null 2>&1 +systemctl stop udsactor.service > /dev/null 2>&1 + +%postun +# $1 == 0 on uninstall, == 1 on upgrade for preun and postun (just a reminder for me... :) ) +if [ $1 -eq 0 ]; then + rm -rf /etc/udsactor + rm /var/log/udsactor.log +fi +# And, posibly, the .pyc leaved behind on /usr/share/UDSActor +rm -rf /usr/share/UDSActor > /dev/null 2>&1 + +%description +This package provides the required components to allow this machine to work on an environment managed by UDS Broker. + +%files +%defattr(-,root,root) +/etc/udsactor +/etc/xdg/autostart/UDSActorTool.desktop +/etc/init.d/udsactor +/usr/bin/UDSActorTool-startup +/usr/bin/udsactor +/usr/bin/udsvapp +/usr/bin/UDSActorTool +/usr/sbin/UDSActorConfig +/usr/sbin/UDSActorConfig-pkexec +/usr/share/UDSActor/* +/usr/share/applications/UDS_Actor_Configuration.desktop +/usr/share/autostart/UDSActorTool.desktop +/usr/share/polkit-1/actions/org.openuds.pkexec.UDSActorConfig.policy