FedoraForum.org - Fedora Support Forums and Community
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2005
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    service not finding external drive during boot

    (This is a repost from the software forum, where there were no responses)
    I am running

    Linux 3.5.0-2.fc17.i686.PAE #1 SMP Mon Jul 30 15:18:54 UTC 2012 i686 i686 i386 GNU/Linux

    and one of my services (backuppc) fails to load at boot, even though I had previously done

    systemctl enable backuppc.service
    but does load fine manually after boot:

    systemctl start backuppc.service
    Sometimes in the system log I see a message from boot-time that the service has failed to access a particular network drive (which the service does need access to).

    Is there a way to delay starting up the service until the network drive has been mounted?

  2. #2
    Join Date
    Oct 2009
    Posts
    824
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: service not finding external drive during boot

    Quote Originally Posted by normvcr
    (This is a repost from the software forum, where there were no responses)
    I am running

    Linux 3.5.0-2.fc17.i686.PAE #1 SMP Mon Jul 30 15:18:54 UTC 2012 i686 i686 i386 GNU/Linux

    and one of my services (backuppc) fails to load at boot, even though I had previously done



    but does load fine manually after boot:



    Sometimes in the system log I see a message from boot-time that the service has failed to access a particular network drive (which the service does need access to).

    Is there a way to delay starting up the service until the network drive has been mounted?
    SystemD is still experiencing growing pains. The problem is that the services are started in parallel rather than sequentially, so if your service doesn't properly check that services it depends on are fully started and everything is OK, it may try (and fail) to start prematurely.

    Now to thoughts towards a solution.
    First, there is no such concept as "network drive" in Linux. That is a wrong way of thinking about network filesystem that has polluted your mind thanks to mswondoze.

    In Linux, there is the filesystem. Other filesystems can be joined to it to make even bigger filesystems. A network filesystem can be joined to your local filesystem to appear to be a larger filesystem. One option you may have is to apply some link and mount trickery to convince backuppc that the network filesystem is available before it actually is. You may be able to create a filesystem that "looks right" to it, and then have the network filesystem mount over top of it at a later time.

    Your other option is to edit the service file for backuppc and adjust it to wait until the network filesystem has already mounted. The service file is located at /usr/lib/systemd/system/backuppc.service

    Notice the line that says "After=syslog.target"
    Look at the different service files and target files, understand how they set their dependencies, and modify backuppc.service to suit. You might want to pay attention to things like network.target and remote-fs.target

    For example, in remote-fs-pre.target, you see "After=network.target nss-lookup.target". I.e., remote filesystem mounting depends on the network being activated.
    remote-fs.target is "WantedBy=multi-user.target"
    multi-user.target "Requires=sysinit.target sockets.target" and "After=sysinit.target sockets.target".

    I think you can get the idea....
    Last edited by droidhacker; 16th August 2012 at 08:13 PM.

  3. #3
    Join Date
    Aug 2005
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SOLVED Re: service not finding external drive during boot

    droidhacker, your explanation and suggestion worked right off.
    My backuppc.service file now starts with

    [Unit]
    Description= BackupPC server
    After=syslog.target remote-fs.target
    This change only added the remote-fs.target as a service to wait for, and backuppc was
    loaded after the next boot, automatically.

    Thanks!
    Last edited by normvcr; 17th August 2012 at 12:25 AM. Reason: Add SOLVED

Similar Threads

  1. Service not finding external drive
    By normvcr in forum Using Fedora
    Replies: 0
    Last Post: 9th August 2012, 12:10 AM
  2. External porable USB drive won't boot F16
    By jrw1234 in forum Installation, Upgrades and Live Media
    Replies: 6
    Last Post: 18th March 2012, 12:04 AM
  3. How to boot from external USB drive?
    By mandreiana in forum Installation, Upgrades and Live Media
    Replies: 0
    Last Post: 26th June 2009, 07:04 AM
  4. GRUB not finding my sata drive to boot windows
    By storlied in forum Using Fedora
    Replies: 3
    Last Post: 22nd February 2006, 06:52 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •