News for hackers. Stuff that matters.
Re:Got called to a professor’s office after a complaint his ... by schoen on Tuesday July 25, 2023 @01:34AM (#36858350)
Somehow I've never considered what will happen on Unix if pid 1 exits!

Even though I'm pretty sure I've run with init=/bin/sh and then typed "exit" at some point in my single-user session, I have absolutely no recollection of the results. I should try it on a few OSes and see!

Re:Got called to a professor’s office after a complaint his ... by suid on Tuesday July 25, 2023 @02:03AM (#36858533)
If PID 1 exits, the system usually panics immediately and restarts.
Re:Got called to a professor’s office after a complaint his ... by rzzzt on Tuesday July 25, 2023 @02:24AM (#36858662)
Re:Got called to a professor’s office after a complaint his ... by rollcat on Tuesday July 25, 2023 @05:30AM (#36859935)
"...and that's why we have to put half a million lines of C in PID 1"
Re:Got called to a professor’s office after a complaint his ... by NikkiA on Tuesday July 25, 2023 @02:00PM (#36866625)
i'm reasonably sure that kill -1 1 used to be a canonical way to `halt`
Re:Got called to a professor’s office after a complaint his ... by mcguire on Tuesday July 25, 2023 @03:41PM (#36868210)
I used to work with a long-time AIX kernel developer. His method of shutting off his machine was "sync; sync; kill -9 1".

Of course, his method of preparing to move offices (a common occurrence at IBM) was to

1. Take his (RS-6000) workstation home with him the night of the move.

2. Otherwise, just lock his desk.

He didn't have anything in his office but his chair, desk, and workstation.

Re:Got called to a professor’s office after a complaint his ... by BrandoElFollito on Wednesday July 26, 2023 @11:50AM (#36879752)
As a random trivia about sysadmins: the reason he sync-ed twice is not because "twice is better than once, just to make sure".

Sync is not synchronous. When it is back to the shell there is no guarantee that data in memory is fully copied to disk.

However, it sets a flag that is reset when the copying is done. Sync will hang if the flag is set.

So the first sync arms the copy and sets the flag and is back to the shell.

The second sync starts, blocks at the flag. The flag gets reset and it is back to the shell.

So the 2nd sync going back to the shell is a guarantee that the first sync is fine and data is safe

Re:Got called to a professor’s office after a complaint his ... by olddustytrail on Tuesday July 25, 2023 @02:54PM (#36867530)
I'm pretty sure psdoom warns you against killing init
Re:Got called to a professor’s office after a complaint his ... by dredmorbius on Wednesday July 26, 2023 @10:27PM (#36888145)
Heck, you wrote an init on bash with the LNX-BBC (at least in some versions of it).