Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shutdown ; boot -s 1

Status
Not open for further replies.

jad

Programmer
Apr 7, 1999
1,195
GB
we work on Solaris Intel.

I was looking into this problem for some of our users at some sites:

We have UPS's connected to some of our servers ...
if we reboot from solaris the UPS effectively unplugs itself from the mains, giving us just over an hour before the battery powers down ...
it will then power back up after about an hour, and solaris will be fine ... however this isn't the best solution.

The easiest way around this that we've found is to shutdown the machine, power the computer and the UPS off, then power them both back on.

for full back-ups i want the user to go to single user mode ...

the users know nothing about solaris, except what i tell them, and if i can make it 'risk free' i will try.

QUESTION:
i want to be able to shutdown and when the machine powers up to have it go into single user mode ... is this possible in one command/set of scripts i can write that can be run as one command?

Jon
 
My first question would be - Why do you need to go to single-user mode for a full backup?

Greg.
 
level 0 dump ... if i want to restore files i'd rather that noone was actually writing to them at the time of the backup :)

we do incremental during the week, these are usually only users files, so if they get damaged cos people are actively using them at midnight (not likely, but possible with some programs) then that is there own fault. also the files stay around a while so we can get different versions happily.

however for level 0 dump i really _really_ want the system stable.

this only happens every 10 weeks, and i can usually run through with people on the phone what to do, and prompt them for responses, but i'd like to go home on time some days.

Jon
 
Is it an option to do it at say, 4:00am (in cron), or is your server being used 24/7

Sorry for all the questions & lack of help at this point :-(

Greg.
 
there is noone in the building at 4:00 am :)

i want it in single user mode ... :)
 
shutdown -i1 -g0 -y

will do what you want, then a further shutdown -i6 -g0 -y will restart the system to the default state set in /etc/inittab, usually 3.

Hope this helps.
 
Fair enough .. you've made your point and I'll stop now :)

I still think you're making extra work for yourself though!

Regards,

Greg.
 
wait a sec ... i want to power off ... shutdown -iS doesn't do that ... it's just the same as 'init S'

what i really want is 'halt -- -s' but that doesn't work.

as it happens, when i reboot in single user mode i can just 'exit' to get back to level 3 ...
 
Rather than helping you with this, I'm going to just ask a wuestion instead ;-)

Have you looked into the UPS problem instead? It doesn't seem like normal behaviour for a UPS & if you could fix it, then you wouldn;t have the shutdown problem :)

Most UPS's have software to manage them (eg. PowerChute for APC UPSs) which might help.
One by one, the penguins steal my sanity.
 
i'm using apcupsd, on a Smart-UPS

i'm not going to try to debug/work my way through someone elses source code, and i'm assuming that it has something to do specifically when Solaris shuts down, cos the code is also for Linux.

the only problem is with a 'reboot' ... i.e. a machine not actually halting, but sending a similar signal (i can only guess this) when solaris shuts down ...

it doesn't seem to do it if the UPS software isn't installed, and i don't have time to work out/fix the specific problem at the moment, (Building LIM systems on your own is a bit of a big work-load) but i know that this work around of halting the machine works ...

i need a reboot, not an init S because i want the partitions unmounted and all samba shares killed off happily ... a reboot -- -s does this, except for the UPS thing.

was just wondering if anyone knew how :)
 
I concur about getting to the root of the problem, but for what you requested you can have a script change inittab to change the default run level.
 
was wondering if there was a prettier way to do this ... plus if you 'exit' from (S)ystem mode it won't know where to go to, unless ... hmm ... it's just not pretty or simple ...

Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top