Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
"shutdown now" from shell and it ask for /bin/sh on the console
« previous
next »
Print
Pages: [
1
]
Author
Topic: "shutdown now" from shell and it ask for /bin/sh on the console (Read 1885 times)
iorx
Jr. Member
Posts: 58
Karma: 3
"shutdown now" from shell and it ask for /bin/sh on the console
«
on:
March 15, 2022, 09:19:33 pm »
Hi all!
Corrupt install or something with last version? (I've toyed around a bit with this install...)
See attached pic.
Logged
meyergru
Hero Member
Posts: 1685
Karma: 165
IT Aficionado
Re: "shutdown now" from shell and it ask for /bin/sh on the console
«
Reply #1 on:
March 15, 2022, 09:46:50 pm »
And I thought I was dumb, I saw this too the other day.
Logged
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005
1100 down / 440 up
,
Bufferbloat A+
franco
Administrator
Hero Member
Posts: 17661
Karma: 1611
Re: "shutdown now" from shell and it ask for /bin/sh on the console
«
Reply #2 on:
March 16, 2022, 10:26:41 am »
Don't use "shutdown now" manually. Use
# opnsense-shell halt
or
# yes | opnsense-shell halt
if you are in a hurry.
Cheers,
Franco
Logged
franco
Administrator
Hero Member
Posts: 17661
Karma: 1611
Re: "shutdown now" from shell and it ask for /bin/sh on the console
«
Reply #3 on:
March 16, 2022, 10:31:30 am »
PS:
https://www.freebsd.org/cgi/man.cgi?shutdown(8)
"When run without options, the shutdown utility will place the system into single user mode at the time specified."
Looks like it's working. ;)
«
Last Edit: March 16, 2022, 10:33:19 am by franco
»
Logged
iorx
Jr. Member
Posts: 58
Karma: 3
Re: "shutdown now" from shell and it ask for /bin/sh on the console
«
Reply #4 on:
March 17, 2022, 08:44:43 am »
And again he strikes (me) Captain Can't Google for Shit aka Major BSD Inexperience. Salud!
So indeed works as designed! I usually go with "shutdown -r now", but was toying around with an educational install here in Hyper-V, and... had the idea that without the "-r" it would shutdown and power off nicely (as I think linux does, another VM guest running DietPi goes into power off ... confirmed).
Read the man, -p:
So using "-p" is not recommended? The right way is "opnsense-shell halt"
Have a nice day!
Logged
franco
Administrator
Hero Member
Posts: 17661
Karma: 1611
Re: "shutdown now" from shell and it ask for /bin/sh on the console
«
Reply #5 on:
March 17, 2022, 09:07:50 am »
The official halt script is:
https://github.com/opnsense/core/blob/master/src/etc/rc.halt
That is what "opnsense-shell halt" is calling.
Yes, it does use "shutdown -op now", but it also covers tasks not covered by OS itself:
https://github.com/opnsense/core/tree/master/src/etc/rc.syshook.d/stop
"reboot" action is very similar in this matter.
Cheers,
Franco
Logged
meyergru
Hero Member
Posts: 1685
Karma: 165
IT Aficionado
Re: "shutdown now" from shell and it ask for /bin/sh on the console
«
Reply #6 on:
March 17, 2022, 06:33:07 pm »
Yup, I had it for "reboot"... way to much Linux experience, I guess. Not all OSes are the same...
Logged
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005
1100 down / 440 up
,
Bufferbloat A+
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
"shutdown now" from shell and it ask for /bin/sh on the console