Bug 809132

Summary: RFE: run as "last" service
Product: [Fedora] Fedora Reporter: Marcela Mašláňová <mmaslano>
Component: systemdAssignee: systemd-maint
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: johannbg, metherid, mschmidt, notting, plautrba, systemd-maint
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-26 01:13:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 784611    

Description Marcela Mašláňová 2012-04-02 14:47:22 UTC
I wonder if you could add into units possibility to run service as the "last" one. The cron daemon with sysvinit was started as last, because all previous services could be run by cron. Now I don't know how to do it. 

Would it be possible to write into After=*.service ? I guess such command would be useful for admins on their servers too.

Comment 1 Michal Schmidt 2012-04-02 15:24:19 UTC
Could you describe the use case in more detail? Could give a specific example where a problem resulting from not starting cron as the last service can be demonstrated?

I doubt that ordering dependencies of the "after everything else" kind would be accepted. Lennart has written several times that a "last" service is a misguided concept (e.g.: http://lists.freedesktop.org/archives/systemd-devel/2011-March/001417.html).

Comment 2 Marcela Mašláňová 2012-04-02 18:32:40 UTC
Ok, I thought so :)

Never mind, is it better solution for my problem then put all possible services into my unit? I see the biggest problem in installation of 3rd party daemons, where I don't know their name. 

This bug was based on #807029.

Comment 3 Michal Schmidt 2012-04-03 15:32:46 UTC
One option could be to have "After=systemd-user-sessions.service" in crond.service, based on the idea that since the users could at that point login and run whatever commands they like, their cron jobs should be able to run as well.

(The explicit ordering to ypbind.service would not be needed then, because ypbind.service already declares "Before=systemd-user-session.service". Perhaps sssd.service should do that too, I don't know.)

Comment 4 Lennart Poettering 2013-07-26 01:13:31 UTC
So, I will close this now, as i think the concept is really flawed, and we really shouldn't implement anything new here. There already are a number of options that are "close enough", like ordering after multi-user.target or graphical.target or default.target, and they do not result in ambiguities when multiple services which need this are around.