Shutdown FreeNAS from jail

Status
Not open for further replies.

Alex Gerch

Cadet
Joined
May 28, 2015
Messages
4
Hi,

Can someone help me figure out how to shut down the FreeNAS host from within a Jail which is running CentOS linux (or any other distro).

The reason I am trying to shutdown FreeNAS from a Jail is because I need to install "CyberPower PowerPanel Business Edition Client" software on the FreeNAS server so that it can be remotely controlled/shutdown from the main "CyberPower PowerPanel Business Edition Agent" machine which is directly connected to the UPS with USB cable.

I had no success installing the "CyberPower PowerPanel Business Edition Client" on FreeNAS because the install has its own JRE packaged in it and this version of java is not compatible with FreeBSD...

So I created a Jail with CentOS distro, and was able to install the "CyberPower PowerPanel Business Edition client" there.
The problem is when I execute a shutdown command in the jail (connected via ssh) it seems to ignore it and no shutdown is happening for the jail and especially not the host FreeNAS.

I will be happy if I can get any one of the below options working:
1. Install the "CyberPower PowerPanel Business Edition client" in FreeNAS
2. Find a way to shutdown FreeNAS from a Jail
3. Find a way to shut FreeNAS remotely (when the other server is shutting down i will run a script initiate remote shutdown of FreeNAS)

Any suggestions will be greatly appreciated.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Easy. ssh out to the FreeNAS host and issue the command. This can be automated using ssh keys very easily, and is the normal way operations such as this are done.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Does the built-in ups/nut daemons not do what you want?
 

Alex Gerch

Cadet
Joined
May 28, 2015
Messages
4
Easy. ssh out to the FreeNAS host and issue the command. This can be automated using ssh keys very easily, and is the normal way operations such as this are done.
Thank you, that sounds like a good solution to me. I'll give it a try.
 
Last edited:

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Thanks you, that sounds like a good solution to me. I'll give it a try.

It has the benefit of actually working. ;-) Hint, though: validate that your jail can SSH into the FreeNAS host and do other commands like "ls" etc before trying to make the "shutdown -p now" work.
 

Alex Gerch

Cadet
Joined
May 28, 2015
Messages
4
Does the built-in ups/nut daemons not do what you want?
The "PowerPanel Business Edition" UPS software from Cyber Power Systems has option to install an agent on the server which is connected directly to the UPS, and a client version on other network connected servers.
The client is being controlled/shutdown from the agent over the network.
I don't see how I can use the built-in ups/nut demons to communicate with the "PowerPanel Business Edition Agent"
 

Alex Gerch

Cadet
Joined
May 28, 2015
Messages
4
It has the benefit of actually working. ;-) Hint, though: validate that your jail can SSH into the FreeNAS host and do other commands like "ls" etc before trying to make the "shutdown -p now" work.
I tried it and all works perfectly. Thanks again for the help
 

xnifex

Cadet
Joined
Aug 8, 2015
Messages
3
I tried it and all works perfectly. Thanks again for the help
care to elaborate more on how you got this done?

*edit*: never mind I figured it out. now I just need to configure the Agent/Client aspect of the UPS to be able to submit the command.

For anyone else that's reading this, you can send a command such as below to shut down the system.
ssh root@ip_of_freenas "shutdown -p now"

If you set up your user to have an ssh key & import that public key in to your root user of freenas, you can run the above command without having to supply a password. You will need to at least log in to the freenas box once in order to save the rsa key for the server.
 
Last edited:
Status
Not open for further replies.
Top