I am new to freeBSD, it is weird to me that I can't logout /neither shutdown the system.

I have sh and csh,, i man the "logout" and it says csh has logout utility so i change to csh and type logout... however, it keeps telling me it is not a login shell. What is that mean? I did login though......

another question ... i know i have to be root to shutdown and i know /sbin/shutdown -h or -r to restart the system....

But what is the command to just shut the system down? I don't need to restart...

Thanks ...

Dani AI

Generated

Quick clarification for : the "not a login shell" message simply means you started csh from inside another shell (a subshell). Each shell you launch runs as a child process; closing the inner shell(s) returns you to the login prompt. You can close them by sending EOF (Ctrl‑D) or using the shell’s built‑in quit command repeatedly. To make csh your default so it starts at login, change your account’s login‑shell entry (use the account tool or ask your admin to update /etc/passwd).

Small diagnostics you can run from your session to see what was set at login and what you’re currently running:

echo $SHELL
ps -p $$ -o comm=

On shutdown: you do need root privileges and it’s best to use the system shutdown utility so filesystems are synced and users are notified. FreeBSD distinguishes halting the OS from actually powering the machine off — that’s why halt (or the plain halt variant) can leave the box sitting with a “power down” message while the power stays on. If your machine halts but does not turn off, check ACPI/power‑management support (kernel modules or BIOS/firmware settings) and use the shutdown option that tells the hardware to power off. If you have sudo or root access, use the dedicated power‑off command or the shutdown tool with the power‑off option.

Other tips: if you switched to root with su and the environment looks like a subshell, re‑invoke it with the login flag (for a true login environment). On desktops, prefer the graphical logout/power menu — it invokes the safe shutdown sequence. See the man pages for login, chsh, su and shutdown for detailed flags and examples. Thanks to and for pointing out the halt vs power‑off distinction that caused the original confusion.

Recommended Answers

All 5 Replies

>What is that mean? I did login though...
But you didn't log in with that shell. In other words, you're running a shell within a shell, and you must exit those shells first before you can log out. So, type 'exit' to end the csh session, then type 'exit' or 'logout' to finally be brought back to the FreeBSD login screen.

>But what is the command to just shut the system down?
For shutting down a FreeBSD system, as root:

shutdown -p now

Hey There,

Just a small comment. If you have /sbin/shutdown, you can run it with -h to stop your system, also - just leave out the -r and your system should shutdown and halt.

Best wishes,

Mike

Interestingly enough, 'halt' on FreeBSD does not mean the same thing as 'halt' on a Linux system. Running shutdown -h now on a Linux system will halt the system and cut the power. However, on a FreeBSD system, 'halt' means 'halt the operating system', so if you want to cut the power as well, you must use the -p option instead. Simply using -h will leave the machine idling with the "Power down" message displayed.

Interesting, indeed. I wasn't aware of that (I guess, kind of, obviously ;) That's good to know. Just when you think you have it all figured out... right? ;)

Thanks for the clarification and apologies for my misinformed response.

Best wishes,

Mike

thx for everyone's help... i did try -h before and it didn't shutdown the system. it does the same thing as -r but halt until u tell the system to restart.. -p is the one i was looking for and not in my book.. thanks again everybody

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.