NetAdminTools.com
 
Categories:
GNU/Linux | Homebrew designs | Perl | Ruby | Administration | Backup/Recovery | Bugs/Fixes | Certification | Database | Email | File/Print | Hardware | Information Grab Bag | Interoperability | GNU/Linux ABCs | Monitoring | Name Resolution | Network Services | Networking | Remote Control | Security | Desktop | Web | BSD | Solaris | GIAGD | ERP | REALbasic

Last 30 Days | Last 60 Days | Last 90 Days | All Articles | RSS


Categories:
·GNU/Linux
·Homebrew designs
·Perl
·Ruby
·Administration
·Backup/Recovery
·Bugs/Fixes
·Certification
·Database
·Email
·File/Print
·Hardware
·Information Grab Bag
·Interoperability
·GNU/Linux ABCs
·Monitoring
·Name Resolution
·Network Services
·Networking
·Remote Control
·Security
·Desktop
·Web
·BSD
·Solaris
·GIAGD
·ERP
·REALbasic
·All Categories


Sync Sync Halt
Topic:GNU/Linux   Date: 2003-07-28
Printer Friendly: Print   Mobile View: mobile

spacerspacer
<<  <   >  >>

Subject

Urbana used to work with a guy who routinely shut down GNU/Linux by typing:

sync
sync
halt

That just sounded plain crazy. Why not use shutdown? Well, we just figured he was just a little old-school. The command appeared to work (manpage for sync, manpage for halt).

Now, our robocoop is running a giagd system, based on uClibc to run the chicken cam. It is supposed to be really hot today, so Agatha wanted to shut down the system so it didn't bake to much. What did she find with the default uClibc development filesystem snapshot?

u-1@srv-1 u-1 $ ssh root@crackers
[root@crackers root]# shutdown -h now
-sh: shutdown: command not found
[root@crackers root]# sync
[root@crackers root]# sync
[root@crackers root]# halt
[root@crackers root]# Connection to crackers closed by remote host.
Connection to crackers closed.
u-1@srv-1 u-1 $

The crazy old UNIX guy wasn't so crazy after all. There is a lot of chatter about sync sync halt in the news groups. Dennis Ritchie posted:

From: Dennis Ritchie (dmr_AT_bell-labs.com)
Subject: Re: why sync twice?" (was Re: PDP-11 emulation and Unix v7)
Newsgroups: alt.folklore.computers
Date: 1999/05/12
markh_AT_usai.asiainfo.com (and previous askers of the question) wrote:
> 
> Sarr J. Blumson  wrote:
> : Just run "sync" twice and shut if off IIRC.  fsck would run when you rebooted,
> : but it wouldn't find any problems and the disks were small...
> 
> I was always curious why the unix manuals would always recomment
>         "sync; sync; halt"
> 
> My mentor of sorts (this was in 1984) had worked on the Nixdorf
> unix port and said it was unnecessary.  "If you don't trust it
> the first time, what makes you think it's going to work the
> second time?"
> 
> Anything I missed?
If you actually typed "sync; sync; halt" then I can see the possible
timing issue.  However, if you were told to type "sync" and then do it
again, this had to do with giving you a chance to ponder whether
you remembered to do it at all the first time.
Dennis


People:
Places:
Things:
sync
Funky MP3 Car Players, and the Scripts That Load Them
Times:





Please read our Terms of Use and our Privacy Policy
Microsoft, Windows, Windows Server are either trademarks or registered trademarks of Microsoft Corporation. NetAdminTools.com is not affiliated with Microsoft Corporation. Linux is a registered trademark of Linus Torvalds, and refers to the Linux kernel. The operating system of most distributions that contain the Linux kernel is GNU/Linux. All logos and trademarks in this site are property of their respective owner. Copyright 1997-2013 NetAdminTools.com