[SOLVED] systemd service not starting

Hi,
Been using Arch for just over a week now moving from Ubuntu and loving it. Achieved so much more on Arch in this short time until this evening.
I am trying to run a shell script at startup. I added the service file under /etc/systemd/system/myapp.service
With the following content:
[Unit]
Description=Notification
[Service]
ExecStart=/usr/bin/myscript
[Install]
WantedBy=multi-user.target
As it is I can run "systemctl restart myapp.service" and the script execute flawlessly however on reboot it does nothing and I get this error when I run systemctl status myapp.service:
systemctl status myapp.service
myapp.service - Notification
   Loaded: loaded (/etc/systemd/system/myapp.service; enabled)
   Active: failed (Result: exit-code) since Thu 1970-01-01 10:00:08 EST; 14s ago
  Process: 116 ExecStart=/usr/bin/myscript (code=exited, status=6)
Other info:
Script starts with #!/bin/sh
Script permissions 755
Tried adding After=network.target under unit.
Tried Type=oneshot and forking
O yes /var/log/messages.log | grep myapp
Sep  6 14:25:56 alarm systemd[1]: [/etc/systemd/system/myapp.service:1] Unknown section 'unit'. Ignoring.
Sep  6 14:25:56 alarm systemd[1]: [/etc/systemd/system/myapp.service:2] Assignment outside of section. Ignoring.
Jan  1 01:00:11 alarm systemd[1]: myapp.service: main process exited, code=exited, status=6/NOTCONFIGURED
Jan  1 01:00:11 alarm systemd[1]: Unit myapp.service entered failed state.
Jan  1 01:00:11 alarm [    3.243318] systemd[1]: [/etc/systemd/system/myapp.service:1] Unknown section 'unit'. Ignoring.
Jan  1 01:00:11 alarm [    3.243490] systemd[1]: [/etc/systemd/system/myapp.service:2] Assignment outside of section. Ignoring.
Only thing I dont get is the date difference? I have set the timezone correctly..
Any suggestions?
thanks
Last edited by blueteq (2013-09-10 10:01:11)

Reaching the network.target does not necessarily mean that an active connection has been reached.  For example, if you use wicd or netctl-auto, it will report the stating of the service as successful after the daemon itself has started, but starting the daemon simply means that it is ready to start scanning for wireless networks and then connect.
If you want to be absolutely sure that there is a network connection before the service starts, you should use NetworkManager.service.  That will also pull in the NetworkManager-wait-online.service which will not complete until a full connection has been reached.  At that point the startup will have reached the network-online.target.  So you should order the service after that instead.  In reality, you should order it after that anyway, no matter what netowrk connection service you use, as that is a built in target to systemd.
Even though you have the RestartSec=35 and Restart=on-failure (which is a sane thing to do IMO), it is probably a good idea to order it After=netowrk-online.target anyway, as that will cause the service to start a bit later and at least attempt to order itself correctly.  That way it will also ensure that the service is stopped before the network is taken down as well, hopefully ensuring a clean disconnect as well.

