SHUTDOWN(2) BSD System Calls Manual SHUTDOWN(2)NAME
shutdown -- shut down part of a full-duplex connection
shutdown(int s, int how);
The shutdown() call causes all or part of a full-duplex connection on the socket associated with s to be shut down. If how is 0, further
receives will be disallowed. If how is 1, further sends will be disallowed. If how is 2, further sends and receives will be disallowed.
A 0 is returned if the call succeeds, -1 if it fails.
The call succeeds unless:
[EBADF] S is not a valid descriptor.
[ENOTSOCK] S is a file, not a socket.
[ENOTCONN] The specified socket is not connected.
SEE ALSO connect(2), socket(2)HISTORY
The shutdown() function call appeared in 4.2BSD.
4.2 Berkeley Distribution June 4, 1993 4.2 Berkeley Distribution
Check Out this Related Man Page
SHUTDOWN(2) Linux Programmer's Manual SHUTDOWN(2)NAME
shutdown - shut down part of a full-duplex connection
int shutdown(int sockfd, int how);
The shutdown() call causes all or part of a full-duplex connection on the socket associated with sockfd to be shut down. If how is
SHUT_RD, further receptions will be disallowed. If how is SHUT_WR, further transmissions will be disallowed. If how is SHUT_RDWR, further
receptions and transmissions will be disallowed.
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
EBADF sockfd is not a valid descriptor.
The specified socket is not connected.
sockfd is a file, not a socket.
POSIX.1-2001, 4.4BSD (the shutdown() function call first appeared in 4.2BSD).
The constants SHUT_RD, SHUT_WR, SHUT_RDWR have the value 0, 1, 2, respectively, and are defined in <sys/socket.h> since glibc-2.1.91.
SEE ALSO connect(2), socket(2), socket(7)COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2008-12-03 SHUTDOWN(2)
I'm teaching myself UNIX, so bear with me! :)
I created two user accounts on my box. One day I shut down the system using "shutdown -h 1". The system shut down cleanly.
A few days I rebooted the box, no problem.
But root is the only account that can log in. The other 2 user accounts... (10 Replies)
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)
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:
assign_file asql a.sql 1... (15 Replies)
Hi, i would like to create a script that shuts down the system if the power fails, basicly the solaris box would load the script at startup.
Ping 192.168.1.100 every 20 secs
If cannot get responce 3 times in a row send init 0 to the system.
Simple but effective, as 192.168.100.1 wont be on... (39 Replies)
Has anyone implemented or have suggestions on how to shutdown many remote unix/linux servers from a single script initiated from 1 server?
I need this to execute in parallel as time is not on my side. Our ups is sadly underrated and will die in approximately 15 minutes. (There is not... (10 Replies)
My AIX (5.3) machine is getting shutdown automatically.
After restarting the machine, its screen goes black and it shows in green:
Unmounting the file system....
bringing down the network interface en0 ln0.......halt
and system shutdowns.
Can... (8 Replies)
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)
I've got a UPS connected to my Solaris 10 machine and I'm planning to run containers/zones on there.
At the moment if the UPS agent sends the signal to the solaris machine to shutdown, all the apps shutdown gracefully and then the host goes down.
If I setup containers for the apps, does... (9 Replies)
I've got critical patching this weekend on 6 HP UX machines, back to back and the customer has requested to shutdown, and halt the machines and to bring it up at a later period. The thing is the servers are located offshore and we are just the support team. I have a special login thru a console... (16 Replies)
Hi to all.
My first message here, but i following you via twitter feed from many time...
I need to delay 5-10 seconds the shutdown command executed when the user click on the power off/reboot in their session or at login screen.
I need that because i have in the background a... (18 Replies)
How are you, good afternoon, I do not speak and I do not write in English, and I'm iniciandome in unix / linux on my own, I am using the google translator, my question is this, know what are the shutdown command to change user State:
# shutdown -y -g0 -i0 (completely off my system)
# shutdown... (8 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)
I have a backup script that runs an rsync backup to an external drive. I use the script frequently on Windows and Linux and have installed it on a Mac. The script has an option to run shutdown after the backup has completed. Since backup can take hours to run, this is an option that is... (10 Replies)