The two YaST Software Applications apcupsd & apcupsd-gui are used to monitor your APC branded UPS in Linux and can, among other things, do an orderly shut down of your PC on an extended power failure. apcupd/apcupsd-gui application versions 3.14.10 or higher should be used to get this program working properly. The apcupsd application gapcmon has been fully converted to work with systemd in openSUSE 12.3. You no longer use the YaST Run Level editor to set the service to operate.
The proper sequence of events to get this APC UPS application working properly are as follows:
- Connect your APC branded and supported UPS to your Linux PC, preferably by USB, but serial is also supported.
- Using YaST / Software / Software Management, search for apcupsd & apcupsd-gui and install them from YaST as normal.
- Edit the /etc/apcupsd/apcupsd.conf file as root. You can use an application such as my SYSEdit bash script to make these changes for a usb connection:
UPSCABLE **usb**
UPSTYPE **usb**
DEVICE
SYSEdit - System File Editor - Version 1.50: https://forums.opensuse.org/blogs/jdmcdaniel3/sysedit-system-file-editor-version-1-00-60/
- Open up a terminal session and type in the following command:
sudo /bin/systemctl enable /usr/lib/systemd/system/apcupsd.service
sudo /bin/systemctl start apcupsd.service
-
To Autostart in KDE, I normally goto menu / Configure Desktop / Startup & Shutdown / Autostart / Add Program / Search to / System / Monitor / APCUPSD Monitor and Press OK.
-
Start the APCUPSD Monitor manually and on the Preference Tab / Click Add and check Enabled and Use Icon Tray.
-
Restart Your PC and you should be set.
Once apcupsd is working, you should see the following icons in your (KDE) System Tray. You get a plug icon per UPS monitored when this is more than one UPS and only one UPS labeled icon :

When you hover your mouse pointer over the plug, you get this:

