1838120 Members
4311 Online
110124 Solutions
New Discussion

rebooting and swinstall

 
Joel Shank
Valued Contributor

rebooting and swinstall

Hello Everyone!

I need some clarification on using the /var/adm/sw/defaults file to change the swinstall reboot command to shutdown. I need swinstall to perform a shutdown instead of going directly to reboot. The documentation is unclear on how this is specified.

First: Can I put spaces around the equal sign, for example: swagent.reboot_cmd = /sbin/shutdown

Second: Do I need to specify the shutdown options to perform a reboot, for example: swagent.reboot_cmd = /sbin/shutdown -ry 0

Do I need to put quotes around the command?

I am hoping that someone out there has used this option
of swinstall and can tell me how it is specified.

Thanks in advance,
JLS
3 REPLIES 3
CHRIS_ANORUO
Honored Contributor

Re: rebooting and swinstall

You don't need to put quotes for the command to be parsed and read. Check also /usr/lib/sw/sys.defaults and search for reboot.
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Joel Shank
Valued Contributor

Re: rebooting and swinstall

Thanks, Chris

I did check the sys.defaults, but it does not show anything with arguments. I have solved the problem, but
not like I was hoping to. For anyone who cares, this is
what I think was happening:
First, it looks like no spaces around equal sign.
Second, shutdown must run under the root filesystem.
So, I wrote a script that switches to the root filesystem and then issues shutdown -ry 0. Everything now works fine.
Carsten Krege
Honored Contributor

Re: rebooting and swinstall

There is a problem that you cannot simply modify the "reboot" command to a "shutdown" command. I believe the problem was that the shutdown command kills itself.

This way it should work:

Create a shutdown script and modify the defaults file to use the script. Then stop and restart swagentd.
For example,
1. Create the following script called /tmp/myshut:
#!/sbin/sh
/sbin/shutdown -ry 0
2. Modify the defaults file to use script:
swagent.reboot_cmd = /tmp/myshut
3. swagentd -r

Carsten
-------------------------------------------------------------------------------------------------
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG