FedoraForum.org - Fedora Support Forums and Community
Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2007
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A script to restart amule on exit (crash)?

    Since I have not yet the knowledge to write a custom script I ask the following:

    can you give me a (sh) script to restart amule on exit (crash)?


    This I ask you because amule crashes often on my system.

    I already filed out a bug report at the amule website.

    --kmarien

  2. #2
    Join Date
    May 2005
    Location
    UK
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try the following:

    #!/bin/bash
    #
    # Bash script to make sure amule is running every 15 minutes.
    #
    export DISPLAY=:0
    /usr/bin/amule;

    i=0;

    while i=0;
    do sleep 600; /usr/bin/amule > /dev/null 2>&1;
    done;
    Registered Linux User #221895

  3. #3
    Join Date
    Dec 2007
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice script!

    Only sometimes when amule crashes there is a pop up to save the bug report (gnome). Is there a way to disable those pop ups? Or a way to workaround this in the script?

    If the pop up comes, amule is not yet completely shut down until I close the pop up and so amule won't restart with the script because it is still running but not functioning.

  4. #4
    Join Date
    May 2005
    Location
    UK
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, you need to remove gnome bug buddy.
    Registered Linux User #221895

  5. #5
    stevea Guest
    Remove bug buddy ... Yeah and cut off your nose too if it gets in your way. I don't think there is much to recommend this sort of solution. The initial script tries to restart amule every 10 minutes whether it's running or not. At least use 'pgrep' to test if it's running. A better approach is to launch the process in the background "amule &" and then sleep on the SIGCHILD signal. Can all be done from a script, but the iniit program already does this. So you could just make up an init script for amule.

    Backing up a step - you are looking for a bandaid solution to the amule crash problem. Please report the error at
    bugzilla.redhat.com (it's for fedora too). I'm no mule expert but isn't ther a non-gui veriosn. Like "amulecmd" that does the same in a command line environment. This might solve the crash problem, but would certainly allow better control for scripting.

  6. #6
    Join Date
    Dec 2007
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK stevea,

    if you know how to write a better script I love to see it. I appreciate any help with this problem.

    Also I will file a bug report at bugzilla on next crash.

  7. #7
    stevea Guest
    Code:
    #!/bin/bash
    export DISPLAY=:0
    
    while true;
    do
       [ ! $(pgrep amule) ] && /usr/bin/amule > /dev/null 2>&1
    done
    Then start the script in the background "strict &".

    I don't have the time or inclination to study amulecmd for a shell-friendly approach. That's what google and the man pages are for.

  8. #8
    Join Date
    Dec 2007
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks,

    just a little question about this script:

    what file extension do I have to give it

    and how do I use "strict &"

    Thanks in advance.

Similar Threads

  1. FC10 Crash on Restart and reboot
    By kw1502 in forum Using Fedora
    Replies: 0
    Last Post: 4th May 2009, 03:00 PM
  2. dhclient-exit-hooks not starting script
    By ocgltd in forum Servers & Networking
    Replies: 0
    Last Post: 4th September 2006, 04:19 AM
  3. shell script ... exit status testing
    By teethlikelions in forum Programming & Packaging
    Replies: 1
    Last Post: 3rd March 2006, 02:49 AM
  4. How to exit shell script if error occurs in pipeline
    By greenrd in forum Programming & Packaging
    Replies: 4
    Last Post: 21st June 2004, 09:14 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
  •