Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1159951

Summary: [RFE] systemctl commands "add-wants" and "add-requires"
Product: Red Hat Enterprise Linux 7 Reporter: Pat Riehecky <riehecky>
Component: systemdAssignee: Lukáš Nykrýn <lnykryn>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: jscotka, lnykryn, rskvaril, systemd-maint-list
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: systemd-219-1.el7 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 15:01:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pat Riehecky 2014-11-03 17:01:21 UTC
Description of problem:
systemd 217 gained the following enhancement that would be useful for managing RHEL7 systems:

* systemctl gained two new commands "add-wants" and
"add-requires" for pulling in units from specific targets
easily

Version-Release number of selected component (if applicable):systemd-208-11.el7_0.4


How reproducible:100%


Steps to Reproduce:
1.This is a new feature backport request
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Lukáš Nykrýn 2014-11-04 09:17:41 UTC
This is planned feature for 7.2.

Comment 3 Lukáš Nykrýn 2015-04-21 13:51:10 UTC
This should be now fixed with the rebase.

Comment 5 Radka Brychtova 2015-09-08 08:42:50 UTC
in systemd-219-13.el7.x86_64

systemctl add-requires TARGET NAME 
 add param "Requires=NAME" into TARGET    

  #systemctl show testscript.service| grep Wants
    Wants=cups.service system.slice
  #systemctl add-wants testscript.service cups
  #systemctl show testscript.service| grep Wants
   Wants=cups.service system.slice


systemctl add-wants TARGET NAME
  add param "Wants=NAME" into TARGET

  #systemctl show testscript.service| grep Requires
    Requires=basic.target
  #systemctl add-requires testscript.service cups
  #systemctl show testscript.service| grep Requires
    Requires=cups.service basic.target

Comment 6 errata-xmlrpc 2015-11-19 15:01:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2092.html