diff options
author | Raúl Porcel <armin76@gentoo.org> | 2007-04-12 17:43:35 +0000 |
---|---|---|
committer | Raúl Porcel <armin76@gentoo.org> | 2007-04-12 17:43:35 +0000 |
commit | 646f42fa379fce1d1ffab46944fb80d02c0457e5 (patch) | |
tree | 651ef57655003bcbc1832c74126fcf37d79626ac /net-misc | |
parent | ia64 + x86 stable wrt bug 174216 (diff) | |
download | gentoo-2-646f42fa379fce1d1ffab46944fb80d02c0457e5.tar.gz gentoo-2-646f42fa379fce1d1ffab46944fb80d02c0457e5.tar.bz2 gentoo-2-646f42fa379fce1d1ffab46944fb80d02c0457e5.zip |
Add init scripts, bug 39023
(Portage version: 2.1.2.3)
Diffstat (limited to 'net-misc')
-rw-r--r-- | net-misc/vnc/ChangeLog | 6 | ||||
-rw-r--r-- | net-misc/vnc/files/vnc.confd | 9 | ||||
-rw-r--r-- | net-misc/vnc/files/vnc.initd | 57 | ||||
-rw-r--r-- | net-misc/vnc/vnc-4.1.2-r1.ebuild | 7 | ||||
-rw-r--r-- | net-misc/vnc/vnc-4.1.2.ebuild | 7 |
5 files changed, 81 insertions, 5 deletions
diff --git a/net-misc/vnc/ChangeLog b/net-misc/vnc/ChangeLog index 0f9ad84bf153..755feed6111f 100644 --- a/net-misc/vnc/ChangeLog +++ b/net-misc/vnc/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-misc/vnc # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/vnc/ChangeLog,v 1.70 2007/02/26 12:24:15 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/vnc/ChangeLog,v 1.71 2007/04/12 17:43:35 armin76 Exp $ + + 12 Apr 2007; Raúl Porcel <armin76@gentoo.org> +files/vnc.confd, + +files/vnc.initd, vnc-4.1.2.ebuild, vnc-4.1.2-r1.ebuild: + Add init scripts, bug 39023 26 Feb 2007; Raúl Porcel <armin76@gentoo.org> +files/vncviewer.png, vnc-4.1.2.ebuild, vnc-4.1.2-r1.ebuild: diff --git a/net-misc/vnc/files/vnc.confd b/net-misc/vnc/files/vnc.confd new file mode 100644 index 000000000000..757f4b989f80 --- /dev/null +++ b/net-misc/vnc/files/vnc.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/vnc/files/vnc.initd b/net-misc/vnc/files/vnc.initd new file mode 100644 index 000000000000..000164e202e3 --- /dev/null +++ b/net-misc/vnc/files/vnc.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/vnc/files/vnc.initd,v 1.1 2007/04/12 17:43:35 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 VNC 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 VNC server" + for user in $DISPLAYS; do + su ${user%%:*} -c "vncserver -kill :${user##*:}" &>/dev/null + done + eend $? +} + +restart() { + svc_stop + svc_start +} diff --git a/net-misc/vnc/vnc-4.1.2-r1.ebuild b/net-misc/vnc/vnc-4.1.2-r1.ebuild index 5e0adabf2964..55af3e312c19 100644 --- a/net-misc/vnc/vnc-4.1.2-r1.ebuild +++ b/net-misc/vnc/vnc-4.1.2-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/vnc/vnc-4.1.2-r1.ebuild,v 1.4 2007/02/26 12:24:15 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/vnc/vnc-4.1.2-r1.ebuild,v 1.5 2007/04/12 17:43:35 armin76 Exp $ WANT_AUTOCONF="latest" WANT_AUTOMAKE="latest" @@ -146,7 +146,10 @@ src_install() { doicon ${FILESDIR}/vncviewer.png make_desktop_entry vncviewer vncviewer vncviewer.png Network - if ! use server ; then + if use server ; then + newconfd "${FILESDIR}"/vnc.confd vnc + newinitd "${FILESDIR}"/vnc.initd vnc + else cd "${D}" rm usr/bin/vncserver rm usr/bin/x0vncserver diff --git a/net-misc/vnc/vnc-4.1.2.ebuild b/net-misc/vnc/vnc-4.1.2.ebuild index df59a7a793dd..41e74d82557c 100644 --- a/net-misc/vnc/vnc-4.1.2.ebuild +++ b/net-misc/vnc/vnc-4.1.2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/vnc/vnc-4.1.2.ebuild,v 1.24 2007/02/26 12:24:15 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/vnc/vnc-4.1.2.ebuild,v 1.25 2007/04/12 17:43:35 armin76 Exp $ WANT_AUTOCONF="latest" WANT_AUTOMAKE="latest" @@ -146,7 +146,10 @@ src_install() { dodoc README - if ! use server ; then + if use server ; then + newconfd "${FILESDIR}"/vnc.confd vnc + newinitd "${FILESDIR}"/vnc.initd vnc + else cd "${D}" rm usr/bin/vncserver rm usr/bin/x0vncserver |