Start Script on system reboot


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Start Script on system reboot
# 1  
Old 08-31-2015
Start Script on system reboot

Hi,
I have the following script that looks for a certain file and then executes the start.sh file. How can i make this process to kick when the box reboots. Please advice
Code:
if [ -f /u01/EnvironmentStartup/Foundationstarted.txt ]; then
    /u01/Essbase/Oracle//Middleware/user_projects/epmsystem7/bin/start.sh;
    rm /u01/EnvironmentStartup/Foundationstarted.txt;
 fi

Thanks
# 2  
Old 08-31-2015
It will depend of your operating system... Which you have said nothing...
# 3  
Old 08-31-2015
Quote:
Originally Posted by vbe
It will depend of your operating system... Which you have said nothing...
Thanks Vbe and my apologies
Linux x86_64 GNU/Linux
# 4  
Old 08-31-2015
The script should me a bit more complete than that to be used at boot, for it should be able to be started - and stopped also....
Then once that script works perfectly you should put in in /etc/init.c and create symbolic links to the proper init level you want the script to start and do the same for stop...
the file should use an argument which is either stop or start
Go and have a look how it is done on your system!
# 5  
Old 08-31-2015
Would such init scripts still work if it is a systemd system?

Such a service is 'easy' written, have a look at some services in:
  • /etc/systemd/system/ (files here are accessed using systemctl)
  • /lib/systemd/system/ (files here are copied to the /etc/systemd/system folder)

hth
# 6  
Old 08-31-2015
oracle has a statup/shutdown file called oratab. If you could tell us what your OS is we could probably tell you where it is, minus that the find command is your friend.

Read up on oratab syntax first - you are allowed to call ONE shell script per db.
The file is used both for startup & shutdown. If you have oracle installed you probably have the file. A companion file is oraenv.

Oratab - Oracle FAQ

PS your file should be /etc/oratab
https://community.oracle.com/thread/2538383
# 7  
Old 08-31-2015
Quote:
Originally Posted by jim mcnamara
oracle has a statup/shutdown file called oratab. If you could tell us what your OS is we could probably tell you where it is, minus that the find command is your friend.

Read up on oratab syntax first - you are allowed to call ONE shell script per db.
The file is used both for startup & shutdown. If you have oracle installed you probably have the file. A companion file is oraenv.

Oratab - Oracle FAQ

PS your file should be /etc/oratab
https://community.oracle.com/thread/2538383
Thanks Jim,
There are start and stop files. I have this process which needs to startup a service once the "Foundationstarted.txt" exists. The .sh script should come into play as soon as the system reboots. so whenever the linux (gnu/linux) box is rebooted this ".sh" should be executed and this will keep looking for the "Foundationstarted.txt" file every minute until it finds it and then once it finds it restart the Essbase services.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Iso - remaster script trying to start chroot run commands then exit but host system gets messed up

The script works and creates a modified iso fine until I added the chrootbeg and chrootend functions and executed them. I'm sorry if I did something wrong this is my first post. I uploaded entire bash script for reference or in case you want to run it to debug it is called isoremast.txt. ... (5 Replies)
Discussion started by: paulhoffusa
5 Replies

2. 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

3. Shell Programming and Scripting

Executing script at system start up

Hi I had written a piece of script . Please let me know is it possible to run / execute this script at system startup ?? Thanks in advance . (5 Replies)
Discussion started by: Ravi Pavanv
5 Replies

4. AIX

Q: how to start a service when system start

As topic, assume we have a service called "blahservice" and we can start it by: startsrc -s blahservice what is the best practice to run such command when system start? - directly use mkitab to add it into /etc/inittab or - drop startup scripts in /etc/rc.d/rcX.d I know they... (4 Replies)
Discussion started by: acerlinux
4 Replies

5. Solaris

system reboot procedure

Hi all, i want to know the procedure reboot the server through console if the system is completely down.Please help me if anybody knows this. I would really thanfull to all. regards Krishna Murthy (1 Reply)
Discussion started by: murthy76
1 Replies

6. Linux

xinetd @system reboot

Hi, Once again I came to get rescued in a situation where one of my workstations has this ierd thing that "xinetd" won't start at reboot or shutdown. I have done the follwoing but no change in results. chkconfig --list xinetd xinetd 0:off 1:off 2:on 3:on 4:on 5:on ... (2 Replies)
Discussion started by: harjitsingh
2 Replies

7. Solaris

System Reboot Log

Hello Everyone , I am a new member to this forum and came to know about this from so many of my friends . I face one issue last day when suddenly the system got rebooted ( But don,t know why ) . Can someone please help me in investigating this issue as to why the system got rebooted and who... (4 Replies)
Discussion started by: gera_sachin125
4 Replies

8. Solaris

system self reboot

dear all, I have 2 T2000 with solaris 10 and oracle 10g installed on it. these two servers are rebooted by itself. could anyone help me investigate the cause. the message log is attached thanx, (3 Replies)
Discussion started by: fsmadi
3 Replies

9. UNIX for Dummies Questions & Answers

System Reboot Dates

Hi, Can someone advise me how to find the last system rebooted date(s)? Thanx N Regards, Hush (2 Replies)
Discussion started by: hush
2 Replies

10. Filesystems, Disks and Memory

Intermitent System Reboot's

Hi all, Just started holidays (ya!) and Murphy's Law has kicked in already (doh!). I'm looking after (when at work) two SCO 5.0.5 Systems running on Netfinity 5500 Servers (Model # 8662-3RY). Every once and a while the production server just reboot's itself. There is no mention of a cause... (8 Replies)
Discussion started by: Cameron
8 Replies
Login or Register to Ask a Question