How do I install apcupsd in FreeNAS?

Status
Not open for further replies.

IonutZ

Contributor
Joined
Aug 17, 2014
Messages
108
I want to use apcupsd directly in order to shutdown the FreeNAS server. A serial cable is connected from FreeNAS box to APC UPS on /dev/cuau0. I'm having trouble using NUT with smartups so I want to give apcupsd a try.

In trying to install the latest apcupsd, I made / writable with "mount / -rw". Upon ./configure of apcupsd, I got the following error "error: C++ compiler cannot create executables".

I know that I could install apcupsd in a jail, but I don't see how running apcupsd in a jail would allow it to shutdown the FreeNAS box.

Any ideas?
 

IonutZ

Contributor
Joined
Aug 17, 2014
Messages
108
I've also tried "pkg_add -r apcupsd" but nothing happens...
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yeah, there's no way to install apcupsd on FreeNAS. You should probably investigate why NUT doesn't work. There's only a very small number of UPSes that are made by APC that aren't supported.
 

IonutZ

Contributor
Joined
Aug 17, 2014
Messages
108
Actually - there is a way, and I did it:

you mount -rw /
and then you find the latest package from the FreeBSD archive. Since I'm running 9.2.1.7, uname -a told me that it's running FreeBSD 9.2 so I went to the archive
and instead of pkg_add -r apcupsd

running:
pkg_add -r http://ftp-archive.freebsd.org/pub/...amd64/9.2-RELEASE/packages/Latest/apcupsd.tbz

will install apcupsd on FreeNAS.

Now I just have to figure out how to config rc.conf to make it run on restart.
 

DJ9

Contributor
Joined
Sep 20, 2013
Messages
183
You can just add this to rc.conf.
apcupsd_enable="YES"
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yeah.. except what you did was not recommended, in the slightest. FreeNAS doesn't have the disk space nor is it designed to let you "install" stuff.

So good luck to you!
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Two additional issues:
  1. pkg_xxx are being (might even be already) deprecated.
  2. Unsupported method and as such it will NOT be retained between upgrades so you'd have to keep doing that custom installation over and over again every time you perform an upgrade.
 

IonutZ

Contributor
Joined
Aug 17, 2014
Messages
108
@cyberjock sounds like it's a limitation of the system. But I installed FreeNAS on a 16GB thumbdrive... I'm pretty sure there's enough space for anything.

@Whattteva for what reason would a native function of FreeBSD be deprecated?
 

gpsguy

Active Member
Joined
Jan 22, 2012
Messages
4,472
Whether you install it on a 2Gb flash drive, a 16Gb thumbdrive, or a 1Tb hard disk, the amount of available disk space is the same.

The installation puts 4 fixed size partitions on the boot device. FreeNAS is designed to work as an appliance. If you want to do your own thing, use FreeBSD instead.

But I installed FreeNAS on a 16GB thumbdrive... I'm pretty sure there's enough space for anything.
 

mjws00

Guru
Joined
Jul 25, 2014
Messages
798
Take a look at the size of the partition Freenas is running on. Not much extra room. There are 4 partitions created on an install, and they don't scale with the device size. Definitely a limit of the system... but by design to fit a 2gb stick originally. The problem is of course messing with the very tight resources the system has been designed with and the ram drives it creates on boot. Easy to mess it up and lose stability and or data.

pkg replaces pkg_install It's just the latest version of the package installer. Nothing to worry about.

The upgrade issue is unavoidable, as the db maintaining your config doesn't know about anything not done in the GUI.

Unfortunately wandering from the straight and narrow has a price and risk. Tough to get help later, when the pool is unavailable.

Edit: I see someone beat me to the enter key.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
@cyberjock sounds like it's a limitation of the system. But I installed FreeNAS on a 16GB thumbdrive... I'm pretty sure there's enough space for anything.

You are incorrect. gpsguy and mjws00 covered it though, and they are correct.

FreeNAS is an appliance. If this isn't palatable then feel free to go with FreeBSD. We won't have hurt feelings. FreeNAS isn't for everyone.
 

IonutZ

Contributor
Joined
Aug 17, 2014
Messages
108
@mjws00 I understand that, but I highly doubt a 400kb driver will affect system integrity and stability - or for that matter, the effect of running apcupsd.

@cyberjock I respect the fact that you've been a member of this community for a while, and I appreciate that you're knowledgeable about the issue. Unlike you, I wasn't able to dedicate a whole month or however long it took you to learn FreeBSD (as per your powerpoint presentation which was very useful don't get me wrong) - I had prior summary knowledge of Unix from dabbling with different distros over the past decade and a half, and like you, I'm a Windows guy. I've exhausted every other option up until this point, nut doesn't work properly for me; I was recommended that I try apcupsd, and I did, and it works. Everyone tailors FreeNAS to suit their needs, and I'm just trying to do the same thing. As for anything being palatable, the tone of your reply reminds me of something that the free world had abolished in 1945.
 

mjws00

Guru
Joined
Jul 25, 2014
Messages
798
Lol. Ionutz, I've been known to stray off the reserve. My gut says you'll be fine as well. However, there is no crying over lost data. Cyber will feel bad if you lose data... I'll just smile and nod. Unfortunately the actual risk is pretty hard to evaluate. If I blow up my server I just restore and move on. Better we warn of potential risk than have people caught unawares.
 

IonutZ

Contributor
Joined
Aug 17, 2014
Messages
108
I'm aware that straying off the path can lead to lost data and it would totally suck, and it'll totally suck to have to do this every time I upgrade to a new version, but if that's what I have to do in order to get my system running nominally... it is what it is. I think apcupsd should be included in the installation of FreeNAS, it's 400kb.

Now I have to figure out how to make changes in /usr/local stick past a reboot. And thanks for the warning guys.
 

mjws00

Guru
Joined
Jul 25, 2014
Messages
798
You could throw a feature request in. Seems reasonable to me. I'd like just a little more flexibility myself without reverting to freebsd etc. Just the odd driver or utility to be available. 9.3 living on zfs gives me a little hope. You can have the simplicity of an appliance and still be a little flexible, imho.

There's always that money back guarantee. ;)
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
@Whattteva for what reason would a native function of FreeBSD be deprecated?
It's being deprecated because there's a new much more robust native tool called pkg :p (It's like apt-get for debian-based Linux distributions).
 
Status
Not open for further replies.
Top