I just need a command to manually shutdown of system1 from system2

You can, but you shouldn’t run shutdown/etc manually.

The middleware needs some time to take care of the bookkeeping.
I speculate here, but it could also be making sure that (among other things) any VMs are synced and shutdown before taking the whole system down. My experience from running a system with a Proxmox host is that it does something similar.

In the end, the middleware actually runs shutdown or poweroff depending on if a shutdown or reboot was requested.

So you can think of the middleware call as a wrapper.

Yes, it is. It’s actually the same command that is run when you select shutdown from the built-in TrueNAS GUI.

At least on my Supermicro servers I have these options:
grafik

“Power Off Server - Immediate” kills the power immedeately.
“Power Off Server - Orderly Shutdown” issues an shutdown command via ACPI to the system. This gets processed via ACPI and the OS, and you have a proper shutdown. Middleware should receive a signal then.
I don’t have any TN Core servers any more, only Scale, but this is almost OS and driver independent. It doesn’t need special IPMI drivers to work either.

I suspect (not having looked into it even for a minute) that selecting the orderly shutdown will generate a call that is caught by the lower levels of the OS, so likely similar to a shutdown -h now or similar.

I don’t expect the call reaches something running on such a high level as the middleware. *shrug*

I am NOT a professional, but all my TrueNAS instances have IPMI. To shut down, I log in to the TN GUI (or use TrueCommand). To boot up, I log in to IPMI and use “Power On Server”.

Got roped into a confernece so this responce may seem a bit out of sync (since there have been a few responces after) but I’ll just post it.

heh! A wrapper of a wrapper?! lol That’s a fun thought.

I hear what you’re saying but follow me a second.

lifecycle doesn’t exist in the CORE branch so I suspect the act of using the API call instead of shutdown (aka: rc.d) only exists in SCALE.

So, if I pull on the “me saying we can only use the API is a BS stance” thread. My thought process:

There seems to be a shutdown script (-i.e. with the ‘KEYWORD: shutdown’ directive) located here:

which calls the middlewear shutdown script.

So what I think now is that the stance of only using the API call is SCALE only, CORE is safe to use shutdown because rc.d will handle the shutdown and call the middleware for the database closeup stuff.

That’s the thought process that I’m actually curious about. Apparently, iX is saying that the middleware isnt and you should only use the API.

Shutdown via the GUI is using the API (obviously) which neofusion has pointed out calls the OS level shutdown (i.e., so it is safe obviously).

Boot is safe because, well, that’s boot (no one cares about boot). …I was more curious about (IPMI) “REboot” which should send a signal to the OS level shutdown process (which iX is stating that does not reach/shutdown the middleware properly).


I actually clicked the link to the honeybadger quote you gave neofusion and it was a youtube thing. Unfortunately there wasn’t any real substance to that. Sure they said “use the api because we provide a real ‘shutdown’ method.” but … so what? That doesn’t explain “which” (scale / core) or “why” (the act of/need for database gymnastics is implied, obvious, and common sense but ‘why’ is the middleware not getting time or invocation from an os level shutdown call is what I’m after).