Similar Messages

  • [solved] systemd services not starting at boot (or at all)

    On my router, some systemd services fail to start at boot.
    The services are :
    adsl (pppoe connetction on the wan interface)
    shorewall (funny again for a router)
    logind (brings up only tty1, and not the others with a 'timeout' error)
    adsl starts fine manually after booting up
    the others don't work, I have to launch shorewall with the old sysvinit rc script (and it works)
    I really don't know, what happened to logind...
    Last edited by scar (2012-11-30 10:20:44)

    cups: avahi client failed
    adsl: timeout (ppp0 running on eth0, the service did not found eth0)
    shorewall: did not work by the systemctl command, only with the old rc script
    I'm not sure if there was an error with logind, but I've had only tty1, not all the others (I have not touched /etc/inittab)
    since this was a very old install (but up to date), I've decided to reinstall the whole thing,
    Everything works
    (But reinstalling does not solve any problem, it erases the problems...)
    Last edited by scar (2012-11-30 10:21:20)

  • [SOLVED] Netcfg.service not starting with systemd

    I have net-auto-wireless.service enabled and working, but when I try to start netcfg.service, it gives the error:
    Job for netcfg.service failed. See 'systemctl status netcfg.service' and 'journalctl' for details.
    "systemctl status netcfg.service" gives me:
    netcfg.service - Netcfg multi-profile daemon
    Loaded: loaded (/usr/lib/systemd/system/netcfg.service; enabled)
    Active: failed (Result: exit-code) since Thu, 04 Oct 2012 13:43:05 -0400; 5min ago
    Main PID: 1510 (code=exited, status=1/FAILURE)
    CGroup: name=systemd:/system/netcfg.service
    Oct 04 13:43:05 arch systemd[1]: Starting Netcfg multi-profile daemon...
    Oct 04 13:43:05 arch netcfg-daemon[1510]: No recorded netcfg state to restore
    Oct 04 13:43:05 arch systemd[1]: Failed to start Netcfg multi-profile daemon.
    And the output of "journalctl" is:
    Oct 04 13:43:05 arch netcfg-daemon[1510]: No recorded netcfg state to restore
    Oct 04 13:43:05 arch systemd[1]: netcfg.service: main process exited, code=...=1
    Oct 04 13:43:05 arch systemd[1]: Unit netcfg.service entered failed state.
    Am I missing something in setting it up?  I followed the netcfg wiki as closely as I could.
    Last edited by mellowmaroon (2012-10-04 18:46:16)

    Good call, I changed it from "last", to the profile I use in /etc/network.d that net-auto-wireless autoconnects to.  It failed for a different reason after changing the NETWORKS in /etc/conf.d/netcfg, because net-auto-wireless was still running.
    But it works now, thanks for the help!
    I wanted to use netcfg instead of net-auto-wireless because I was unable to find a suitable way to connect to available networks that is non-graphical, and I felt like giving netcfg a try and seeing if it's any easier than running "systemctl restart net-auto-wireless.service" every time I want to reconnect.
    Although my question for this thread is solved, is there any way to have netcfg autoconnect to profiles once I am within range?

  • Apple mobile device service not started

    Each time i try to sync my iphone to itunes it keeps on saying "apple mobile device service not started"
    I know how to start it and everything its that when i start it it says "Windows could nt start the Aplle Mobile Device service on local computer"
    I have the newest itunes and i have windows 7

    first I would check the event viewer for into about what goes wrong that cause the service to fail
    if this don't give a clear image about what the problem is
    then I would uninstall itunes and resinstall it
    if that didn't help I would ask questions about solve the problem in the itunes for windows forum  where people wise in the ways of itunes would be more likely to read your post
    https://discussions.apple.com/community/itunes/itunes_for_windows

  • SAP Service Not Starting in BI 7.0

    Hi All,
    Today morning my BI 7.0 server restarted twice automatically, then I started the server in last known good configuration after that when I tried to start the server from SAP MMC it didn't started and when i checked the sap service in services.msc it gives error <b>"Some services stop automatically when they have no work to do"</b>.and didn't get started.
    I found a thread similiar to this problem and following that I used sapstartsrv.exe in usr\sap\SID\......\exe directory. This didn't worked for me and by using this Both the services SAPEP2_00 and SAPEP2_01 got removed from services.msc.
    Now I have installed these service again and now I am at same status as in morning,
    In Event log
    For SAPEP2_00 and SAPEP2_01 the following error are avaliable:
    --Initialization failed. Service not started. [ntservmain.cpp 1269]
    --Unable to change to Directory
    gms40\saploc\EP2\DVEBMGS00\work. (Error 53 ERROR_BAD_NETPATH: The network path was not found. ) [ntservstart.cpp 966]
    If any one have gone through such situation please help me out from this, Its has became too critical for me now.
    Thanks in advance....
    Regards
    Vinay Paul

    Hi
    Service are started now but when I am trying to start the server, it is showing strdbs.cmd, sapcpe.exe in red status "could not be started".
    Regards
    Vinay Paul
    Message was edited by:
            Vinay Paul

  • Remote Desktop Management service not starting. service-specific error: %%2284126209 - Event ID: 7024

    Hi Forum members,
    We have a client that has intermittent issues with RDS on a 2012 R2 server.
    As an overview of the environment, the client has a single VMWare host support 2 x Windows 2012 R2 VMs one is the File/Print/Email server and the 2nd is the RDS server used to allow the client to run MYOB Enterprise. Both servers have the AD DS role and
    DNS roles amongst others.
    The 1st issue is that the RD Connection Broker shows the error: "The server pool does not match the RD Connection Brokers that are in it. and then "1. Cannot connect to any of the specified RD Connection Broker servers".
    The above issue seems to be caused by the RDMS service not starting. When you attempt to start it, the service stops and the error in the title is logged in the "System" event log. Full transcript below:
    Log Name:      System
    Source:        Service Control Manager
    Date:          21/01/2015 4:50:32 PM
    Event ID:      7024
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      intentionally removed.local
    Description:
    The Remote Desktop Management service terminated with the following service-specific error: %%2284126209
    Event Xml:
    <Event xmlns="
      <System>
        <Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" />
        <EventID Qualifiers="49152">7024</EventID>
        <Version>0</Version>
        <Level>2</Level>
        <Task>0</Task>
        <Opcode>0</Opcode>
        <Keywords>0x8080000000000000</Keywords>
        <TimeCreated SystemTime="2015-01-21T05:50:32.129949400Z" />
        <EventRecordID>53721</EventRecordID>
        <Correlation />
        <Execution ProcessID="568" ThreadID="12436" />
        <Channel>System</Channel>
        <Computer> intentionally removed.local</Computer>
        <Security />
      </System>
      <EventData>
        <Data Name="param1">Remote Desktop Management</Data>
        <Data Name="param2">%%2284126209</Data>
        <Binary>520044004D0053000000</Binary>
      </EventData>
    </Event>
    In addition in the "Application" event log, the following error is logged:
    Log Name:      Application
    Source:        MSSQL$MICROSOFT##WID
    Date:          21/01/2015 5:24:47 PM
    Event ID:      18456
    Task Category: Logon
    Level:         Information
    Keywords:      Classic,Audit Failure
    User:          NETWORK SERVICE
    Computer:      intentionally removed.local
    Description:
    Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. Reason: Could not find a login matching the name provided. [CLIENT: <named pipe>]
    Event Xml:
    <Event xmlns="
      <System>
        <Provider Name="MSSQL$MICROSOFT##WID" />
        <EventID Qualifiers="49152">18456</EventID>
        <Level>0</Level>
        <Task>4</Task>
        <Keywords>0x90000000000000</Keywords>
        <TimeCreated SystemTime="2015-01-21T06:24:47.000000000Z" />
        <EventRecordID>4228336</EventRecordID>
        <Channel>Application</Channel>
        <Computer>intentionally removed.local</Computer>
        <Security UserID="S-1-5-20" />
      </System>
      <EventData>
        <Data>NT AUTHORITY\NETWORK SERVICE</Data>
        <Data> Reason: Could not find a login matching the name provided.</Data>
        <Data> [CLIENT: &lt;named pipe&gt;]</Data>
        <Binary>184800000E0000001F00000055004E0047004500520045005200410055005300530056005200300033005C004D004900430052004F0053004F0046005400230023005700490044000000070000006D00610073007400650072000000</Binary>
      </EventData>
    </Event>
    I have been attempting to resolve these errors for some time, without success. I have read the many KBs and forum entries related to the above and applied a number of the suggested fixes, including the one which suggests to add the NT SERVICE\ALL SERVICES
    to the "Logon as a Service" in the "User Rights Assignment" of the "Default Domain Policy" which is linked to the domain level, that both servers are objects of.
    My question to the forum is, can anyone come up with a solution to resolve the above issues and all the RDMS service to start which will then hopefully resolve the broker error?
    Regards,
    David West.

    Hi David,
    If virtual machines on the server are Windows Server 2012, then it is not supported to install Remote Desktop Connection Broker on a Domain Controller.
    More information for you:
    Remote Desktop Services role cannot co-exist with AD DS role on Windows Server 2012
    http://support.microsoft.com/kb/2799605/de
    Guidelines for installing the Remote Desktop Session Host role service on a computer running Windows Server 2012 without the Remote Desktop Connection Broker role service
    http://support.microsoft.com/kb/2833839
    If the VMs are Windows Server 2012 R2, I suggest you install RDS on a separate machine to see if the issue persists.
    Best Regards,
    Amy
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Apple mobile device service not started please help

    Each time i try to sync my iphone to itunes it keeps on saying "apple mobile device service not started"
    I know how to start it and everything its that when i start it it says "Windows could nt start the Aplle Mobile Device service on local computer"
    I have the newest itunes and i have windows 7

    when i start it it says "Windows could nt start the Aplle Mobile Device service on local computer"
    Does Windows give you an error code number when AMDS fails to start, Love? If so what number do you you get?

  • Oracle distributed document capture service not started

    Oracle distributed document capture service not started
    and timeout

    I did check the Distributed Document Capture Configuration (from the Start menu) and it also indicates that I have selected "Oracle Distributed Document Capture Prompted Login". Once I click "OK" after I supplied all the paths required by server settings, it also displays the error "The username and password could not be validated". What credentials should be entered in the User ID / Password / Domain fields? You should use the username and password entered while configuring the "capture" security model. Leave the domain field blank.
    I have not yet configured the IIS at this point. Is it required for the Capture application to authenticate the user I specified during the installation configuration at login? IIS will serve web ODDC interface and will be needed for authentication while accessing ODDC web pages. I beleive that it is not needed for authentication from ODC/ODDC applets. However, when something is not working as expected, I would first finish all required installation and especially post installation setup steps.
    I had a look at the IIS configuration in the installation document. It doesn't clearly state which document is the default document for the website one needs to create in IIS. Do you know what it should be? You have to add new web site, say like "Capture" and add virtual directory from assumed path like: C:\Program Files\Oracle\Document Capture\WebPages
    For the default document I have WebCapture.asp.
    The Oracle Distributed Document Capture service does no start on my PC. Is this required for me to atleast login to the Capture application? It's required only for processing the scanned batches.
    I hope that this will help.
    Boris
    Edited by: tombo on 2012.03.16 06:32

  • Critical Services Not Starting Automatically & Access to Server occasionally dropping out

    For the last few months we have been trying to resolve an issue where access to files on the server (SBS2011 - running domain services, exchange, etc) get so slow or just unresponsive. Logging onto the server is also not possible till it starts responding
    again.
    We also found that when the server starts, the Netlogon services does not start automatically event though it is set to auto start. There are a number of other services mainly exchange services that do not start as well but it seems this may be due to the
    net service not starting.
    We have re-installed the OS but this does not seem to have fixed the issue. The environment is a mix of the SBS2011 server, two Windows Server 2003 boxes - one running Terminal Services. The other was being used for SAP but no longer in use. The clients
    are mainly XP with a few Windows 7 machines. We are in the process of planning the replacement of the XP machines.

    You re-installed SBS2011? - that seems rather drastic.  Did you maintain your domain or just set it all up again?
    This sounds like a DNS issue but have a look at the event viewer and google/post the Event ID and Source.  Given those two you can start to track down the cause and possible fixes at www.eventid.net.  Just be aware that SBS2011 has a lot of
    "normal" event errors, see http://support.microsoft.com/kb/2483007
    You should also run the SBS best practice analyzer and maybe run the "Fix my network" wizard in the SBS console.  Also make sure SBS is the DHCP server for the network.
    -- Al

  • I have updated itunes but now phone and ipod will not connect to pc - message reads apple mobile device service not started

    i have updated itunes and cannot connect devices - apple mobile device service not started?

    Hello there, mikemason5.
    The following Knowledge Base article provides some great troubleshooting recommendations:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • EPMA server service not started

    Hi All,
    I installed Hyperion 11.1.2.2 Essbase, Planning, EPMA, Calculation Manager, FDM and HFM in the single machine in windows server 2008 R2.
    but i am facing two issues.
    1. In services, EPMA Server service not started.
    2. In FDM, I am getting error in connecting to Essbase.
    Error: Unable to retrieve target system data.
    Is any thing, i have to install additionally?
    Regards,
    mady

    Hi,
    In Windows Event Viewer i got this message.
    Log Name: System
    Source: Service Control Manager
    Date: 9/3/2012 12:46:12 AM
    Event ID: 7011
    Task Category: None
    Level: Error
    Keywords: Classic
    User: N/A
    Computer: hyperionepm
    Description:
    A timeout (30000 milliseconds) was reached while waiting for a transaction response from the Parallels Tools Service service.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
    <Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" />
    <EventID Qualifiers="49152">7011</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8080000000000000</Keywords>
    <TimeCreated SystemTime="2012-09-03T07:46:12.612304600Z" />
    <EventRecordID>70587</EventRecordID>
    <Correlation />
    <Execution ProcessID="440" ThreadID="16540" />
    <Channel>System</Channel>
    <Computer>hyperionepm</Computer>
    <Security />
    </System>
    <EventData>
    <Data Name="param1">30000</Data>
    <Data Name="param2">Parallels Tools Service</Data>
    </EventData>
    </Event>

  • Fix for Apple Mobile Device Services not starting

    Finally a fix for Apple Mobile Device Services not starting. Basically I got this from someone else in these forums and it worked. Go to C:\Documents and Settings\AllUsers\Application Data\Apple and delete any file in there that says Apple Mobile Device Services (I understand these are cached files...I had about 8 files to delete). Next go to your control panel, click on Add/Delete programs, find Apple Mobile Device Support and delete (remove) it. Once this is all done do not reboot, rather open itunes and go to Help menu /Check for Updates and update to the latest version. This will install the latest version of iTunes and also a new version of Apple Mobile Device Services. Next reboot and it should work for many of you...it did for me. Open iTunes and plug in your device...good luck. I wrote this from memory so if some of the phrases don't match exactly what you see I apologize. Also, this worked for me on a Windows XP computer.

    Thanks for posting this, my iTunes randomly started saying the Apple Mobile Device was stopped, and apple's solutions didn't help. I hope this one will, but what do I do if I have the latest iTunes, so it doesn't update? Wait till they come out with an update? It says I need to run the iTunes installer, but I can't find that. Please help, this is really annoying me...=(

  • Hello, my iphone for several times shows me this message "this iphone can't be used because the Apple Mobile Device service not started". I need help because i'm enable do download the new update. Thanks

    Hello, my iphone for several times shows me this message "this iphone can't be used because the Apple Mobile Device service not started".
    I need help, because i'm enable do download the new update.
    Thanks

    Type "Apple Mobile Device service" into the search bar at the top of this age by "Support" and read the resulting help articles.

  • When trying to sync my iPad to iTunes, I get the message that iPad cannot be used as the Apple Mobile Device Service not started.

    When trying to sync my iPad to iTunes, I get the message that iPad cannot be used because Apple Mobile Device Service not started.

    If you are on a PC then there are instructions here for starting it http://support.apple.com/kb/TS1567 . If you are on a Mac then see this page http://support.apple.com/kb/HT1747

  • I am unable to update to IOS5 from Itunes, says "mobile device services not started". What is this and how do I fix it?

    I am unable to update to IOS5 from Itunes, says "mobile device services not started". What is this and how do I fix it?

    Here is a YouTube video which should guide you through a solution:  http://www.youtube.com/watch?v=VLFAo-FWLxE

Maybe you are looking for

  • Is it possible to digitally sign a jar file that will be used to install CF in WebSphere?

    I am currently working for a contractor for the DoD. We are maintaining a project that uses CF installed as an application through WebSphere. We are currently going through a security checklist and being asked to provide evidence that the CF applicat

  • A funny bug with the pair Numbers + AppleScript

    *Bug ID# 7973914* Summary: Trying to delete rows in a Numbers table thru AppleScript issue an erroneous error. Steps to Reproduce: Create a new Numbers document and run this script : set t_name to "testIfEmpty" tell application "Numbers" to tell docu

  • Using Router for wireless dial-up connection

    Can anyone tell me if I can use a router to set up a wireless network when I only have a dial-up internet connection available? I have a desktop computer that seems not to have a wireless network card, so I guess I have to have that first.  Then, do

  • Query Execution is very slow through Froms

    Hello Friends I am facing a problem with D2k Forms. when a run a Query through SQL its execution speed is very fast. the same Query when i run through Forms, like create basetable block and set_block_property and execute it is very slow. How do i ove

  • Filling the Sales Order Header - Source for filling the dropdown boxes

    Hi, I am trying to design the User Interface for Creation of sales order using the WebDynpro's. I want to know, what are all those BAPI's i need to use to fill the following drop down boxes. 1. Order Type 2. Sales Organization 3. Distribution Channel