LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 02-05-2008, 10:08 AM   #1
ingerul9
Member
 
Registered: Jan 2007
Posts: 35

Rep: Reputation: 15
Solaris 9 RealVNC Startup Script Wanted


Hi. I have a Sparc Solaris 9 machine. I've installed VNC.

Now the problem is how do I make it to automatically start when I reboot to machine? Does anyone have any idea how should I make this possible?
 
Old 02-06-2008, 03:26 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Take a look at this one.

Regards
 
Old 02-06-2008, 04:35 AM   #3
ingerul9
Member
 
Registered: Jan 2007
Posts: 35

Original Poster
Rep: Reputation: 15
Ok. I don't know much about scripting so that's why I'm going to ask how to change the following for user root only.

Can I change it to

/bin/su - root -c "/usr/local/bin/vncserver :1"

In the end of the script it's written "esac". Shouldn't it be "case"? Any help is apreciated. Thank you.


#!/bin/sh
#
# Startup/Stop script for vncservers for some users.
#

case "$1" in

'start')
/bin/su - bob -c "/usr/local/bin/vncserver :1"
/bin/su - sally -c "/usr/local/bin/vncserver :2"
/bin/su - jim -c "/usr/local/bin/vncserver :3"
;;

'stop')
/bin/su - bob -c "/usr/local/bin/vncserver -kill :1"
/bin/su - sally -c "/usr/local/bin/vncserver -kill :2"
/bin/su - jim -c "/usr/local/bin/vncserver -kill :3"
;;

*)
echo "Usage: /etc/init.d/rc.vnc { start | stop }"
;;

esac
 
Old 02-06-2008, 05:03 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Wink

esac is the closing of case
So if you're sure you want just root to start vncserver modify the script like this:
Code:
#!/bin/sh
#
# Startup/Stop script for vncservers for some users.
#

case "$1" in

'start')
/bin/su - root -c "/usr/local/bin/vncserver :1"
;;

'stop')
/bin/su - root -c "/usr/local/bin/vncserver -kill :1"
;;

*)
echo "Usage: /etc/init.d/rc.vnc { start | stop }"
;;

esac
and create the appropriate symlinks
 
Old 02-06-2008, 05:05 AM   #5
ingerul9
Member
 
Registered: Jan 2007
Posts: 35

Original Poster
Rep: Reputation: 15
Ok. I will try this way. Thanks a lot. I'll be posting if it works.
 
Old 06-15-2009, 12:16 PM   #6
chris
Member
 
Registered: Nov 2001
Location: Toronto, Canada
Distribution: CentOS 4
Posts: 66

Rep: Reputation: 15
-kill :1 doesn't kill vncserver

Quote:
Originally Posted by bathory View Post
esac is the closing of case
So if you're sure you want just root to start vncserver modify the script like this:
Code:
#!/bin/sh
#
# Startup/Stop script for vncservers for some users.
#

case "$1" in

'start')
/bin/su - root -c "/usr/local/bin/vncserver :1"
;;

'stop')
/bin/su - root -c "/usr/local/bin/vncserver -kill :1"
;;

*)
echo "Usage: /etc/init.d/rc.vnc { start | stop }"
;;

esac
and create the appropriate symlinks
Hi guys,

I have used this start script and it works well to start vncserver :1 but when I try and stop it with /etc/init.d/rc.vnc stop, what it does is start vncserver :2. Not too sure why that is or how to fix that.. any ideas??

Thank you,

Chris
 
Old 06-15-2009, 01:48 PM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
What happens if you run directly from CLI:
Code:
/bin/su - root -c "/usr/local/bin/vncserver -kill :1"
after vncserver was started using /etc/init.d/rc.vnc start
 
Old 06-15-2009, 02:18 PM   #8
chris
Member
 
Registered: Nov 2001
Location: Toronto, Canada
Distribution: CentOS 4
Posts: 66

Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
What happens if you run directly from CLI:
Code:
/bin/su - root -c "/usr/local/bin/vncserver -kill :1"
after vncserver was started using /etc/init.d/rc.vnc start
Thanks for the response.. looks like my problem was not using the quotes at the CLI. It still started the process when I started vncserver but killing whithout the quotes was what created a second vncserver PID.

All works well now thanks!
 
Old 06-15-2009, 02:23 PM   #9
chris
Member
 
Registered: Nov 2001
Location: Toronto, Canada
Distribution: CentOS 4
Posts: 66

Rep: Reputation: 15
Quote:
Originally Posted by chris View Post
Thanks for the response.. looks like my problem was not using the quotes at the CLI. It still started the process when I started vncserver but killing whithout the quotes was what created a second vncserver PID.

All works well now thanks!
Actually there is one minor issue that is not preventing vncserver from starting but still is a cause for concern as it delays the start process and not sure exactly what else it may impact.

when I start vncserver I get the following message:

xauth: timeout in locking authority file /export/home/clamontagne/.Xauthority
xauth: timeout in locking authority file /export/home/clamontagne/.Xauthority

I'm trying to figure out what is causing this but any help on tihs one would be appreciated.

thanks!
 
Old 06-15-2009, 04:43 PM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi glad to see that the stop script had worked.
Now, about the xauth timeout quoting from openwin documentation, possible reasons and remedies:
Quote:
1. The user's $HOME is not writable by the user; $HOME may be owned by an entirely different user.
2. The lock file $HOME/.Xauthority-l already exists; remove this file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
WANTED: rc.firewall - the script! Sjonnie48 Linux - General 4 01-16-2008 09:46 AM
Solaris 10 x64/x86 driver wanted cstsang Solaris / OpenSolaris 3 10-31-2005 11:27 PM
RealVNC startup errors w/ Fedora 2, GUI does not appear AngryKeebler Linux - Networking 0 06-30-2004 09:41 PM
startup script for Solaris chrisfirestar Solaris / OpenSolaris 3 03-08-2004 11:22 PM
script wanted ust Linux - General 2 09-03-2003 01:20 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 06:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration