Bug 678280

Summary: ups service start too early
Product: [Fedora] Fedora Reporter: Sandro Bonazzola <sandro.bonazzola>
Component: nutAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 14CC: mhlavink
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-26 07:03:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Sandro Bonazzola 2011-02-17 12:48:22 UTC
Description of problem:
On a LAN server under UPS, the UPS is connected using the network adapter and configured for using DHCP.
When the server starts the ups service is started with chkconfig priority 26, before any DHCP service could be started:
- dnsmasq starts with priority 49
- dhcpd starts with priority 65

In order to allow using DHCP on UPS, the dhcp service should be started before the ups service.

Version-Release number of selected component (if applicable):
dnsmasq-2.52-1.fc13.i686
nut-2.6.0-1.fc14.i686
dhcp-4.2.0-19.P2.fc14.i686


Actual results:
ups service start and fails contacting the ups because its IP address is not yes assigned

Expected results:
ups service start and doesn't fail contacting the ups.

Comment 1 Michal Hlavinka 2012-03-26 07:03:20 UTC
Fedora 14 is no longer supported.
If you want to get this working in Fedora 15+, you have to create new file /etc/systemd/system/nut-driver.service and put there:
.include /lib/systemd/system/nut-driver.service
[Unit]
After=dhcpd.service

What it does:
- user configuration goes to /etc/systemd prefix, compared with rpm shipped files, that goes to /lib/systemd (Fedora 15, 16) or /usr/lib/systemd (Fedora 17+).
- it includes content of original service file
- in section [Unit] it adds option After=dhcpd.service
-> compared with original configuration, your nut driver will start after dhcpd service (if dhcpd service is not configurat to start on boot, it will start immediately without starting dhcpd). The /etc/systemd/* configuration won't get overwritten during rpm update.