---
title: "Solaris boot Script"
author: "wwbutton"
date: "2008-08-07T10:20:21Z"
tags: []
slug: "solaris-boot-script"
draft: false
lastmod: "2008-08-07T10:20:21Z"
id: 225305
url: "https://button.iteye.com/blog/225305"
---

Solaris 系统启动脚本 
 
今晚帮朋友装一套系统软件。写了一个系统启动脚本虽然简单但第一次写还是挺折腾的 。
 
who -r 查看系统运行级别
root@v250 # who -r
   .       run-level 3  Sep 28 22:39     3      0  S
 
#建立系统启动脚本
vi /etc/init.d/Jedi
#!/sbin/sh
#
# WTWY co.
# All rights reserved.
#
# write by ww 05/09/28 SMI"
case "$1" in
'start')
 su - root -c "/usr/local/tomcat/bin/startup.sh"
 su - postgres -c "bin/pg_ctl start -D ./data" 
 ;;
'stop')
 su - postgres -c "bin/pg_ctl stop -W -D ./data -m fast" 
 su - root -c "/usr/local/tomcat/bin/shutdown.sh"
        exit 1
        ;;
esac
exit 0
 
# 改变权限
chmod +x Jedi
#建立链接  
ln -s /etc/init.d/Jedi /etc/rc2.d/S99Jedi
ln -s /etc/init.d/Jedi /etc/rc3.d/S99Jedi
ln -s /etc/init.d/Jedi /etc/rc0.d/K10Jedi