diff options
author | Raúl Porcel <armin76@gentoo.org> | 2007-04-12 21:00:48 +0000 |
---|---|---|
committer | Raúl Porcel <armin76@gentoo.org> | 2007-04-12 21:00:48 +0000 |
commit | d715cba9418094bee420aa9a4d0f2ef13af1a590 (patch) | |
tree | a83812f3e389df022ba9ae7f29d17506d15afb06 /net-misc/tightvnc/files | |
parent | Stable for HPPA (bug #174216). (diff) | |
download | gentoo-2-d715cba9418094bee420aa9a4d0f2ef13af1a590.tar.gz gentoo-2-d715cba9418094bee420aa9a4d0f2ef13af1a590.tar.bz2 gentoo-2-d715cba9418094bee420aa9a4d0f2ef13af1a590.zip |
Add init scripts, bug 39023 and remove vulnerable version
(Portage version: 2.1.2.3)
Diffstat (limited to 'net-misc/tightvnc/files')
-rw-r--r-- | net-misc/tightvnc/files/digest-tightvnc-1.3.8 | 3 | ||||
-rw-r--r-- | net-misc/tightvnc/files/tightvnc.confd | 9 | ||||
-rw-r--r-- | net-misc/tightvnc/files/tightvnc.initd | 57 |
3 files changed, 66 insertions, 3 deletions
diff --git a/net-misc/tightvnc/files/digest-tightvnc-1.3.8 b/net-misc/tightvnc/files/digest-tightvnc-1.3.8 deleted file mode 100644 index bc139c537f55..000000000000 --- a/net-misc/tightvnc/files/digest-tightvnc-1.3.8 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 9b9b0465834289d1b7899982c0096440 tightvnc-1.3.8_unixsrc.tar.bz2 1766473 -RMD160 98013a7074c488d1cfc85ea2d7a9665a05ee2431 tightvnc-1.3.8_unixsrc.tar.bz2 1766473 -SHA256 cd76e1c5c6843fec2a7a5c493158cdb3642eb1ef4caecee7a89bfd2078881178 tightvnc-1.3.8_unixsrc.tar.bz2 1766473 diff --git a/net-misc/tightvnc/files/tightvnc.confd b/net-misc/tightvnc/files/tightvnc.confd new file mode 100644 index 000000000000..757f4b989f80 --- /dev/null +++ b/net-misc/tightvnc/files/tightvnc.confd @@ -0,0 +1,9 @@ +# Config file for /etc/init.d/vnc + +# Specify the user(s) Xvnc(1) should be run for. The syntax is: "username:display". +# example: "DISPLAYS="foo:1 bar:2" You can specify more users separated by space. +# DISPLAYS="myuser:1" + +# Specify any of vncserver(1) and Xvnc(1) options. See the respective man pages for more information. +# VNC_OPTS="" + diff --git a/net-misc/tightvnc/files/tightvnc.initd b/net-misc/tightvnc/files/tightvnc.initd new file mode 100644 index 000000000000..29adfa8e3633 --- /dev/null +++ b/net-misc/tightvnc/files/tightvnc.initd @@ -0,0 +1,57 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/net-misc/tightvnc/files/tightvnc.initd,v 1.1 2007/04/12 21:00:48 armin76 Exp $ + +depend() { + need net +} + +checkconfig() { + if [ -n "${DISPLAYS}" ]; then + if [ $1 = "start" ]; then + local user + for user in $DISPLAYS; do + if eval [ ! -f "~${user%%:*}/.vnc/passwd" ]; then + eerror "There are no passwords defined for user ${user%%:*}." + return 1 + elif [ -e "/tmp/.X11-unix/X${user##*:}" ]; then + eerror "Display :${user##*:} appears to be already in use because of /tmp/.X11-unix/X${user##*:}" + eerror "Remove this file if there is no X server $HOSTNAME:${user##*:}" + return 1 + elif [ -e "/tmp/.X${user##*:}-lock" ]; then + eerror "Display :${user##*:} appears to be already in use because of /tmp/.X${user##*:}-lock" + eerror "Remove this file if there is no X server $HOSTNAME:${user##*:}" + return 1 + fi + done + fi + return 0 + else + eerror 'Please define $DISPLAYS in /etc/conf.d/vnc' + return 1 + fi +} + +start() { + checkconfig start || return 1 + ebegin "Starting TightVNC server" + for user in $DISPLAYS; do + su ${user%%:*} -c "cd /home/${user%%:*} && vncserver :${user##*:} $VNC_OPTS" &>/dev/null + done + eend $? +} + +stop() { + checkconfig stop || return 2 + ebegin "Stopping TightVNC server" + for user in $DISPLAYS; do + su ${user%%:*} -c "vncserver -kill :${user##*:}" &>/dev/null + done + eend $? +} + +restart() { + svc_stop + svc_start +} |