[Solved] systemd does not wait for the unit to finish

My problem is described in the title. I have made a test by enabling the following unit:
[Unit]
Description=/etc/rc.local Compatibility
[Service]
Type=forking
ExecStart=/bin/sleep 1000
TimeoutSec=0
RemainAfterExit=yes
After=network.target
[Install]
WantedBy=multi-user.target
The unit is well started (a process sleep 1000 exists). But with a type=forking, systemd is supposed to hang in this case. Instead, the graphical.target is launched, systemctl list-units mention it as dead, but the display manager is started before the sleep 1000 completes. Ho can I force systemd to wait?
Last edited by olive (2015-03-16 16:49:34)

olive, now you're making even less sense. I didn't say the sleep example was stupid and I didn't question your reasons for doing/wanting this.
I suggested you add "Before=display-manager.service" and you respond "I added Before=graphical.target and it didn't change anything."
I also tried to explain why systemd has no reason to delay the display-manager.service. You could have asked for further clarification, as berbae has now done. Let's try a longer explanation.
Service startup
Services can be started in different ways, as configured with Type=. This determines when a service is considered "started" (or when the service's start-up is considered finished). When a service reaches this state (some time after being started), units that are supposed to start After= this service will be started (and no sooner).
With simple systemd has no further information about the start-up process. It launches whatever you specify in ExecStart and this is the main process that continues to run till the service stops. systemd assumes this type of service is started immediately. All the other types have some way for the process to indicate to systemd (either directly or indirectly) when it has finished starting.
Actually oneshot is also a bit special and that is where RemainAfterExit comes in. For oneshot, systemd waits for the process to exit before it starts any follow-up units (and with multiple ExecStarts I assume it waits for all of them). So that automatically leads to the scheme in berbae's last post. However, with RemainAfterExit, the unit remains active even though the process has exited, so this makes it look more like "normal" service with
begin of unit/startup ---- end of startup ------ end of unit
This is the relevant behavior for this thread. First sleep starts, then after 1000 seconds, start-up finishes and follow-up units will be started. Then either the unit dies, or (with RemainAfterExit) it stays "active".
The man page describes how "end of startup" is determined for each Type.
Targets
Targets are meant to group units together, to provide synchronization points (and replace runlevels). When you start a target, all its units will be started (in parallel if possible). The man page says:
Unless DefaultDependencies= is set to false, target units will
       implicitly complement all configured dependencies of type Wants=,
       Requires=, RequiresOverridable= with dependencies of type After= if the
       units in question also have DefaultDependencies=true.
This means that (by default) when a target is requested, all it units are started first. Only after all units have finished starting, the target itself will be started (and since the target doesn't do anything by itself, this startup is basically instantaneous). Without this dependency, the order between the target and its units is unspecified, so in theory the target could finish starting immediately while its units are still being started.
Back to olive
graphical.target has these DefaultDependencies, so it is not started until all its units (like display-manager.service) and other After= dependencies (like multi-user.target) have finished starting. Your sleep service has to be started before multi-user.target starts (again due to default target dependencies). So first display-manager and the sleep service are started and after 1000 seconds, the sleep service finishes starting and then (assuming all other dependencies were quicker) multi-user.target is started and graphical.target as well (assuming display-manager didn't need 1000 seconds).
If you want display-manager.service after the sleep service, add a Before/After line to specify that (this was your original goal and my suggestion).
olive wrote wrote:However, units that are parts of the graphical target are still launched before the graphical target become active. I am still unable to completely delay the starts of the graphical target before a specific unit completes.
It should be clear now how this works. "units that are part of the graphical target" can only mean "units that are wanted/required by the graphical target" but that is basically all the units that are started when you boot your system, because multi-user.target is a part of graphical.target. And your sleep service is a part of multi-user.target, so in fact you're saying you want to delay starting the sleep service until the sleep service completes
What you probably intended was to delay all units that are a part of graphical.target but not of multi-user.target until after the sleep service. I can't think of an easy (or even good) way to do this and this post is already too long, so I'll table that for now.

Similar Messages

  • How do I call the subvi in parallel with main VI. Main vi should not wait for the subvi

    I have a subvi which takes the parameters like port name, transmit rate, message to transmit over serial port and Start/stop flag. This subvi calls VISA write vi in a loop continuously, till the Start/Stop flag is false, to write a message to serial port at a mentioned transmit rate. This subvi will be called from another VI. Actual intension is to transmit different messages to different ports continuously and stop them when required. In this senario, please provide solution for below points:
    1. How do I call the subvi in parallel with main VI. Main vi should not wait for the subvi.
    2. How does main vi can control already running subvi in parallel to it. In the above example I would like to start the subvi from main vi when start\stop flag is true and would like to stop it when the flag is false.
    3. How do I call the subVI with one set of parameters from main vi, when same subVI is running with other set of parameters already from main vi(subvi being called in a case with different set of parameters each time when the case is called). Means, how do I keep track of reentrant subvi (different calls to same vi)from the same main vi.

    Hi Dharani24,
    Try if these are helpful,
    http://digital.ni.com/public.nsf/allkb/DB92C44E7D4D8A1B862577CB007D9C45
    http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/asynchronous_vi_calls/
    http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/reentrancy/
    Thanks
    uday,
    Please Mark the solution as accepted if your problem is solved and help author by clicking on kudoes
    Certified LabVIEW Associate Developer (CLAD) Using LV13

  • Error :Extract Structure does not exist for the table YFSP03A .

    Hi Could you please help me to solve the above mentioned problem?
    I have a requirement where i have to generate the Data Source ' 3FI_SL_FS_SI ' using the table YFSP03A .
    Using the Tcode: BW03MAST i tried to assign FI-SL to the ledger but it throwed me an error that extract structure does not exit for the table YFSP03A .The reason being that i didnot create an extract structure for the table.So i tried to create it using the Tcode: BW01,but i did not have authorisation for the Transaction and BI team also could not generate as even they were not authorized to generate extract Structures.
                          So, Please are there any other ways to generate Extract structure for the table so that i can generate the Data source? Or is there any other means of generating the Data Source? And i couldnot access the other Tcodes viz :FAGLBW03, FAGLBW01,  FAGLBW02.

    Hi Bharath,
    Goto SE11, put the name of your extract structure in Data type and click display, check the version of the structure. if it is inactive then goto RSA6 and activate your DS.
    After activation try to retransport.
    Regards,
    Durgesh.
    Edited by: Durgesh Gandewar on Jul 25, 2011 3:13 PM

  • Second tween does not wait for first to finish

    Having a little problem here and as far as I can tell it is
    just that the second tween starts before waiting for the first to
    finish. Basically on a click event it should slide out a scroll
    pane to the bottom of the screen, change the contentpath of the
    scroll pane, then slide it back up.
    with the code below it just slides up the new movie clip but
    does not slide out the old one, if i remove the code for the new
    clip to slide up the old one does do the slide out how I want it to
    look.
    how can I make a pause in between the two to wait.
    on (press) {
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    _root.mask._x = 54;
    _root.mask._y = 109.3;
    _root.scroll_pane.setMask(_root.mask);
    switch (_root.loaded_clip)
    case 2: var Slide_out:Tween = new Tween(_root.scroll_pane,
    "_y", Bounce.easeOut, _root.scroll_pane._y, 900, 3, true); break;
    _root.scroll_pane.contentPath = "Search_mc";
    var Slide_up:Tween = new Tween(_root.scroll_pane, "_y",
    Bounce.easeOut, 900, 109, 3, true);
    _root.loaded_clip = 1;
    }

    Its still not working with that code but I think I can muck
    around with it and figure it out, the slide out works on the old
    clip now but then the new one never shows up.
    The onMotionFinished was basically what I was looking for,
    think I can eventually figure it out from here, thanks for the
    info.

  • Setup.exe does not wait until the installation is done

    Hi,
    I downloaded ODAC 10.2.0.2.21 from here:
    http://download.oracle.com/otn/other/ole-oo4o/ODAC1020221.exe
    And after extracting all files, I use this command on cmd:
    setup.exe -silent -noconsole -waitforcompletion -force -responsefile <Path>
    Furthermore, I have BOOTSTRAP=FALSE on oraparam.ini but setup.exe does not wait until the installation is done.
    I only want a way to wait for the installation to complete...
    Cheers,
    Joan

    DBMS Direct wrote:
    What's the main reason you want to do a silent install for ODAC?To launch it from a bigger installer of an application which uses ODAC.

  • I have an event in my calendar that was sent by someone who does not work for the company anymore and I am reminded 2 times a week. How can I remove it?

    I have an event in my calendar that was sent by someone that does not work for the company anymore and I am reminded 2 times a week. How do I delete it?

    Tap on the event to open the event. Click the 'Edit' button in the event bubble, then press the 'Delete Event' button at the bottom of the Edit pop-up. It's a little different for events that come through Microsoft Exchange, you tap the event to bring up bubble and click the 'Details' button, and then press 'Decline' to remove the event.

  • I have an apple ID which I use to sign into icloud for my iPad and iPhone.But when I use the same ID for setting up iCloud on my Macbook it says INCORRECT ID or password, try again. I tried changing my passwords but it does not work for the macbook.

    I have an apple ID which I use to sign into icloud for my iPad and iPhone.But when I use the same ID for setting up iCloud on my Macbook it says INCORRECT ID or password, try again. I tried changing my passwords several times but it does not work for the macbook.

    You will have to provide the correct password to delete the existing account, if you have tried but are not getting the password reset email, contact Apple for assistance by going to https://expresslane.apple.com, then click More Products and Services>Apple ID>Other Apple ID Topics>Lost or forgotten Apple ID password.

  • Node id does not exist for the current application server id  on forms

    Hi,
    We have a Two node RAC setup on which Oracle e-business suite R12.0.6 is setup
    We have CP and DB on two RAC nodes and Forms and Web on two separate server(non-RAC)
    while opening oracle forms we are getting" Node id does not exist for the current application server id "
    on checking Concurrent manager logfile we founf no error, we matched Application Server id from DBC file of all the 4 nodes with application table
    Fnd_nodes... which matches ( there is no mismatch of application server id) .
    We have also tried commenting the application server id in dbc file and executed adgendbc.sh to regenarate dbc file but we are facing the same issue.
    Also tried to clear setup with fnd_conc_clone.clean setup and again executing autoconfig on db and application tier but no result yet.
    Can some one guide as to which file has this message "Node id does not exist for the current application server id "
    and what could be the reason for this.
    Help is appreciated.
    Regards,
    Milan

    I already tried the mentioned metalink note id but it did not work.What did you try exactly?
    Can u help out as from where am i getting the message "Node id does not exist for the current application server id" It is already mentioned in the doc referenced above -- From the dbc file under $FND_SECURE directory.
    i mean from which file does the above message comes.Please clean FND_NODES table as per (How to Clean Nonexistent Nodes or IP Addresses From FND_NODES [ID 260887.1]), run AutoConfig on the database tier then on the application tier and check then.
    Thanks,
    Hussein

  • Error : DB Mapping does not exist for the Host in iSetup

    Hi Experts,
    We configured iSetup for migrating data from source to target, while configuring instance mapping has been completed successfully but while extracting data from source to target is showing below error :
    Error : DB Mapping does not exist for the Host:<host name > with Two Task: TEST
    EBS Version : 12.1.1 with 11.1.0.7 DB
    OS : RHEL 5.3 x86_64
    Any idea much Appreciated .
    Thanks in advance,
    Regards,
    900076.

    900076 wrote:
    Hi Experts,
    We configured iSetup for migrating data from source to target, while configuring instance mapping has been completed successfully but while extracting data from source to target is showing below error :
    Error : DB Mapping does not exist for the Host:<host name > with Two Task: TESTIs this the complete/exact error message?
    EBS Version : 12.1.1 with 11.1.0.7 DB
    OS : RHEL 5.3 x86_64
    Any idea much Appreciated .
    http://docs.oracle.com/cd/E18727_01/doc.121/e12899/toc.htm
    http://docs.oracle.com/cd/E18727_01/doc.121/e15842/toc.htm
    Thanks,
    Hussein

  • Node id does not exist for the current application server id

    Hi gurus,
    when i start application services (adstrtal.sh) i encounter the following error: Node id does not exist for the current application server id.
    i executed the command select server_id from fnd_nodes and had the following output
    SERVER_ID
    991D192B1CFC10F2E043C0A8645210F226563381082071204628231314463687
    i also checked the .dbc files under $FND_TOP/secure, there were two HOSTNAME_SID.dbc files (IPPDDVP_VIS.dbc and ippddvp_vis.dbc) with different APPL_SERVER_ID
    ippddvp_vis.dbc == 9827D18C8C2E8816E043C0A86452881611641850934523625093287478849136
    IPPDDVP_VIS.dbc == 991D192B1CFC10F2E043C0A8645210F226563381082071204628231314463687
    Please help me out.
    thanks.

    i cleaned the FND_NODES TABLE as per metalink note 260887.1. i run autoconfig on db/apps tier. Now when i start the application, i encounter the following error:
    applmgr >./adstrtal.sh apps/apps
    You are running adstrtal.sh version 115.19
    Executing service control script:
    /dvp2/product/viscomn/admin/scripts/VIS_ippddvp/adapcctl.sh start
    script returned:
    adapcctl.sh version 115.55
    Cannot reconnect to gateway
    Cause: Application Object Library is unable to reconnect to your gateway ORACLE account after you unsuccessfully attempted to sign-on.
    Action: Check that your gateway environment variable is set correctly.
    Apache Web Server Listener is not running.
    Starting Apache Web Server Listener (dedicated HTTP) ...
    Cannot reconnect to gateway
    Cause: Application Object Library is unable to reconnect to your gateway ORACLE account after you unsuccessfully attempted to sign-on.
    Action: Check that your gateway environment variable is set correctly.
    Cannot reconnect to gateway
    Cause: Application Object Library is unable to reconnect to your gateway ORACLE account after you unsuccessfully attempted to sign-on.
    Action: Check that your gateway environment variable is set correctly.
    Apache Web Server Listener (PLSQL) is not running.
    Starting Apache Web Server Listener (dedicated PLSQL) ...
    Cannot reconnect to gateway
    Cause: Application Object Library is unable to reconnect to your gateway ORACLE account after you unsuccessfully attempted to sign-on.
    Action: Check that your gateway environment variable is set correctly.
    adapcctl.sh: exiting with status 0
    .end std out.
    .end err out.
    please what should i do next to resolve this problem.
    thanks

  • OTL Error - Hrs - Element link does not exist for the duration of the entry

    Hi,
    We had a few new people start just before xmas however when the person entering their record did it, they didn't date-track the additional assignment time information record to the start of the week (they did however correctly date-track their employee and assignment record) so when the timecard was filled in errors were thrown up.
    Since then I have gone back into the employees assignment time record, purged it and then re-created it effective from the week beginning.
    However when we try to enter time for them now using delegated self service, the following error is shown for the two days which were originally excluded from the date-tracked record:
    Hrs - Element link does not exist for the duration of the entry Cause: The link has been purged or date effectively deleted. Action: Check the effective start and end dates on the link definitions for this element. The original record should have been created from the 19th dec 2009 however was done from the 23rd by accident. I have since been in and replaced it with a record effective from the 19th.
    I have re-run the security list generation (we are using static list).
    The only thing I can find on metalink is 372086.1 which doesn't really describe the problem or help!!
    The people don't appear in the timekeeper form though which is strange. I really can't see any reason why their record isn't valid - no data is missing. Do I need to run a job to update the information or something?
    We are using 11.5.10.2
    Thankss

    Well would you believe it!? After much late night meddling around, I noticed one employee worked! There was absolutely no difference in any settings between his record and a persons who did not work. So I went into another employees record, changed his name and saved (correcting). Tried again and he worked fine! So, just by changing the employee name it seems to have worked for self service! I still cannot see them in timekeeper which is worrying however at least we can get time in for them now!
    If anyone knows why I may not be able to see them in timekeeper (even using an un-secured responsibility) then that would be a great help! :)

  • I am on a MAC Application. It has  been rejected by following reason.  This app does not check for the existence of a purchase receipt, which can prevent In-App Purchases from being correctly processed. We recommend implementing receipt validation to reso

    I am on a MAC Application.
    It has  been rejected by following reason.
    This app does not check for the existence of a purchase receipt, which can prevent In-App Purchases from being correctly processed.
    We recommend implementing receipt validation to resolve this issue.
    At a minimum, the app will need to check for the existence of an App Store receipt and exit at launch with a status of 173 if it does not exist.
    Any help ?
    Thanks in Advance.

    I am on a MAC Application.
    It has  been rejected by following reason.
    This app does not check for the existence of a purchase receipt, which can prevent In-App Purchases from being correctly processed.
    We recommend implementing receipt validation to resolve this issue.
    At a minimum, the app will need to check for the existence of an App Store receipt and exit at launch with a status of 173 if it does not exist.
    Any help ?
    Thanks in Advance.

  • API error: Element link does not exist for the duration of the entry

    I am trying to create an element using the API_PAY_ELEMENT_ENTRY.CREATE_ELEMENT_ENTRY API
    While I am able to create many elements for years this way, for one particular non-recurring element I get the following error
    ORA-20001: Element link does not exist for the duration of the entry
    Cause: The link has been purged or date effectively deleted.
    Action: Check the effective start and end dates on the link definitions for this element.
    I have checked evertything and the Link is defined far before my element entry starts and with no end date. The assignment I want to attach this element entry is perfectly eligible.
    The weirdest is that I am able to create this element entry with the values I want and the dates I want through standard User interface...
    Any idea?
    Message was edited by:
    briard

    Here are the parameters I use in my call.
    DECLARE
    L_EFFECTIVE_START_DATE DATE;
    L_EFFECTIVE_END_DATE DATE;
    L_ELEMENT_ENTRY_ID NUMBER;
    L_OBJECT_VERSION_NUMBER NUMBER;
    L_WARNING BOOLEAN;
    BEGIN
    APPS.PAY_ELEMENT_ENTRY_API.CREATE_ELEMENT_ENTRY(
    P_EFFECTIVE_DATE => TO_DATE('01-JUL-2008','DD-MON-YYYY'),
    P_BUSINESS_GROUP_ID => 1,
    P_ASSIGNMENT_ID => 122147
    P_ELEMENT_LINK_ID => 233,
    P_ENTRY_TYPE => 'E',
    P_INPUT_VALUE_ID1 => 313,
    P_ENTRY_VALUE1 => 'T',
    P_INPUT_VALUE_ID2 => 314,
    P_ENTRY_VALUE2 => '5',
    -- out params
    P_EFFECTIVE_START_DATE => L_EFFECTIVE_START_DATE,
    P_EFFECTIVE_END_DATE => L_EFFECTIVE_END_DATE,
    P_ELEMENT_ENTRY_ID => L_ELEMENT_ENTRY_ID,
    P_OBJECT_VERSION_NUMBER => L_OBJECT_VERSION_NUMBER,
    P_CREATE_WARNING => L_WARNING);
    END;
    François

  • Item Conversion to GMD YIELD TYPE does not exist for  the item/items in this Recipe/Batch.

    Item Conversion to GMD YIELD TYPE does not exist for  the item/items in this Recipe/Batch. Cannot
    scale/create batch.
    While auto shipping the above error i am getting. Please somebody help on this.
    Thanks.

    Hi,
    Could you please let us know which Oracle Product was installed and it complete 5 digit version.
    Regards,
    Prakash.

  • ORA-13605: The specified task or object Get does not exist for the current

    Dear all,
    11.1.0.6 on solaris 10
    SQL>
    SQL> DECLARE
    2 taskname varchar2(100);
    3 taskdesc varchar2(128);
    4 task_id number;
    5 object_id number;
    6 timeLimit varchar2(25);
    7 numDaysToRetain varchar2(25);
    8 objectName varchar2(100);
    9 objectType varchar2(100);
    10 BEGIN
    11 taskname := 'SEGMENTADV_8980096';
    12 taskdesc :='Get';
    13 numDaysToRetain :='30';
    14 dbms_advisor.create_task('Segment Advisor','',taskname,taskdesc,NULL);
    15 dbms_advisor.create_object(taskname, 'TABLE', 'TRPT', 'CRM_CHECK', ' ', NULL, object_id);
    16 dbms_advisor.set_task_parameter(taskname, 'RECOMMEND_ALL', 'TRUE');
    17 dbms_advisor.set_task_parameter(taskname, 'DAYS_TO_EXPIRE', numDaysToRetain);
    18 END;
    19 /
    DECLARE
    ERROR at line 1:
    ORA-13605: The specified task or object Get does not exist for the current
    user.
    ORA-06512: at "SYS.PRVT_ADVISOR", line 4766
    ORA-06512: at "SYS.PRVT_ADVISOR", line 4637
    ORA-06512: at "SYS.DBMS_ADVISOR", line 56
    ORA-06512: at line 14
    Am running the above as sys user ..
    Any idea ?
    Kai

    Hi,
    This link may help:
    ORA-13605: The specified task or object ADDM:<task number> does not exist.
    Thanks and Regards,
    Rajesh K.

Maybe you are looking for

  • Trying to use Remote app on iPad, but no remote button on itunes in PC

    ITunes on my PC does not show any Remote Icon on Tab bar or anywere else, so I can't add iTunes library to my iPad

  • I have problem using jabra BT800 and N93

    my Jabra BT800 shows onlt the number of the caller Id not the name when used with N93 despite the fact the it showed the name with other mobiles. any ideas for solving this

  • Apple not offering OSX 10.6 any more?

    I have an iMac Intel machine that is running 10.5.8. I'd like to update the OS but can't find 10.6 anywhere on Apple's site... Pretty sure my machine will run 10.6, which I need to run some new apps I need. Am I screwed?

  • PEAP authentication problems

    Hi, I configured a Cisco AP 1200 IOS with PEAP. Hereby the AP Config: aaa new-model aaa group server radius rad_eap server 192.168.4.58 auth-port 1645 acct-port 1646 aaa group server radius rad_mac aaa group server radius rad_acct aaa group server ra

  • ISE v1.2 - Endpoint abandoned EAP session and started new

    Hi. I have lots of clients that are not able to log on to both wired and wireless networks, and they always fails with these errors. 5411 Supplicant stopped responding to ISE 5440 Endpoint abandoned EAP session and started new This is with certificat