Difference between revisions of "HowTo Shutdown NST Using A USB Flash Drive Install For Relocation"
From NST Wiki
Jump to navigationJump to search (→Preparing NST For Relocation Using: "/sbin/halt.local") |
|||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Preparing NST For Relocation Using: "/sbin/halt.local" == | == Preparing NST For Relocation Using: "/sbin/halt.local" == | ||
− | If you are using a "'''USB Flash Drive'''" hard disk installation, the following file: "'''/sbin/halt.local'''" can be created so that the "'''USB Flash Drive'''" can be relocated to any other system that supports booting a "'''USB Flash Drive'''". | + | If you are using a "'''USB Flash Drive'''" hard disk installation, the following file: "'''/sbin/halt.local'''" (contents are shown in the depiction below) can be created so that the "'''USB Flash Drive'''" can be relocated to any other system that supports booting from a "'''USB Flash Drive'''". During an '''NST''' system shutdown, this file will be executed. It uses the '''NST''' script: "'''[http://nst.sourceforge.net/nst/docs/scripts/nstboot.html nstboot]'''" with the "'''--move'''" option so that hardware specific information will be removed and recreated by "'''[http://en.wikipedia.org/wiki/Udev udev]'''" during the next system boot on potentially an entirely different machine. |
− | * Note: The file: "/sbin/halt.local" if found will be | + | * '''Note 1:''' The file: "'''/sbin/halt.local'''" if found will be executed by the script: "'''/etc/init.d/halt'''" during the '''shutdown''' process of an '''NST''' system. |
<pre class="programListing"> | <pre class="programListing"> | ||
Line 27: | Line 27: | ||
fi | fi | ||
</pre> | </pre> | ||
+ | |||
+ | Copy the "'''[http://en.wikipedia.org/wiki/Bash Bash]'''" script contents above and create the file: "'''/sbin/halt.local'''" | ||
+ | |||
+ | * '''Note 2:''' Make sure that the script: "'''/sbin/halt.local'''" is executable: | ||
+ | <div class="screen"> | ||
+ | <div class="userInput"><span class="prompt">[root@probe ~]# </span>chmod +x /sbin/halt.local</div> | ||
+ | <pre class="computerOutput"> | ||
+ | [root@probe ~]# | ||
+ | </pre> | ||
+ | </div> |
Latest revision as of 20:05, 26 October 2009
Preparing NST For Relocation Using: "/sbin/halt.local"
If you are using a "USB Flash Drive" hard disk installation, the following file: "/sbin/halt.local" (contents are shown in the depiction below) can be created so that the "USB Flash Drive" can be relocated to any other system that supports booting from a "USB Flash Drive". During an NST system shutdown, this file will be executed. It uses the NST script: "nstboot" with the "--move" option so that hardware specific information will be removed and recreated by "udev" during the next system boot on potentially an entirely different machine.
- Note 1: The file: "/sbin/halt.local" if found will be executed by the script: "/etc/init.d/halt" during the shutdown process of an NST system.
#! /bin/bash # Source function library... . "/etc/init.d/functions"; echo -n "Preparing NST for relocation:"; # # Prepare for move on each shutdown... /usr/bin/nstboot --move; if [ ${?} -eq 0 ]; then echo_success; # signal success... echo; exit 0; else echo_failure; # signal failure... echo; exit 1; fi
Copy the "Bash" script contents above and create the file: "/sbin/halt.local"
- Note 2: Make sure that the script: "/sbin/halt.local" is executable:
[root@probe ~]# chmod +x /sbin/halt.local
[root@probe ~]#