11-02-2012
Problem relocating to another state with Shutdown
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 -y -i1 (switch to single-user state)
but when I switch to another state like 2 or 3 or 4 or 5 can not, I get a message as follows after executing the command, for example:
# shutdown -y :(-i2 get the following message
shutdown: 2: bad runlevel
I checked those states and in my / etc / inittab.
Thank you for your response, good passing day.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,guys
I have a two CPUs server, and the system is linux2.4.6.
When the system shutdown,it will stop at the word Power Down.
I f I do not select the option "Symmtric multi-processing Support"
when I compile the kernel,system will shutdown automatic.But I
want to use two CPUs.
Anyone can... (1 Reply)
Discussion started by: lance
1 Replies
2. UNIX for Dummies Questions & Answers
Help please
I have today messed up my sudoers file which means no users can sudo in to our system.
I therefore need to do a restore of the file - no problems, I have a backup.
Now comes the problem.
The system is secure, and nobody seems to know the root password.
The system will not... (1 Reply)
Discussion started by: cobdeng
1 Replies
3. Post Here to Contact Site Administrators and Moderators
I posted a question regarding the address of the USB ports on an HP computer running SCO Unix. My post does not appear on the "Unix for Dummies Q&A" page, but is burried somewhere and the only way I can view it is to do a search for the title of the post. Could you relocate my post to the UFD Q&A... (2 Replies)
Discussion started by: Don48
2 Replies
4. Solaris
My 2GB /export/home/ directory is almost 100% full
df -k | grep /export/home
/dev/vx/dsk/rootdg/vl73 2031711 1951009 19751 99% /export/home
I intend to relocate it to a different 4GB filesystem late at night when there is no user on the system.
How do I go... (3 Replies)
Discussion started by: Msororaji
3 Replies
5. UNIX for Dummies Questions & Answers
Hi, i have sco openserver 5.0.6 but have a problem with shutdown or reboot commands.
The string I use is "shutdown -g0 -y" but the system just hangs on "The sytem is down" . I used to get a "Safe to turn of" but now nothing. Same with "reboot" the sytem just freezes.
Any suggestions? (1 Reply)
Discussion started by: VTechman
1 Replies
6. Solaris
I have a sparc T1 server (I know its old) running Solaris 8, which we use for testing. It has been very slow in response- prompt takes couple of minutes to come up, so I decided to reboot the server but I can reboot it, it is giving following errors when I try to shutdown it down.
root@deva:/#... (3 Replies)
Discussion started by: Tirmazi
3 Replies
7. Solaris
Hi Experts,
I am facing problem while creating a concatenated volume. I would like to decribe the process I did:
1- I created state data base with slice1,slice2,slice3,slice4,slice5,slice6 with command:
#metadb -a -f slice1 slice2 ........ slice6
From metastas, everything seems to... (6 Replies)
Discussion started by: naw_deepak
6 Replies
8. Red Hat
Friends ,
I create two script for oracle database startup and shutdown .
$ cat start.sh
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
ORACLE_OWNER=oracle
su - oracle << !
sqlplus / as sysdba << !
startup
$ cat stop.sh
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1... (1 Reply)
Discussion started by: shipon_97
1 Replies
9. Shell Programming and Scripting
Hello Everyone,
I have a process that should be always running. Unfortunately, this process is getting down almost every 10 minutes. I want to make a script that verify the state of this process: If the process is up, the script shouldn't do nothing and if it's down he should run it.
Can... (3 Replies)
Discussion started by: adilyos
3 Replies
10. Programming
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)
Discussion started by: hakermania
9 Replies
LEARN ABOUT SUNOS
shutdown
shutdown(1M) System Administration Commands shutdown(1M)
NAME
shutdown - shut down system, change system state
SYNOPSIS
/usr/sbin/shutdown [-y] [-g grace-period] [-i init-state] [message]
DESCRIPTION
shutdown is executed by the super user to change the state of the machine. In most cases, it is used to change from the multi-user state
(state 2) to another state.
By default, shutdown brings the system to a state where only the console has access to the operating system. This state is called single-
user.
Before starting to shut down daemons and killing processes, shutdown sends a warning message and, by default, a final message asking for
confirmation. message is a string that is sent out following the standard warning message "The system will be shut down in ..." If the
string contains more than one word, it should be contained within single (') or double (") quotation marks.
The warning message and the user provided message are output when there are 7200, 3600, 1800, 1200, 600, 300, 120, 60, and 30 seconds
remaining before shutdown begins. See EXAMPLES.
System state definitions are:
state 0 Stop the operating system.
state 1 State 1 is referred to as the administrative state. In state 1 file systems required for multi-user operations are mounted,
and logins requiring access to multi-user file systems can be used. When the system comes up from firmware mode into state
1, only the console is active and other multi-user (state 2) services are unavailable. Note that not all user processes are
stopped when transitioning from multi-user state to state 1.
state s, S State s (or S) is referred to as the single-user state. All user processes are stopped on transitions to this state. In the
single-user state, file systems required for multi-user logins are unmounted and the system can only be accessed through
the console. Logins requiring access to multi-user file systems cannot be used.
state 5 Shut the machine down so that it is safe to remove the power. Have the machine remove power, if possible. The rc0 procedure
is called to perform this task.
state 6 Stop the operating system and reboot to the state defined by the initdefault entry in /etc/inittab. The rc6 procedure is
called to perform this task.
OPTIONS
-y Pre-answer the confirmation question so the command can be run without user intervention.
-g grace-period Allow the super user to change the number of seconds from the 60-second default.
-i init-state If there are warnings, init-state specifies the state init is to be in. By default, system state `s' is used.
EXAMPLES
Example 1: Using shutdown
In the following example, shutdown is being executed on host foo and is scheduled in 120 seconds. The warning message is output 2 minutes,
1 minute, and 30 seconds before the final confirmation message.
example# shutdown -i S -g 120 "===== disk replacement ====="
Shutdown started. Tue Jun 7 14:51:40 PDT 1994
Broadcast Message from root (pts/1) on foo Tue Jun 7 14:51:41...
The system will be shut down in 2 minutes
===== disk replacement =====
Broadcast Message from root (pts/1) on foo Tue Jun 7 14:52:41...
The system will be shut down in 1 minutes
===== disk replacement =====
Broadcast Message from root (pts/1) on foo Tue Jun 7 14:53:41...
The system will be shut down in 30 seconds
===== disk replacement =====
Do you want to continue? (y or n):
FILES
/etc/inittab controls process dispatching by init
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
boot(1M), halt(1M), init(1M), killall(1M), reboot(1M), ufsdump(1M), init.d(4), inittab(4), nologin(4), attributes(5)
NOTES
When a system transitions down to the S or s state, the /etc/nologin file (see nologin(4)) is created. Upon subsequent transition to state
2 (multi-user state), this file is removed by a script in the /etc/rc2.d directory.
SunOS 5.10 9 May 2001 shutdown(1M)