Where should I put the script?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Where should I put the script?
# 1  
Old 01-15-2008
Bug Where should I put the script?

Hi Guys,

I'm a new to the UNIX. Let say I have a 1 simple script to stop and start vnc service. I want to use that script for support because my network connection to my client side is not stable and every time I have to use a long command to restart vnc.

Where should I put that script? Should I keep it in init.d or put it in /usr/local/.... ?

Thanks in advance.
# 2  
Old 01-15-2008
if i read correctly you have a script to start stop vnc yourself.

it depends on what kind of script it is.
and what unix enverioment you have.

but if it is a script that you want to start from commandline by ticking in one command
put it in a place where it is in your path.
use tjhe command "set" to see what enverioment variabled you have set
mostly places like /usr/local/bin will be in your path
# 3  
Old 01-16-2008
Quote:
Originally Posted by jurrien
if i read correctly you have a script to start stop vnc yourself.

it depends on what kind of script it is.
and what unix enverioment you have.

but if it is a script that you want to start from commandline by ticking in one command
put it in a place where it is in your path.
use tjhe command "set" to see what enverioment variabled you have set
mostly places like /usr/local/bin will be in your path
That make sense too. Thanks a lot buddy. I'm using Solaris 7. One thing that I'm not sure is should I put it in /etc/init.d directory or not. Any advice would be much appreciated.
# 4  
Old 01-16-2008
If this is a service you want to start automatically everytime this solaris box reboots then put a startup and shutdown script in /etc/init.d and also in /etc/rc3.d (actually are a just a bunch of soft links to the script in /etc/init.d --> ln -s /etc/init.d/scriptname /etc/rc3.d/S99scriptname and K99scriptname).

I would test it out if it works in your environment before making it production. I use S99 since its normally the highest number, and you dont want this service to start without having the other stuff start first.

And oh BTW, I havent put together a Solaris box so I am not sure about /etc/rc3.d (it might be rc5.d or rc6.d, ah been a long time). Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Where to put script to be executed before shutdown ?

Hello, My AIM is to run my script every time when someone shutdown or reboot my RHEL7 AWS instance. Query ) Where should i put my script .So, that it gets automatically executed when a server is going down or reboot ? (3 Replies)
Discussion started by: saurabh84g
3 Replies

2. Shell Programming and Scripting

Put currently running script into background

Hi All, Suppose I have a script and inside it I want/need to put it into background. I need the script to not react to SIGHUP signals. I tried: #!/bin/bash echo "" > test_disown mypid=$$ echo "PID=$mypid" ( kill -SIGSTOP $mypid jobs > myjobs #disown -h <job-spec> #kill -SIGCONT $mypid )... (6 Replies)
Discussion started by: JackK
6 Replies

3. Shell Programming and Scripting

Put Script on Start-up the sh Terminal

Hi all I want to put this script on start-up the sh Terminal to save history of output: if ; then logdir=$HOME/terminal-logs if ; then mkdir $logdir fi gzip -q $logdir/*.log logfile=$logdir/$(date +%F_%T).$$.log ... (12 Replies)
Discussion started by: Rahim_T
12 Replies

4. UNIX for Dummies Questions & Answers

put script into file

hi, ok having here some code like: #!/bin/bash echo " hello " # say hello to the user echo " $HOME " echo " $HOSTNAME " echo " $(uname) " echo " today is $(date) " echo " $(whoami) is currently logged in " now my question is how to change the code so that the info is not... (12 Replies)
Discussion started by: me.
12 Replies

5. Shell Programming and Scripting

how to put into logs the exact doing of script!

Hi All, I'm a newbie here, I'm just wondering how can i put into the logs of the exact doing of script. ex.: test1.sh abcd@10.226.144.180's password: 20111102 17:20:02 || FILE FOUND IN ICCBS SERVER 20111102 17:20:02 || ACCESS ICCBS SERVER TO GET FILES Connecting to 10.226.144.180...... (1 Reply)
Discussion started by: nikki1200
1 Replies

6. Shell Programming and Scripting

Script required to put colon

Hi Expert, I need help on script to put colon between two characters. From this line 60060160B18414009C557D9DE02CDF11 to this 60:06:01:60:B1:84:14:00:9C:55:7D:9D:E0:2C:DF:11 Any way to make it on script. (2 Replies)
Discussion started by: ranjancom2000
2 Replies

7. Programming

How to put variable date from SQL Script

Hi Guys, Can someone please help me on adding/inserting a variable to an sql scipt? Basically I want to assign today's date. As shown below.. set head off; set linesize 300; set pagesize 200; spool /opt/oracle/temp/output.txt select value,count(*) as totalcount from pmowner.pinpebasev... (11 Replies)
Discussion started by: pinpe
11 Replies

8. Shell Programming and Scripting

Could I put this into a case script instead?

Hi guys, I have a script which clears down a range of directories, however it can take a while to run. Is there a way I can simplify the below, perhaps adding it into a case statement? client_directories=/usr/local/production/cleanup/bin/client_cleanups/client_directories.txt # clear down... (2 Replies)
Discussion started by: JayC89
2 Replies

9. Solaris

how to put script in startup

Hi All, O/S: Solaris 5.10 Software installed :- Oracle 10G Weblogic 10.30 the problem i face that when the server restart for any reason SQL> exit bash-3.00# sqlplus sys/manchester as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Sun May 2 11:04:50 2010 Copyright (c)... (3 Replies)
Discussion started by: xxmasrawy
3 Replies

10. Shell Programming and Scripting

Script is not working when put in crontab

Hi there, this is part of my script: /usr/bin/cd /u01/oradata /usr/bin/cp `/bin/ls -1 . |grep -v "^DIMStemp01.dbf$" | grep -v "^DIMSts01.dbf$"|grep -v "^DIMStects01.dbf$"` /backup It's working fine when I manually run on telnet session. /bin/ls -1 . -- to list all the files inside... (2 Replies)
Discussion started by: *Jess*
2 Replies
Login or Register to Ask a Question