SHUTDOWNHOOK_ESTABLISH(9) BSD Kernel Developer's Manual SHUTDOWNHOOK_ESTABLISH(9)NAME
shutdownhook_establish, shutdownhook_disestablish -- add or remove a shutdown hook
SYNOPSIS
void *
shutdownhook_establish(void (*fn)(void *), void *arg);
void
shutdownhook_disestablish(void *cookie);
DESCRIPTION
The shutdownhook_establish API is deprecated.
The shutdownhook_establish() function adds fn to the list of hooks invoked by doshutdownhooks(9) at shutdown. When invoked, the hook func-
tion fn will be passed arg as its only argument.
The shutdownhook_disestablish() function removes the hook described by the opaque pointer cookie from the list of hooks to be invoked at
shutdown. If cookie is invalid, the result of shutdownhook_disestablish() is undefined.
Shutdown hooks should be used to perform one-time activities that must happen immediately before the kernel exits. Because of the environ-
ment in which they are run, shutdown hooks cannot rely on many system services (including file systems, and timeouts and other interrupt-
driven services), or even basic system integrity (because the system could be rebooting after a crash).
RETURN VALUES
If successful, shutdownhook_establish() returns an opaque pointer describing the newly-established shutdown hook. Otherwise, it returns
NULL.
EXAMPLES
It may be appropriate to use a shutdown hook to disable a device that does direct memory access, so that the device will not try to access
memory while the system is rebooting.
It may be appropriate to use a shutdown hook to inform watchdog timer hardware that the operating system is no longer running.
SEE ALSO doshutdownhooks(9)BUGS
The names are clumsy, at best.
BSD May 14, 2009 BSD
Check Out this Related Man Page
SHUTDOWNHOOK_ESTABLISH(9) BSD Kernel Developer's Manual SHUTDOWNHOOK_ESTABLISH(9)NAME
shutdownhook_establish, shutdownhook_disestablish -- add or remove a shutdown hook
SYNOPSIS
void *
shutdownhook_establish(void (*fn)(void *), void *arg);
void
shutdownhook_disestablish(void *cookie);
DESCRIPTION
The shutdownhook_establish API is deprecated.
The shutdownhook_establish() function adds fn to the list of hooks invoked by doshutdownhooks(9) at shutdown. When invoked, the hook func-
tion fn will be passed arg as its only argument.
The shutdownhook_disestablish() function removes the hook described by the opaque pointer cookie from the list of hooks to be invoked at
shutdown. If cookie is invalid, the result of shutdownhook_disestablish() is undefined.
Shutdown hooks should be used to perform one-time activities that must happen immediately before the kernel exits. Because of the environ-
ment in which they are run, shutdown hooks cannot rely on many system services (including file systems, and timeouts and other interrupt-
driven services), or even basic system integrity (because the system could be rebooting after a crash).
RETURN VALUES
If successful, shutdownhook_establish() returns an opaque pointer describing the newly-established shutdown hook. Otherwise, it returns
NULL.
EXAMPLES
It may be appropriate to use a shutdown hook to disable a device that does direct memory access, so that the device will not try to access
memory while the system is rebooting.
It may be appropriate to use a shutdown hook to inform watchdog timer hardware that the operating system is no longer running.
SEE ALSO doshutdownhooks(9)BUGS
The names are clumsy, at best.
BSD May 14, 2009 BSD
Hi,
We encounter problem while rebooting the sco 5.06 open server.
When I reboot the server by shutdown -g0 -y -i6 comand the following message is showing
Shutdown Proceeding. Please Wait...........................
/etc/shutdown : 4324 Hangup
At this stage the system takes 30 sec and... (1 Reply)
ok, i know the syntax that goes along with the Shutdown command... but my box never wants to ... well... shutdown.. it only halts, kills all the process's, stalls the comp to a complete stop, but does actually kill the monitor and/or shut off the physical computer. it will reboot properly though,... (3 Replies)
Hello,
How do you make changes to the /etc/system file go into effect without rebooting? BTW, I'm referencing the Solaris 8 OS.
Thanks.
Roy (2 Replies)
Hi,
I am a sysadmin. During long weekends i need to turn off all machines in my lab. Is it possible to shutdown systems using ip address without using ssh.
i read somewhere that shutdown -m "IPADDR" may work. However it seems its a windows specific command.
So my question is how do i... (11 Replies)
Hi there,
I'm currently writing a program/module which makes use of the Linux Security Modules (LSM), which provide hooks for some security .
The bad thing about it is: The function to set the hook to the LSM is not exported. That means, I can't just write a loadable kernel module, but have to... (3 Replies)
I am having exactly the same problem with https://www.unix.com/programming/129264-application-cleanup-during-linux-shutdown.html but the thread is old and closed. The only difference is that I use sigaction() instead of signal(), which is recommended, as far as I know.
This is my code:
... (9 Replies)