From 088e353e8399d23b07c022bf2ca273244368eb6d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ra=C3=BAl=20Porcel?= Date: Thu, 12 Apr 2007 17:43:35 +0000 Subject: [PATCH] Add init scripts, bug 39023 Package-Manager: portage-2.1.2.3 --- net-misc/vnc/ChangeLog | 6 +++- net-misc/vnc/Manifest | 32 +++++++++++------- net-misc/vnc/files/vnc.confd | 9 +++++ net-misc/vnc/files/vnc.initd | 57 ++++++++++++++++++++++++++++++++ net-misc/vnc/vnc-4.1.2-r1.ebuild | 7 ++-- net-misc/vnc/vnc-4.1.2.ebuild | 7 ++-- 6 files changed, 101 insertions(+), 17 deletions(-) create mode 100644 net-misc/vnc/files/vnc.confd create mode 100644 net-misc/vnc/files/vnc.initd 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 +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 +files/vncviewer.png, vnc-4.1.2.ebuild, vnc-4.1.2-r1.ebuild: diff --git a/net-misc/vnc/Manifest b/net-misc/vnc/Manifest index 4d33bc8a2752..521ca634ad3f 100644 --- a/net-misc/vnc/Manifest +++ b/net-misc/vnc/Manifest @@ -1,3 +1,11 @@ +AUX vnc.confd 341 RMD160 3ec4bdfd3fd2c5938c3969305f04020342e9263d SHA1 4b7f5f708cb92f5fc82508141422003ab05c1452 SHA256 3463105ab7f4aec95b9a72bcfcb9808b3acdcad0c1e5b608f1408faa79f3d4a0 +MD5 7319b537e42c0e12033ac679063161cc files/vnc.confd 341 +RMD160 3ec4bdfd3fd2c5938c3969305f04020342e9263d files/vnc.confd 341 +SHA256 3463105ab7f4aec95b9a72bcfcb9808b3acdcad0c1e5b608f1408faa79f3d4a0 files/vnc.confd 341 +AUX vnc.initd 1544 RMD160 85c606efc331e65694a6696e4883e352dea8b265 SHA1 4418b3e8a46a2ef16879acb8d0ca0e73be9bc9ae SHA256 1c0aa4b06e32b4191003a22e171204f994619b295d65cd8de74ad1703e51faf1 +MD5 e8994c8d047e5c74392630b715defc63 files/vnc.initd 1544 +RMD160 85c606efc331e65694a6696e4883e352dea8b265 files/vnc.initd 1544 +SHA256 1c0aa4b06e32b4191003a22e171204f994619b295d65cd8de74ad1703e51faf1 files/vnc.initd 1544 AUX vncviewer.png 1048 RMD160 ad99643d65a77044cac96a31dc46b16f8273b4c7 SHA1 e463d04d7fbbece2495ad424feec1fe009e20a16 SHA256 0780cf53e78b43849bdb9f31ad0103bb4dd98489ed59c76e5c50cf0a6ff3db41 MD5 bae47b0403060b8655956d4cfdfb7c3c files/vncviewer.png 1048 RMD160 ad99643d65a77044cac96a31dc46b16f8273b4c7 files/vncviewer.png 1048 @@ -6,18 +14,18 @@ DIST vnc-4.1.2-patches-2.tar.bz2 13150 RMD160 dc4c2962d965b54e1c3389f11c3c462e82 DIST vnc-4.1.2-r1-patches-0.1.tar.bz2 17314 RMD160 816b109e90dd4b9e20107017c2c69104cbc0fb3d SHA1 0c9acffb4ccd2bbc281927352fec86deea499f1b SHA256 3b16d82ba6f4768561d6fe23cc1a72eee9e83ab02d39cd3ff4750c68fee60cfb DIST vnc-4_1_2-unixsrc.tar.gz 537713 RMD160 2a2d615825e6ac74aca5f0c29d025e576b725dc3 SHA1 9d8d8d93f4120b2e60c0ec0fce7e81ea302614e7 SHA256 ed73cd1abf4c4044032929fa2dd023d851f5fe37f88009523d3b08b7d836d542 DIST xorg-server-1.1.1.tar.bz2 6252103 RMD160 17675c45b1e6ec8ed025f73efcf481c60ff42941 SHA1 eb29dd4fea9f184321cbb5512f68b674ada4daf7 SHA256 9d2df9eaced491dfe14f3ebccb15035ff8f2bc2b12f1124974adea90642dfd6c -EBUILD vnc-4.1.2-r1.ebuild 4144 RMD160 77c2193f992ff823361dd2310859812fff10a4d4 SHA1 00b63577585d1fc6cec4ea378a2a44b1a622bd36 SHA256 2dcf40b69057a45657ce5abf854550461d530e159aefba7929144a6a7fbf8845 -MD5 acf8a9e744adab1c14c4c19bd3a9f64f vnc-4.1.2-r1.ebuild 4144 -RMD160 77c2193f992ff823361dd2310859812fff10a4d4 vnc-4.1.2-r1.ebuild 4144 -SHA256 2dcf40b69057a45657ce5abf854550461d530e159aefba7929144a6a7fbf8845 vnc-4.1.2-r1.ebuild 4144 -EBUILD vnc-4.1.2.ebuild 4113 RMD160 ca0f6e782d6dda1db315b11462f8fb444a99b0c7 SHA1 55b583d48aa8485f43c4bf517d6683b844450eae SHA256 08c8190bb109989c84c7ac1fa43efb589b6dd0000660cb96579af9de25bad7f1 -MD5 2ef09b08f58987d54ec98f312669ab7e vnc-4.1.2.ebuild 4113 -RMD160 ca0f6e782d6dda1db315b11462f8fb444a99b0c7 vnc-4.1.2.ebuild 4113 -SHA256 08c8190bb109989c84c7ac1fa43efb589b6dd0000660cb96579af9de25bad7f1 vnc-4.1.2.ebuild 4113 -MISC ChangeLog 11092 RMD160 27fd5a55e09d46ede37f1db7cd01a9617a73f578 SHA1 ead4a9f438af5d034910ee4aab72596f430abf4f SHA256 4fbbac455dd22e68dd39f85ca25bdca0771d398c8379af33130502b89523ed09 -MD5 215718c6172d540f220a5d493da4a83c ChangeLog 11092 -RMD160 27fd5a55e09d46ede37f1db7cd01a9617a73f578 ChangeLog 11092 -SHA256 4fbbac455dd22e68dd39f85ca25bdca0771d398c8379af33130502b89523ed09 ChangeLog 11092 +EBUILD vnc-4.1.2-r1.ebuild 4226 RMD160 9ef544a3dc65530825022c68055dab28075b0549 SHA1 9b2de192b055727243a14212e39e1950f2309b0d SHA256 986d63aa512c712ccd1829701848c1c1e6b4dbf39234544ef41d2a5d9e2f934c +MD5 ac1efb08e9b4dbef83d59d7a3f8431ac vnc-4.1.2-r1.ebuild 4226 +RMD160 9ef544a3dc65530825022c68055dab28075b0549 vnc-4.1.2-r1.ebuild 4226 +SHA256 986d63aa512c712ccd1829701848c1c1e6b4dbf39234544ef41d2a5d9e2f934c vnc-4.1.2-r1.ebuild 4226 +EBUILD vnc-4.1.2.ebuild 4195 RMD160 be4425e8cc8dbec2df4c051588bca61b0004171c SHA1 9f5c407f9d425b235af8787759b02d767ba2242b SHA256 964caa85e96db3b854a71fd9b553535dbfbb734a57febb10e685a3af9c337631 +MD5 4b215a222ab6da3a9a3eb17d26473c6e vnc-4.1.2.ebuild 4195 +RMD160 be4425e8cc8dbec2df4c051588bca61b0004171c vnc-4.1.2.ebuild 4195 +SHA256 964caa85e96db3b854a71fd9b553535dbfbb734a57febb10e685a3af9c337631 vnc-4.1.2.ebuild 4195 +MISC ChangeLog 11249 RMD160 7df2678d9dece5c498ba731e0323f4879c83613c SHA1 07fa7d59ec2a3c0f82f84568c20ad310cdf2ff0e SHA256 561ba8f2a7562af236bd0d200df4409dcfc274c32c3d84ec8ea546f28cdab616 +MD5 9be51d8a8d6c600c3c3a326fe6d950d3 ChangeLog 11249 +RMD160 7df2678d9dece5c498ba731e0323f4879c83613c ChangeLog 11249 +SHA256 561ba8f2a7562af236bd0d200df4409dcfc274c32c3d84ec8ea546f28cdab616 ChangeLog 11249 MISC metadata.xml 285 RMD160 2bdfdc81153ba4c9857b853668141216b8d33fb9 SHA1 2c95c236b44a86f17fe3ecc7fa7d775587443ba3 SHA256 78f00ad3b66ff4b0ec0bca5c771f4d4ba69dab3ea88c198a5d54fb83fe8fddff MD5 3ba05c3b9f15d67563d5699dad396690 metadata.xml 285 RMD160 2bdfdc81153ba4c9857b853668141216b8d33fb9 metadata.xml 285 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 -- 2.26.2