Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Script to force Oracle database shutdown when shutdown immediate does not work Post 302402772 by Scott on Wednesday 10th of March 2010 03:20:17 PM
Old 03-10-2010
No problems, I've renamed the thread Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Shutdown script

Hi Guys, I want to execute few of my bash script, so that whenever someone calls shutdown now -r command, I want my script to execute first before shutting down. Any help please????? I've just started playing with the unix system, so far its been brilliant.... (10 Replies)
Discussion started by: alpha_manic
10 Replies

2. UNIX for Dummies Questions & Answers

A script for shutdown

I want to make a script to shutdown a unixware computer from other user then root. In Sco version i use "as root" but in the unixware i don't know. Please help me. 10x (12 Replies)
Discussion started by: kelu
12 Replies

3. HP-UX

Shutdown script

Hi, I am on Alpha Server with HP Tru64 system. I wish to setup shutdown to automatically and cleanly shutdown informix during the shutting down of the system. Ie. I was trying to use rc0.d to do this but failed. Has anyone tried doing this before? I already have the script and linked it to... (0 Replies)
Discussion started by: kingsto88
0 Replies

4. UNIX for Advanced & Expert Users

Capturing Oracle Shutdown error

Hi, Iam calling 3 sql scripts through one shell script 'rmia.sh'. Till now this was working fine, but last time while calling the SQL scripts, Oracle was down. But amazingly the exit status was '0' (success)!!! Below is the shell code: #!/usr/bin/ksh -x assign_file asql a.sql 1... (15 Replies)
Discussion started by: ganapati
15 Replies

5. BSD

Battery Empty -> force shutdown

hi Howto force shutdown on the notebook with freeBSD before battery is empty? (3 Replies)
Discussion started by: ccc
3 Replies

6. Shell Programming and Scripting

Oracle DB Start shutdown scripts

Hi, We have a requirement wherein we do not want to share the Oracle DB sys and system passwords to be shared with the support desk. But they will be responsible for starting/shuting down the Database. Is it possible to write a shell script which will read the sys and system passwords from a... (0 Replies)
Discussion started by: narayanv
0 Replies

7. Solaris

shutdown -y -i5 -g0 DOESN'T work

hello, The command above seems not working on my solaris 8/9 sparc machines. a. resulted to the ff below when I instead use "shutdown" only. Broadcast Message from root (pts/1) on "hostname" date.. The system "hostname" will be shut down in 30 seconds THE SYSTEM bdosg IS BEING SHUT... (4 Replies)
Discussion started by: lhareigh890
4 Replies

8. Shell Programming and Scripting

db shutdown script

