Bug 691103

Summary: can't start service in only multi-user.target
Product: [Fedora] Fedora Reporter: Daniel Belton <danielbelton>
Component: systemdAssignee: Lennart Poettering <lpoetter>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: johannbg, lpoetter, metherid, mschmidt, notting, plautrba
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: 2011-03-28 13:23:23 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 Daniel Belton 2011-03-26 18:33:53 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Daniel Belton 2011-03-26 18:37:30 UTC
I am trying to have services that start in multi-user.target without being started by graphical.target.

In other words, I want services to start in the old runlevel 3 but not start in the old runlevel 5. 

If services are started in multi-user.target (old runlevel 3) then they will get started by graphical.target (old runlevel 5) as well.

Comment 2 Michal Schmidt 2011-03-26 20:19:01 UTC
You can define your own target, pull in multi-user.target (add "Requires=multi-user.target" and "After=multi-user.target") and then pull additional services using links in /etc/systemd/system/$YOUROWN.target.wants/.
Would that do what you want?

Comment 3 Daniel Belton 2011-03-26 23:01:22 UTC
anything added to multi-user.target would also be pulled in by graphical.target. 

So, what you are saying might work If I created a new target, have it pull in multi-user.target but put the services I want added in the new target. 

I believe I would then need to set the new target I create as the new default as well by using:

ln -sf /lib/systemd/system/new.target /etc/systemd/system/default.target

or specify it on the kernel line if I didn't want to change the default.

Comment 4 Daniel Belton 2011-03-28 13:23:23 UTC
Am going to mark this as closed since systemd seems to work as designed in this case. 

There is a work-around to accomplish what I wish to do as mentioned above, even if you have to do something totally strange to get it done.

Comment 5 Bill Nottingham 2011-03-28 16:43:41 UTC
You may also be able to, for a service 'foo' that you don't want to start in graphical target, do:

ln -s /dev/null /etc/systemd/system/graphical.target.wants/foo.service.