Bug 691103 - can't start service in only multi-user.target
Summary: can't start service in only multi-user.target
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-26 18:33 UTC by Daniel Belton
Modified: 2011-03-28 16:43 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-28 13:23:23 UTC
Type: ---


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.