I am going to create shutdown database script. We have dabase shutdown script. But i need take dabase which online and make it down. I got user id which needs to dabase to down ID=`ps -ef | grep -i pmon | grep -v grep | awk '{print $1}'` ( got orace side DB=`ps -ef | grep -i pmon |... (1 Reply)
Discussion started by: allwin
1 Replies

9. Shell Programming and Scripting

Help required for Oracle database shutdown script conversion from shell to perl

Please tell me how to convert below program from shell script to perl. Same commands need to use in shutdown, just need program help for startup. export ORACLE_BASE=/home/oracle1 lsnrctl start lndb1 sqlplus '/ as sysdba' startup; (2 Replies)
Discussion started by: learnbash
2 Replies

10. Solaris

Shutdown Oracle DB on SunOS Cluster

Hi, I've this Oracle database version: Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production Oracle is install in a SunOS DBSERVER1 5.11 11.2 sun4v sparc sun4v cluster (Not RAC environment) DBSERVER1 is node active and DBSERVER2 is node inactive ... (4 Replies)
Discussion started by: db_senior
4 Replies
KTHREAD(9)						   BSD Kernel Developer's Manual						KTHREAD(9)

NAME
kthread_start, kthread_shutdown, kthread_add, kthread_exit, kthread_resume, kthread_suspend, kthread_suspend_check -- kernel threads SYNOPSIS
#include <sys/kthread.h> void kthread_start(const void *udata); void kthread_shutdown(void *arg, int howto); void kthread_exit(void); int kthread_resume(struct thread *td); int kthread_suspend(struct thread *td, int timo); void kthread_suspend_check(struct thread *td); #include <sys/unistd.h> int kthread_add(void (*func)(void *), void *arg, struct proc *procp, struct thread **newtdpp, int flags, int pages, const char *fmt, ...); int kproc_kthread_add(void (*func)(void *), void *arg, struct proc **procptr, struct thread **tdptr, int flags, int pages, char * procname, const char *fmt, ...); DESCRIPTION
In FreeBSD 8.0, the older family of kthread_*(9) functions was renamed to be the kproc_*(9) family of functions, as they were previously mis- named and actually produced kernel processes. This new family of kthread_*(9) functions was added to produce real kernel threads. See the kproc(9) man page for more information on the renamed calls. Also note that the kproc_kthread_add(9) function appears in both pages as its functionality is split. The function kthread_start() is used to start ``internal'' daemons such as bufdaemon, pagedaemon, vmdaemon, and the syncer and is intended to be called from SYSINIT(9). The udata argument is actually a pointer to a struct kthread_desc which describes the kernel thread that should be created: struct kthread_desc { char *arg0; void (*func)(void); struct thread **global_threadpp; }; The structure members are used by kthread_start() as follows: arg0 String to be used for the name of the thread. This string will be copied into the td_name member of the new threads' struct thread. func The main function for this kernel thread to run. global_threadpp A pointer to a struct thread pointer that should be updated to point to the newly created thread's thread structure. If this variable is NULL, then it is ignored. The thread will be a subthread of proc0 (PID 0). The kthread_add() function is used to create a kernel thread. The new thread runs in kernel mode only. It is added to the process specified by the procp argument, or if that is NULL, to proc0. The func argument specifies the function that the thread should execute. The arg argu- ment is an arbitrary pointer that is passed in as the only argument to func when it is called by the new thread. The newtdpp pointer points to a struct thread pointer that is to be updated to point to the newly created thread. If this argument is NULL, then it is ignored. The flags argument may be set to RFSTOPPED to leave the thread in a stopped state. The caller must call sched_add() to start the thread. The pages argument specifies the size of the new kernel thread's stack in pages. If 0 is used, the default kernel stack size is allocated. The rest of the arguments form a printf(9) argument list that is used to build the name of the new thread and is stored in the td_name member of the new thread's struct thread. The kproc_kthread_add() function is much like the kthread_add() function above except that if the kproc does not already exist, it is cre- ated. This function is better documented in the kproc(9) manual page. The kthread_exit() function is used to terminate kernel threads. It should be called by the main function of the kernel thread rather than letting the main function return to its caller. The kthread_resume(), kthread_suspend(), and kthread_suspend_check() functions are used to suspend and resume a kernel thread. During the main loop of its execution, a kernel thread that wishes to allow itself to be suspended should call kthread_suspend_check() passing in curthread as the only argument. This function checks to see if the kernel thread has been asked to suspend. If it has, it will tsleep(9) until it is told to resume. Once it has been told to resume it will return allowing execution of the kernel thread to continue. The other two functions are used to notify a kernel thread of a suspend or resume request. The td argument points to the struct thread of the kernel thread to suspend or resume. For kthread_suspend(), the timo argument specifies a timeout to wait for the kernel thread to acknowledge the suspend request and suspend itself. The kthread_shutdown() function is meant to be registered as a shutdown event for kernel threads that need to be suspended voluntarily during system shutdown so as not to interfere with system shutdown activities. The actual suspension of the kernel thread is done with kthread_suspend(). RETURN VALUES
The kthread_add(), kthread_resume(), and kthread_suspend() functions return zero on success and non-zero on failure. EXAMPLES
This example demonstrates the use of a struct kthread_desc and the functions kthread_start(), kthread_shutdown(), and kthread_suspend_check() to run the bufdaemon process. static struct thread *bufdaemonthread; static struct kthread_desc buf_kp = { "bufdaemon", buf_daemon, &bufdaemonthread }; SYSINIT(bufdaemon, SI_SUB_KTHREAD_BUF, SI_ORDER_FIRST, kthread_start, &buf_kp) static void buf_daemon() { ... /* * This process needs to be suspended prior to shutdown sync. */ EVENTHANDLER_REGISTER(shutdown_pre_sync, kthread_shutdown, bufdaemonthread, SHUTDOWN_PRI_LAST); ... for (;;) { kthread_suspend_check(bufdaemonthread); ... } } ERRORS
The kthread_resume() and kthread_suspend() functions will fail if: [EINVAL] The td argument does not reference a kernel thread. The kthread_add() function will fail if: [ENOMEM] Memory for a thread's stack could not be allocated. SEE ALSO
kproc(9), SYSINIT(9), wakeup(9) HISTORY
The kthread_start() function first appeared in FreeBSD 2.2 where it created a whole process. It was converted to create threads in FreeBSD 8.0. The kthread_shutdown(), kthread_exit(), kthread_resume(), kthread_suspend(), and kthread_suspend_check() functions were intro- duced in FreeBSD 4.0 and were converted to threads in FreeBSD 8.0. The kthread_create() call was renamed to kthread_add() in FreeBSD 8.0. The old functionality of creating a kernel process was renamed to kproc_create(9). Prior to FreeBSD 5.0, the kthread_shutdown(), kthread_resume(), kthread_suspend(), and kthread_suspend_check() functions were named shutdown_kproc(), resume_kproc(), shutdown_kproc(), and kproc_suspend_loop(), respectively. BSD
January 26, 2009 BSD
All times are GMT -4. The time now is 12:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy