?
Solved

startup and nightly scripts

Posted on 2007-04-03
2
Medium Priority
?
488 Views
Last Modified: 2013-12-27
Hi.
I'm using Solaris 10, and having trouble finding out how to start something after boot the correct way.
As root I need to run /opt/glassfish/bin/asadmin start-appserv after reboot.
Any ideas how I can do this.

I allso need to do /opt/glassfish/bin/asadmin restart-appserv every night. Anyone who knows how?
0
Comment
Question by:kristian_gr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Expert Comment

by:vamsi_uk
ID: 18843601
to schedule a job everynight you need to use cron jobs. please refer to the following link for good explanation on how to setup cron job.

http://adminschoice.com/docs/crontab.htm

If you need to start your application at boot time you need to put a startup script at run level scripts which are also known as rc scripts.

Here is how you can add the script to run at boot time,

to start a script at run level 2...

1. Become Superuser

2. Add the script to the /etc/init.d directory
# cp <filename>  /etc/init.d
# chmod 0744 /etc/init.d/<filename>
# chown root:sys /etc/init.d/<filename>

3. Create links to the appropriate rc<n>.d   where n is the number of the level
# cd /etc/init.d
# ln <filename> /etc/rc2.d/S<filename>
# ln <filename> /etc/rc<n>.d/K<filename>   <-- this is your kill script while system is shutdown

4. Use the ls cocmmand to verify that the script has links in the specified directories
# ls -l /etc/init.d/  /etc/rc2.d  /etc/rc<n>.d
thats it.. Whenever you are booting the system the script will run when the Operating system enters in run level 2.
0
 
LVL 22

Accepted Solution

by:
blu earned 2000 total points
ID: 18844049
Actually, for Solaris 10 and above, the proper way to start services at boot time is to use SMF. Although the startup scripts in the rc?.d directories are still run, this is called "legacy support" and
are deprecated.

SMF is a little trickier to get up to speed, but they offer quite a few advantages, including automatic restart of a service if the daemon crashes.

I notice you are using glassfish. Glassfish comes with SMF support built in. I am not an expert on Glassfish, but my understanding is that you can use the asadmin command to create the SMF service. After that all you have to do is enable it.

I did come across this URL that talks about it. I cannot guarantee that this still works exactly as described, since the article is a year old. However, it should have something about this in the Glassfish documentation.

http://blogs.sun.com/bloggerkedar/entry/app_server_and_solaris_10
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month10 days, 21 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question