Include xhost + at auto reboot script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Include xhost + at auto reboot script
# 1  
Old 12-07-2006
Include xhost + at auto reboot script

Below is the startup/stop script for vncservers by end-user.
How can xhost + command include in this script?

Please help. Thank you.

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

case "$1" in

'start')
/bin/rm /tmp/.X11-unix/X0
/bin/su - applprod -c "/export/home/applprod/VNC/vncserver :0"
;;

'stop')
/bin/su - applprod -c "/export/home/applprod/VNC/vncserver -kill :0"
;;

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

esac
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Disable xen machine to auto start on reboot

Hello Guys - I need to disable xen server not to start when the server is rebooted. 1) What is the parameter to be used to do this..below is the entry in my config file... on_reboot = "restart" 2) What is the default behaviors of the xen on reboot ? in case we comment this line from config... (0 Replies)
Discussion started by: saurabh84g
0 Replies

2. UNIX for Dummies Questions & Answers

xhost

Some of my users find that a graphical program I have given them will not run until they type: xhost +local:username where, of course, they substitute in their own user name. My question is what the word "local" is doing there and whether it would work as well without it. Thanks in... (0 Replies)
Discussion started by: Brandon9000
0 Replies

3. UNIX for Dummies Questions & Answers

[solved] Script creation (how to include options in the script)

Hi guys i have written a script which takes the options given to him and execute itself accordingly. for example if a script name is doctortux then executing doctortux without option should made doctortux to be executed in automatic mode i.e. doctortux -a or if a doctortux is needed to run in... (4 Replies)
Discussion started by: pinga123
4 Replies

4. SCO

SCO 5.0 setup auto reboot

Hello, How do a schedule a reboot of a SCO 5.0 box like every wednesday at 3:30 am. Doesn't have a /etc/crontab file like our Suse boxes have. Thanks for any help. (6 Replies)
Discussion started by: benefactr
6 Replies

5. Shell Programming and Scripting

include in script

Hello, I have a script and a second file that contains all parameters needed for the script. How can I include this file in the script ? I tried source but I have a "no such file or directory" error. :) (1 Reply)
Discussion started by: pppswing
1 Replies

6. UNIX for Dummies Questions & Answers

Xhost help

Hi all, I am trying to enable usage of X on 2 servers - ServerA and ServerB. I am logged in as root on ServerA and am trying to add ServerB into the access list of A. I am using this: root@ServerA#> export DISPLAY=localhost:20.0 root@ServerA#> xhost +ServerB I am getting the... (3 Replies)
Discussion started by: vishi
3 Replies

7. UNIX for Dummies Questions & Answers

Include PERL script with in the unix shell script

Hi Gurus, Is it possible to include perl script with in the unix shell script? What would be the general syntax? In the above case, is it required to write the below first two lines of codes? #!usr/bin/sh -x #!usr/bin/perl -w Thanks in advance / Mysore Ganapati. (1 Reply)
Discussion started by: ganapati
1 Replies

8. UNIX for Advanced & Expert Users

Xhost and ILO

I have an application that requires me to disable the restricted access to the X Server libraries by issuing the 'Xhost +' command from a Console Window. It is important that this command is run from the Console Window and not a Terminal Window otherwise the system complains that DISPLAY is not... (0 Replies)
Discussion started by: jimthompson
0 Replies

9. Solaris

SB150 auto reboot

My SB150 machine rebooted itself this week several times, anyone have idea what the problem is, a blaster? :) kidding (2 Replies)
Discussion started by: howhowzz
2 Replies
Login or Register to Ask a Question
SERVICE(8)						    BSD System Manager's Manual 						SERVICE(8)

NAME
service -- control (start/stop/etc.) or list system services SYNOPSIS
service -e service -R service [-v] -l | -r service [-v] <rc.d script> start|stop|etc. DESCRIPTION
The service command is an easy interface to the rc.d system. Its primary purpose is to start and stop services provided by the rc.d scripts. When used for this purpose it will set the same restricted environment that is in use at boot time (see below). It can also be used to list the scripts using various criteria. The options are as follows: -e List services that are enabled. The list of scripts to check is compiled using rcorder(8) the same way that it is done in rc(8), then that list of scripts is checked for an "rcvar" assignment. If present the script is checked to see if it is enabled. -R Restart all enabled local services. -l List all files in /etc/rc.d and the local startup directories. As described in rc.conf(5) this is usually /usr/local/etc/rc.d. All files will be listed whether they are an actual rc.d script or not. -r Generate the rcorder(8) as in -e above, but list all of the files, not just what is enabled. -v Be slightly more verbose ENVIRONMENT
When used to run rc.d scripts the service command sets HOME to / and PATH to /sbin:/bin:/usr/sbin:/usr/bin which is how they are set in /etc/rc at boot time. EXIT STATUS
The service utility exits 0 on success, and >0 if an error occurs. EXAMPLES
The following are examples of typical usage of the service command: service named status service -rv The following programmable completion entry can be use in bash(1) for the names of the rc.d scripts: _service () { local cur cur=${COMP_WORDS[COMP_CWORD]} COMPREPLY=( $( compgen -W '$( service -l )' -- $cur ) ) return 0 } complete -F _service service SEE ALSO
bash(1) (ports/shells/bash), rc.conf(5), rc(8), rcorder(8) HISTORY
The service utility first appeared in FreeBSD 7.3. AUTHORS
This manual page was written by Douglas Barton <dougb@FreeBSD.org>. BSD
December 11, 2012 BSD