[Discuss] Issuing the 'sync' command more than once (and a tangent on how not to run a high-tech company)

Richard Pieri richard.pieri at gmail.com
Sat Jun 16 20:54:05 EDT 2012


On 6/16/2012 3:34 PM, MBR wrote:
> Even though the OS guys knew that typing 'sync', waiting about 5
> seconds, then typing 'halt' was really all that was necessary, most of
> the programmers writing application level code didn't know that.

As Jerry noted, some early Unixes had issues.  Invoking halt after sync 
is a race condition regardless of how many sync invocations are used. 
Three invocations of sync -- "sync;sync;sync;halt" as a single shell 
command -- was considered sufficient for nearly every occasion.  The 
exceptions could then be relegated to incompetent users waiting until 
literally the last milliseconds to save their work or act of $DEITY, 
take your pick.

-- 
Rich P.




More information about the Discuss mailing list