Zenity shutdown script with Consolekit
Somehow we are at the new stage hal deprecated and its changes is not easy for newbies to follows. also changing sudoers is a dirty and not safe trick So:
The need for zenity script with these feature:
@ Consolekit +dbus
@Logout
@shoutdown
@restart
@suspend { should we add resume to rc.conf daemons arry? if yes where? at the end?}
@my be cancel
is really being felt.
So if someone how is able to change the old zentiy openbox script comes forward and do the job; we are all appreciating.
Here's my logout script, it's an edited version of one of the Openbox logout scripts. It requires python2 and pygtk, so no zenity, but I thought it might be useful for someone nonetheless. Oh, the suspend/sleep needs pm-utils installed.
#!/usr/bin/env python2
import pygtk
pygtk.require('2.0')
import gtk
import os
class DoTheLogOut:
# Cancel/exit
def delete_event(self, widget, event, data=None):
gtk.main_quit()
return False
# Suspend
def suspend(self, widget):
os.system("pm-suspend")
# Hibernate
def hibernate(self, widget):
os.system("pm-hibernate")
# Reboot
def reboot(self, widget):
os.system("dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart")
# Shutdown
def shutdown(self, widget):
os.system("dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop")
def __init__(self):
# Create a new window
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_title("Afsluiten? Kies een optie:")
self.window.set_resizable(False)
self.window.set_position(1)
self.window.connect("delete_event", self.delete_event)
self.window.set_border_width(20)
# Create a box to pack widgets into
self.box1 = gtk.HBox(False, 0)
self.window.add(self.box1)
# Create cancel button
self.button1 = gtk.Button("_Annuleren")
self.button1.set_border_width(10)
self.button1.connect("clicked", self.delete_event, "Changed me mind :)")
self.box1.pack_start(self.button1, True, True, 0)
self.button1.show()
# Create suspend button
self.button2 = gtk.Button("_Sluimerstand")
self.button2.set_border_width(10)
self.button2.connect("clicked", self.suspend)
self.button2.connect("clicked", self.delete_event, "Force removal :(")
self.box1.pack_start(self.button2, True, True, 0)
self.button2.show()
# Create hibernate button
self.button3 = gtk.Button("S_laapstand")
self.button3.set_border_width(10)
self.button3.connect("clicked", self.hibernate)
self.box1.pack_start(self.button3, True, True, 0)
self.button3.show()
# Create reboot button
self.button4 = gtk.Button("_Opnieuw opstarten")
self.button4.set_border_width(10)
self.button4.connect("clicked", self.reboot)
self.box1.pack_start(self.button4, True, True, 0)
self.button4.show()
# Create shutdown button
self.button5 = gtk.Button("A_fsluiten")
self.button5.set_border_width(10)
self.button5.connect("clicked", self.shutdown)
self.box1.pack_start(self.button5, True, True, 0)
self.button5.show()
self.box1.show()
self.window.show()
def main():
gtk.main()
if __name__ == "__main__":
gogogo = DoTheLogOut()
main()
Last edited by Unia (2011-08-20 11:01:46)
Similar Messages
-
Shutdown script for awesome wm
I`m writing a shutdown script for my awesome wm.
it looks like this
[c!/bin/bash
ACTION=`zenity --width=90 --height=200 --list --radiolist --text="Select logout action" --title="Logout" --column "Choice" --column "Action" TRUE Shutdown FALSE Reboot FALSE LockScreen FALSE Suspend`
if [ -n "${ACTION}" ];then
case $ACTION in
Shutdown)
#zenity --question --text "Are you sure you want to halt?" &&
dbus-send --system --print-reply \
--dest=org.freedesktop.ConsoleKit \
/org/freedesktop/ConsoleKit/Manager \
org.freedesktop.ConsoleKit.Manager.Stop
Reboot)
#zenity --question --text "Are you sure you want to reboot?" && gksudo reboot
dbus-send --system --print-reply \
--dest=org.freedesktop.ConsoleKit \
/org/freedesktop/ConsoleKit/Manager \
org.freedesktop.ConsoleKit.Manager.Restart
Suspend)
#gksudo pm-suspend
dbus-send --system --print-reply --dest=org.freedesktop.Hal \
/org/freedesktop/Hal/devices/computer \
org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0
LockScreen)
slock
esac
fi
and i makedd it executable with chmod +x. But it sims that she is not working.When i run it as root the script works.And when i run it like user onli suspend semams to working.You don't have to use the deprecated hal! Here are my scripts which I use(d). All you need is
exec ck-launch-session awesome
in your .xinitrc.
shutdown
#!/bin/bash
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
reboot
#!/bin/bash
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
hibernate
#!/bin/bash
dbus-send --system --print-reply --dest="org.freedesktop.DeviceKit.Power" /org/freedesktop/DeviceKit/Power org.freedesktop.DeviceKit.Power.Hibernate
and suspend
#!/bin/bash
dbus-send --system --print-reply --dest="org.freedesktop.DeviceKit.Power" /org/freedesktop/DeviceKit/Power org.freedesktop.DeviceKit.Power.Suspend
Last edited by Army (2010-12-25 20:42:09) -
Error in shutdown script for bea weblogic
We have this error in the shutdown script of our bea weblogic:
./stopWebLogic.sh[33]: -Xms256m: not found.
using the Oracle OCI database driver
Shutdown initiated
The shutdown sequence has been initiated.the script is as follows:
echo "using the Oracle OCI database driver"
export ORACLE_HOME=/opt/oracle/product/8.1.7
export NLS_LANG=AMERICAN_AMERICA.UTF8
export ORACLE_CLIENT_VERSION=817
export ORACLE_API_VERSION=8
PATH=$PATH:$ORACLE_HOME/bin
SHARED_LIBRARY_PATH=$WEBLOGIC_HOME/lib/hpux11:$WEBLOGIC_HOME/lib/hpux11/oci$ORACLE_CLIENT_VERSION\_$ORACLE_API_VERSION:$ORACLE
_HOME/lib
PATH=$JDK_HOME/bin:$PATH
export PATH
# Set application specific variables
DOMAIN_NAME=eGovStarters
SERVER_NAME=MyServer
WLS_PW=weblogic
# change to domain directory
cd $WEBLOGIC_HOME/config/$DOMAIN_NAME
# Allow other users in group to see created files - i.e. logfiles
umask 027
# Set system classpath initially to contain WebLogic product JARs
CLASSPATH=$WEBLOGIC_HOME:$WEBLOGIC_HOME/lib/weblogic.jar
#!/bin/sh
# Weblogic start script for egovernment
# Based on Colin Brick's initial version
# Modified 02/04/03 - Colin Brick
# - included settings for Oblix from using SSO Assembly Test as example
# Set General environment variables (Should normally not be changed)
#Java settings
JDK_HOME=/opt/bea/jdk131/
export JDK_HOME
JAVACMD=java
JAVA_OPTIONS=""-server -Xms1024m -Xmx1024m -Xmn320m -XX:SurvivorRatio=8 -Xverbosegc:file=/opt/bea/wlserver6.1/config/eGovStart
ers/logs/gc.log -Dweblogic.system.gc.enabled=false ""
export JAVA_OPTIONS
WEBLOGIC_PORT=51080
#Bea settings
BEA_HOME=/opt/bea
export BEA_HOME
WEBLOGIC_HOME=/opt/bea/wlserver6.1
export WEBLOGIC_HOME
BEA_SECURITY_POLICY=/opt/bea/wlserver6.1/lib/weblogic.policy
export BEA_SECURITY_POLICY
#Oracle settings
echo "using the Oracle OCI database driver"
export ORACLE_HOME=/opt/oracle/product/8.1.7
export NLS_LANG=AMERICAN_AMERICA.UTF8
export ORACLE_CLIENT_VERSION=817
export ORACLE_API_VERSION=8
PATH=$PATH:$ORACLE_HOME/bin
SHARED_LIBRARY_PATH=$WEBLOGIC_HOME/lib/hpux11:$WEBLOGIC_HOME/lib/hpux11/oci$ORACLE_CLIENT_VERSION\_$ORACLE_API_VERSION:$ORACLE
_HOME/lib
PATH=$JDK_HOME/bin:$PATH
export PATH
# Set application specific variables
DOMAIN_NAME=eGovStarters
SERVER_NAME=MyServer
WLS_PW=weblogic
# change to domain directory
cd $WEBLOGIC_HOME/config/$DOMAIN_NAME
# Allow other users in group to see created files - i.e. logfiles
umask 027
# Set system classpath initially to contain WebLogic product JARs
CLASSPATH=$WEBLOGIC_HOME:$WEBLOGIC_HOME/lib/weblogic.jar
domain_NAME=eGovStarters
SERVER_NAME=MyServer
WLS_PW=weblogic
# change to domain directory
cd $WEBLOGIC_HOME/config/$DOMAIN_NAME
# Allow other users in group to see created files - i.e. logfiles
umask 027
# Set system classpath initially to contain WebLogic product JARs
CLASSPATH=$WEBLOGIC_HOME:$WEBLOGIC_HOME/lib/weblogic.jar
#Set the shared library path
if [ -n "$SHLIB_PATH" ]; then
SHLIB_PATH=$SHLIB_PATH:$SHARED_LIBRARY_PATH
else
SHLIB_PATH=$SHARED_LIBRARY_PATH
fi
export SHLIB_PATH
# Start weblogic
# change to weblogic home
cd $WEBLOGIC_HOME
PATH=$WL_HOME/bin:$JAVA_HOME/jre/bin:$JAVA_HOME/bin:$PATH
$JAVACMD -classpath $CLASSPATH -Dbea.home=$BEA_HOME -Dweblogic.Domain=$DOMAIN_NAME -Dweblogic.Name=MyServer weblogic.Admin -ur
l t3://localhost:$WEBLOGIC_PORT -username system -password $WLS_PW SHUTDOWNIt has obviously something to do with the line
JAVA_OPTIONS=""-server -Xms1024m -Xmx1024m -Xmn320m -XX:SurvivorRatio=8 -Xverbosegc:file=/opt/bea/wlserver6.1/config/eGovStart
ers/logs/gc.log -Dweblogic.system.gc.enabled=false ""I googled for this Xms1024m, Xmx1024m and it turns out to be for memory management for the java virtual machine.
I don't know why it sais it can't find "-Xms256m" since it's not in the script.
Anyone with some experience in this field who can help me out?./stopWebLogic.sh[33]: -Xms256m: not found.
this can be produced by something like this:
javaoptions="-Xms256m" // or other option too
$javacmd $javaoptions
Now if javacmd has not been set, then $javacmd will be evaluated to the empty string, and the program to look for is the first part in $javaoptions, -Xms256m in our case. -
GPO Startup/Shutdown scripts not running
I am running server 2003 SBS with windows 8.1 Pro workstations.
My workstations run 1 start-up script and 2 shutdown scripts. All are BAT files.
They were all working fine last week before I ran the update for 8.1.1, now they do not run at the appropriate time on any of those systems. However, if I execute them manually they work as expected.
I have checked to see if the BAT files are still located in the GPO and they are there. They are stored locally on each machine, I have even tried to delete and re-add them and then run GPUPDATE to no avail.
Any help here would be great, as they deal with local encrypted containers and are specific to each workstation.Hi Sebastian,
Thanks for posting.
Whether the GPO with start-up/shutdown scripts are linked to the OU containing computers?
FYI - Logon/Logoff scripts could only be applied to users, whereas Start-up/Shutdown scripts applies to computers.
Also, checkout the below thread on similar discussion,
http://social.technet.microsoft.com/Forums/windowsserver/en-US/b193e8a9-9b2a-4993-bd74-836c65c51dc3/gpo-with-a-startup-script-is-not-working
Regards,
Gopi
www.jijitechnologies.com -
Startup/Shutdown script for OBIEE 11g on Linux
Hi all,
as a follow-up to [url http://forums.oracle.com/forums/thread.jspa?messageID=4546010]an earlier thread by some fine gentleman, I have improved the original startup/shutdown script for Linux a bit, making sure that all processes are handled correctly. The script has been tested and works fine on CentOS 5.5 with Oracle BI 11.1.1.3.0 in a clustered configuration. Instructions:
Manual start/stop:
> service obiee start
> service obiee stop
> service obiee status
Automatic start/stop during boot sequence:
> chkconfig --add obiee
> chkconfig obiee on
Note that in order for the procedure to go through smoothly, you need to provide the admin credentials (username/password, defaulting to weblogic/weblogic) in three different places:
1. In configuration file <FMW_HOME>/user_projects/domains/<domain name>/servers/AdminServer/security/boot.properties for the administration server;
2. In script <FMW_HOME>/user_projects/domains/<domain name>/bin/startManagedWebLogic.sh (variables WLS_USER and WLS_PW) for the managed server;
3. In the startup script itself (variables BIEE_USER and BIEE_PASSWD) for shutting down the managed server.
Complete logs are available in /var/log/obiee-start (-stop).log files.
Please comment as necessary,
Chris
#!/bin/bash
# File: /etc/init.d/obiee
# Purpose: Start and stop Oracle Business Intelligence 11g components.
# chkconfig: 2345 99 10
# description: Manage OBIEE service.
# These values must be adapted to your environment.
ORACLE_OWNR=oracle # Local Unix user running OBIEE
ORACLE_FMW=/home/oracle/biee # Deployment root directory
BIEE_USER=<username> # BIEE administrator name
BIEE_PASSWD=<password> # BIEE administrator password
BIEE_DOMAIN=<domain name> # Domain name
BIEE_INSTANCE=instance1 # Instance name
BIEE_SERVER=bi_server1 # Server name
BIEE_MANAGER_URL=<hostname>:7001 # Admin server URL (hostname:port)
# These should require no change.
WL_PATH=$ORACLE_FMW/wlserver_10.3/server/bin
BIEE_PATH=$ORACLE_FMW/user_projects/domains/$BIEE_DOMAIN/bin
ORACLE_INSTANCE=$ORACLE_FMW/instances/$BIEE_INSTANCE
export ORACLE_INSTANCE
START_LOG=/var/log/obiee-start.log
STOP_LOG=/var/log/obiee-stop.log
SUBSYS=obiee
start() {
echo "********************************************************************************"
echo "Starting Admin Server on $(date)"
echo "********************************************************************************"
su $ORACLE_OWNR -c "$BIEE_PATH/startWebLogic.sh" &
wait_for "Server started in RUNNING mode"
echo "********************************************************************************"
echo "Starting Node Manager on $(date)"
echo "********************************************************************************"
su $ORACLE_OWNR -c "$WL_PATH/startNodeManager.sh" &
wait_for "socket listener started on port"
echo "********************************************************************************"
echo "Starting Managed Server $BIEE_SERVER on $(date)"
echo "********************************************************************************"
su $ORACLE_OWNR -c "$BIEE_PATH/startManagedWebLogic.sh $BIEE_SERVER http://$BIEE_MANAGER_URL" &
wait_for "Server started in RUNNING mode"
echo "********************************************************************************"
echo "Starting BI components on $(date)"
echo "********************************************************************************"
su $ORACLE_OWNR -c "$ORACLE_INSTANCE/bin/opmnctl startall"
echo "********************************************************************************"
echo "OBIEE start sequence completed on $(date)"
echo "********************************************************************************"
stop() {
echo "********************************************************************************"
echo "Stopping BI components on $(date)"
echo "********************************************************************************"
su $ORACLE_OWNR -c "$ORACLE_INSTANCE/bin/opmnctl stopall"
echo "********************************************************************************"
echo "Stopping Managed Server $BIEE_SERVER on $(date)"
echo "********************************************************************************"
su $ORACLE_OWNR -c "$BIEE_PATH/stopManagedWebLogic.sh $BIEE_SERVER t3://$BIEE_MANAGER_URL $BIEE_USER $BIEE_PASSWD"
echo "********************************************************************************"
echo "Stopping Node Manager on $(date)"
echo "********************************************************************************"
pkill -TERM -u $ORACLE_OWNR -f "weblogic\\.NodeManager"
echo "********************************************************************************"
echo "Stopping Admin Server on $(date)"
echo "********************************************************************************"
su $ORACLE_OWNR -c "$BIEE_PATH/stopWebLogic.sh"
echo "********************************************************************************"
echo "OBIEE stop sequence completed on $(date)"
echo "********************************************************************************"
wait_for() {
res=0
while [[ ! $res -gt 0 ]]
do
res=$(tail -5 "$START_LOG" | fgrep -c "$1")
sleep 5
done
case "$1" in
start)
echo "********************************************************************************"
echo "Starting Oracle Business Intelligence on $(date)"
echo "Logs are sent to $START_LOG"
echo "********************************************************************************"
start &> $START_LOG &
touch /var/lock/subsys/$SUBSYS
stop)
echo "********************************************************************************"
echo "Stopping Oracle Business Intelligence on $(date)"
echo "Logs are sent to $STOP_LOG"
echo "********************************************************************************"
stop &> $STOP_LOG
rm -f /var/lock/subsys/$SUBSYS
status)
echo "********************************************************************************"
echo "Oracle BIEE components status...."
echo "********************************************************************************"
su $ORACLE_OWNR -c "$ORACLE_INSTANCE/bin/opmnctl status"
restart)
$0 stop
$0 start
echo "Usage: $(basename $0) start|stop|restart|status"
exit 1
esac
exit 0You can use WLST to start/stop BI Services and it works on both Linux and Windows.
Following link has the sample -
http://download.oracle.com/docs/cd/E21764_01/bi.1111/e10541/admin_api.htm#CDEFAHDD -
Hi,
I'm looking for a shutdown script for linux to put it in crontab and another for startup. Do you have any ?
Thanks.OK, you can cron following commands (assume that all Oracle related env variables are set. We are setting ORACLE_SID just to ensure that we will be working with the right instance):
59 7 * * * su - oracle -c "export ORACLE_SID=ORCL; echo 'startup' | sqlplus -s '/ as sysdba' >>/dev/null" 2>&1
31 16 * * * su - oracle -c "export ORACLE_SID=ORCL; echo 'shutdown immediate' | sqlplus -s '/ as sysdba' >>/dev/null" 2>&1 -
Shutdown script for Weblogic admin & managed servers
Greetings,
I am new to weblogic and am using it on a new box with OID. I am in the process of writing a shutdown script to shut down all processes on the box when it is restarted, I think this is better than just pulling the plug. I have learned about and turned on t3 protocols and used WLST to tore credentials in WebLogicKey.properties & WebLogicConfig.properties file so things are working properly. What I can't find is how to shut down the managed server using WLST and am also wondering if it is better to invoke the stopManagedWebLogic.sh and the stopWebLogic.sh scripts form the shell or from the WLST tool, if indeed that is possible. If soemone has such scripts they would be willing to share that would be much appreciated.
Thank you.
Bill Wagman"One question, Rene, I see in your scripts you are storing username/password combinations.
I have used the storeUserConfig () command to create a WebLogicConfig.properties file and a WebLogicKey.properties file to avoid that issue.
Is there a reason you have not done this?"
No, what you did with the storeUserConfig, to prevent needing to store the unencrypted username
and password in your WLST scripts is good. One thing to note is that the key files are extremely sensitive
in that they allow any user to use the configuration file to authenticate as the user stored in the configuration
file. You should store the key files in a secure location so that only the authorized users have access to them (this
is also what you do with scripts that have unencrypted username and password in them). You probably have
an environment (operating system) in which only authorized users can reach the sensitive data. -
Powershell shutdown script issues
Hi Scripting Guys!
I'm working on a project to optimize school computers in my region(mainly boot/startup time). As all the students are local administrators it often results in them installing various programs, programs that more often than not, is set as a start-up program,
which obviously effects the start time.
So i decided to make a powershell script to go in and edit the registry for startup programs, with the intent of making it a shutdown script to be applied through a group policy.
But the script wont run.
Trying to run it manually works fine.
I've set execution policy to both all signed and remotesigned/unrestricted(i have signed the script though)
I've disabled the UAC as it gave me some issues during testing
I am a powershell rookie though so i'm sure i've missed some obvious mistake, either in the script or settings so i'm hoping you can assist me or point me in the right direction.
The script looks something like this:
Remove-Item -Path hklm:\Software\Microsoft\Windows\CurrentVersion\Run
New-Item -Path hklm:\Software\Microsoft\Windows\CurrentVersion\Run\ -ItemType Key
New-ItemProperty -Path hklm:\Software\Microsoft\Windows\CurrentVersion\Run\ -Value '"C:\Program Files\path to some driver.exe" -PropertyType String -Name "name of some driver"
bonus info:
i'm testing in a virtual inviroment using a Win2008r2 Domain controller with Win7 clients
From the clients, using rsop.msc, i can see the script, and the path, I can also see the attempt to start the script in eventviewer and it even says its finished about 2 seconds later. (rsop shows no last execution time)
Kind regards
Powershell rookieHi
The purpose of the script is not to install any of the drivers but rather starting them up(or something like that) like start only essential drivers like the anti-virus software and mousepad drivers for laptops. So basically the script is supposed to delete
the run folder in the registry database and then recreate it with only selected drivers.
I hope i'm making sense?
Regarding disabling all of first line security on my entire domain i'm not sure i follow? how will a shutdown script that edit the startup registry on my domain computers disable all that?
Thanks -
Using a shutdown script to save files to local sever
Hello,
I am writing a shutdown script which runs when the use shuts their computer down. The goal is to back up some user files to a local sever. I am wondering if the shutdown will be delayed until the file is uploaded to the server. The file is approx 1 - 2 gb
in size which would take a few minutes to send over to the server.
I have used gpedit.msc and linked the batch file I wish to run.
However, I have a few questions regarding this. Does windows wait for the batch file to finish executing before shutting down? If not,
is there a way to delay the shutdown long enough for the file to send?
For dev purposes I have experimented using a log off script (faster than constantly shutting off/turning on), however windows does not seem to want to wait and logs off before the btach file is finished executing. In the test batch script, I used the pause
command to test if it would wait for me to finish executing the file before it logged off, but it seems that it does not want to wait and just goes ahead and logs off before it is done.
The only work around I can think of is using a batch file which saves the files then turn off the computer
instead of a script being run at shutdown - this might be not a practical solution since I have to integrate this into several workstation computers. Also, some employees may forget to use the file to shut down. I am also not sure how keen my boss
would be for me to change the entire way everyone shuts down their computer (by running my batch file instead of the usual start->shutdown). If this is the only way to go about it I will discuss with him what needs to be done however I much prefer there
to be a script that automatically runs when they shut their computers off.
To wrap it up:
Using a shut down script, how do I delay the shutdown long enough for files to be saved to a local server? Will windows automatically wait for the batch script to finish executing before turning off?
Kind regards,
- StriderHello Strider,
It seems that you issue is related with windows client, I suggest that you could post it to:
https://social.technet.microsoft.com/Forums/windows/en-US/home?category=w7itpro%2Cw8itpro%2Cwindowsvistaitpro%2Cwindowsxpitpro%2Cwindowsintune
The current forum you post to is used to discuss general issues about developing applications for Windows.
Thanks for your understanding.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Installing application in shutdown script does not work
Hello,
I'm trying to organise the deployment of office 2013. I want to give users the choice between installation during startup and installation during shutdown of their computer.
Installation during startup works fine: installation starts and the user can use their computer and wait for the installation to finish in the background.
Installation initiated from a console window works fine as well.
However, installation using a shutdown script doesn't work as the installation command returns immediatly, the script ends and the computer shuts down.
I have changed the gpo script timeout setting.
In the powershell script, I execute the installation using "start-process" with the option "-wait". It seems like this command returns immediatly and the setup is never executed as it does not start logging the installation progress to
a local log file.
The shutdown script runs fine and it also logs its progress to a logfile on a network share so I'm sure the script actually runs and it has network access as well.
Any clues as to why the installation might fail during a shutdown script and work fine in other situations? Thanks!
I'm not sure if this is a gpo or an office 2013 deployment question. I'm thinking the environment during execution of a shutdown script might be different so that's why I'm asking my question here.Hi,
Based on your description, we can also try asking for suggestions in the scripting forum to see if they can provide a better solution.
The Official Scripting Guys Forum
http://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
TechNet Subscriber Support
If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback here.
Best regards,
Frank Shen -
Automatic startup/shutdown script - 3 Oracle Home
Hi All,
We have a server which has 3 Oracle Home - 8i/9i/10g.
So i am confused about configuring automatic startup/shutdown scripts.
Can you guys please let me know how to setup automatic startup/shutdown for these multiple Oracle Homes.
Thanks,
Kumar.Bellow is a HP-UX script that can help. Create three scripts like oracle8, oracle9, oracle10 with correct path values. and than decide the runlevels and create soft links for the scripts you created, for example;
Under /sbin/rc3.d
ln -s /sbin/init.d/oracle10 S999oracle10
Under /sbin/rc1.d and /sbin/rc2.d
ln -s /sbin/init.d/oracle10 C9oracle10
AUTOMATIC STARTUP/SHUTDOWN SCRIPT
$vi /sbin/init.d/oracle10
#!/sbin/sh
# NOTE: This script is not configurable! Any changes made to this
# scipt will be overwritten when you upgrade to the next
# release of HP-UX.
# WARNING: Changing this script in any way may lead to a system that
# is unbootable. Do not modify this script.
# NOTE:
# For ORACLE:
PATH=/usr/sbin:/usr/bin:/sbin
export PATH
ORA_HOME="/oracle/app/oracle/product/10.2.0"
ORA_OWNR="oracle"
rval=0
set_return() {
x=$?
if [ $x -ne 0 ]; then
echo "EXIT CODE: $x"
rval=1
fi
case $1 in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su - $ORA_OWNR -c "$ORA_HOME/bin/dbstart /oracle/app/oracle/product/10.2.0"
echo "OK DB started"
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su - $ORA_OWNR -c "$ORA_HOME/bin/dbshut /oracle/app/oracle/product/10.2.0"
echo "OK DB shutdown"
reload|restart)
$0 stop
$0 start
echo "usage: $0 {start|stop}"
esac
exit $rval -
Startup and Shutdown scripts for OCS 9.0.4 on Windows?
Hi,
I wanted to know if startup and shutdown scripts for OCS 9.0.4 on Windows are available.
I am thinking something like the ocsctl_sample scripts that OCS10g included.
I have checked the OCS 9.0.4 documentation and not a lot of information for the windows platform is avaiable.
Any information will be appreciated.
Thanks,
AnaThere is no scripts that comes with 9.0.4.
One possibility is to just write the commands you normally use in a batch-file, but note that then you have no checking, and if OCS runs on several machines you should have some checking for required processes etc.
We are using some scripts that does this, but I'm not shure where they came from, possibly from Metalink or from this forum. Try a search. Our scripts are changed quite a bit for our needs, but I might be able to find the original ones. -
Hello @all,
i would like to create a shutdown script, which depends on a working network connections.
So i've created a StartupItem script and placed it under /Library/StartupItems
The script works as expected when i called it via:
SystemStarter -D stop <NameOfMyScript>
The StartupParameters.plist of my script looks like this:
Requires = ("Disks","Network");
The problem now is that during shutdown procedure the network interfaces are already down.
Maybe this is done by launchd?
Any ideas/hints?
Thank you very much for your support.
CheersAFAIK, StartupItems are deprecated and such tasks should be migrated to Launchd.
In addition the Requires parameter only affects startup ordering and delays the task startup until the prerequisites are in place. I don't think it has any effect on shutdown actions.
That said, I don't know that launchd handles this any better - there is no dependency model in launchd - the script is supposed to handle that itself.
launchd does have a NetworkState flag that will keep your process alive as long as there's a network connection but I don't believe this will inform you that the network is going to go down - you may be able to detect when it's gone, but that doesn't sound like it'll solve your issue, either.
Therefore I think you need to consider what it is you're doing (or trying to do) and look for some other way of doing it. Typically the application/process would have to deal with a network issue so that's where I'd look. -
Which is better approach to manage sharepoint online - PowerShell Script with CSOM or Console Application with CSOM?
change in sharepoint scripts not require compilation but anything else?Yes, PowerShell is great, since you can quick change your code without compilation.
SP admin can write ps scripts without specific tools like Visual Studio.
With powershell you can use cmdlets,
which could remove a lot of code, for example restarting a service.
[custom.development] -
ECATT Script with SAPGUI Commando works in consolidation but not in prod.
Hi experts,
I created a eCATT script with commando SAPGUI Rec. In our consolidation system it works fine but when I try to let it run in production it is not working. User scripting is enabled (in options and in rz11). I am starting the script, the production system is getting opened but afterwards there happens nothing anymore. Also the scriptingsign in the bottom right corner is not active.
When I am running a script with TCD Rec, it works fine in production. Is there a difference between settings for scripting for TCD Rec and SAPGUI scripting? Do you have any idea which kind of influences there could be that make this difference between TCD Rec and SAPGUI Rec scripts?
Best regards and thank you in advance!
JanHello,
Ideally we should not run the ecatts in the production system as this would hamper the system environment or change systems.
Also check in RZ11 enter sapgui/user_scripting , here the values for the last three parameters are set to TRUE.
Thanks & Best regards,
Ajay
Maybe you are looking for
-
Can I install internal HD from PowerMac G4 in my Mac Pro?
I have an old, Quicksilver PowerMac G4. After purchasing a Mac Pro, I want to use the internal storage from the old one as a backup system for the new one. Can I physically install the my 3 internal drives from the G4 into the 3 open slots on my Ma
-
Why is the Macbook so heavy?
I am waiting for my new macbook to arrive and was just surfing around. Came across this review of a small Asus laptop http://www.pcper.com/article.php?aid=239 What's interesting is that it weighs only 4 pounds and has a built-in modem, card reader, e
-
Hello does anyone know about a report to compare Profit Center Accounting to General Ledger for a given period? Thank you
-
I'd like to organize all of the podcasts to which I subscribe into playlists or folders or anything else on my Ipad (32GB w/ 3G, iOS 4.2.1). I've searched this forum, the Ipad manual, Itunes help, etc. without success. Is there a way organize podcast
-
Can I use my 5s as a Bluetooth modem with my PC
Hi. I just got a 5s and want to be able to use it as a modem together with my PC if possible. I have two questions: 1) How do I set it up to act as a modem with the cable plugged in to my PC? 2) BT: I can pair it to the PC, but not see it in filemana