The Plug when selected offers up this screen:
The UPS icon is used to configure your UPS monitor after it gets installed:
And as you can see, there are even more options and selections to see.
Online Resources: http://www.apcupsd.com/ & http://gapcmon.sourceforge.net/
Thank You for using openSUSE,
This problem has been reported as bug 801312.
It is easier to add a symbolic link
/sbin/apcupsd → /usr/sbin/apcupsd
[QUOTE=nrickert;bt694]This problem has been reported as bug 801312.
It is easier to add a symbolic link
/sbin/apcupsd → /usr/sbin/apcupsd[/QUOTE]
Let me say it is best that the service file be fixed in the repository file so no kludges are required. Hopefully it will be fixed soon.
Thank You,
apcupsd & apcupsd-gui 3.14.10 has fixed the problem and so I have converted this blog to a short tutorial on installing apcupsd.
Thank You,
jdmcdaniel3
I tried setting up apcmon via your instructions
but I got the following dialog. I can’t connect to the UPS
from APCUPSD monitor so I assume it’s not started.
How to proceed?
"flamebait@fuuyuu:~> sudo /bin/systemctl enable /usr/lib/systemd/system/apcupsd.service
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
root’s password:
ln -s ‘/usr/lib/systemd/system/apcupsd.service’ ‘/etc/systemd/system/multi-user.target.wants/apcupsd.service’
flamebait@fuuyuu:~> sudo /bin/systemctl start apcupsd.service"
[QUOTE=FlameBait;bt805]jdmcdaniel3
I tried setting up apcmon via your instructions
but I got the following dialog. I can’t connect to the UPS
from APCUPSD monitor so I assume it’s not started.
How to proceed?
"flamebait@fuuyuu:~> sudo /bin/systemctl enable /usr/lib/systemd/system/apcupsd.service
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
root’s password:
ln -s ‘/usr/lib/systemd/system/apcupsd.service’ ‘/etc/systemd/system/multi-user.target.wants/apcupsd.service’
flamebait@fuuyuu:~> sudo /bin/systemctl start apcupsd.service"[/QUOTE]
I would open up terminal and try these two commands to see what you get:
**cat /usr/lib/systemd/system/apcupsd.service**
[Unit]
Description=APC UPS Power Control Daemon for Linux
After=syslog.target
After=network.target
[Service]
ExecStartPre=-/bin/rm -f /etc/apcupsd/powerfail
ExecStart=/usr/sbin/apcupsd -b -f /etc/apcupsd/apcupsd.conf
[Install]
WantedBy=multi-user.target
**/bin/systemctl status apcupsd.service**
apcupsd.service - APC UPS Power Control Daemon for Linux
Loaded: loaded (/usr/lib/systemd/system/apcupsd.service; enabled)
Active: **active (running)** since Wed, 2013-05-08 20:26:10 CDT; 1 day and 20h ago
Process: 1319 ExecStartPre=/bin/rm -f /etc/apcupsd/powerfail (code=exited, status=0/SUCCESS)
Main PID: 1325 (apcupsd)
CGroup: name=systemd:/system/apcupsd.service
└ 1325 /usr/sbin/apcupsd -b -f /etc/apcupsd/apcupsd.conf
Post your results here if either is different.
Thank You,
I must have my configuration in apcupsd.conf wrong.
Not sure about the code tags I hope they work
flamebait@fuuyuu:~> cat /usr/lib/systemd/system/apcupsd.service
[Unit]
Description=APC UPS Power Control Daemon for Linux
After=syslog.target
After=network.target
[Service]
ExecStartPre=-/bin/rm -f /etc/apcupsd/powerfail
ExecStart=/usr/sbin/apcupsd -b -f /etc/apcupsd/apcupsd.conf
[Install]
WantedBy=multi-user.target
flamebait@fuuyuu:~> /bin/systemctl status apcupsd.service
apcupsd.service - APC UPS Power Control Daemon for Linux
Loaded: loaded (/usr/lib/systemd/system/apcupsd.service; enabled)
Active: failed (Result: exit-code) since Fri, 2013-05-10 12:37:59 PDT; 18h ago
Process: 1172 ExecStart=/usr/sbin/apcupsd -b -f /etc/apcupsd/apcupsd.conf (code=exited, status=1/FAILURE)
Process: 1141 ExecStartPre=/bin/rm -f /etc/apcupsd/powerfail (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/apcupsd.service
I got it playing. By changing the DEVICE setting to blank.
DEVICE <BLANK>
It’s working on a clean install of 12.3 now.
[QUOTE=FlameBait;bt811]I got it playing. By changing the DEVICE setting to blank.
DEVICE <BLANK>
It’s working on a clean install of 12.3 now.[/QUOTE]
Yes, when editing the /etc/apcupsd/apcupsd.conf file, for USB to work you must set the following values:
UPSCABLE **usb**
UPSTYPE **usb**
DEVICE
I did show this in the first code # in the blog post.
Thank You,
James:
Suse 12.2 x64, KDE. For a long while apcupsd worked fine then it stopped loading on startup. In desktop autostart it was disabled. Enabled it and now it starts 2 instances. Beats me what is causing it to do that. I have deleted the autostart entry and created a new one with the same problem. I tried your method here of browsing to system monitor and this method also starts 2 instances.
I must have edited a file long ago to have it start but beats me which one I edited, and that doesn’t explain why it doesn’t start at all on some of my bootups.
Any suggestions?
Thanks, jon
[QUOTE=6520302;bt857]James:
Suse 12.2 x64, KDE. For a long while apcupsd worked fine then it stopped loading on startup. In desktop autostart it was disabled. Enabled it and now it starts 2 instances. Beats me what is causing it to do that. I have deleted the autostart entry and created a new one with the same problem. I tried your method here of browsing to system monitor and this method also starts 2 instances.
I must have edited a file long ago to have it start but beats me which one I edited, and that doesn’t explain why it doesn’t start at all on some of my bootups.
Any suggestions?
Thanks, jon[/QUOTE]
Well, the issue is if you don’t start with an empty session, the APC UPS monitor gets started automatically and so if you also set it to start automatically, you can get two copies. The problem I found was that without an autostart link, it did not always get started automatically so I do two things.
- On Login, start with an empty session:
http://paste.opensuse.org/view/download/14057625
- Then, let the APC monitor be loaded automatically:
http://paste.opensuse.org/view/download/91214582
This is what I do.
Thank You,
James:
My settings were to restore session. I have changed that and will soon find out how that goes. I suspect empty session was indeed the problem. Not sure if this change will impact other things but I suspect it will all be fine.
Thanks!!
jon
Holy Cow! Where would all us dummies be without you? !?!?
It always seems when I just can’t figure out something, I do a search and there you are with the step by step answer! Udaman!
Thanks! Thanks so much! (again)
Bart
[QUOTE=montana_suse_user;bt908]Holy Cow! Where would all us dummies be without you? !?!?
It always seems when I just can’t figure out something, I do a search and there you are with the step by step answer! Udaman!
Thanks! Thanks so much! (again)
Bart[/QUOTE]
You are very welcome Bart and thanks for your kind words.
Thank You,