Announcement

Collapse
No announcement yet.

crontab -e only creates temporary files in tmp. it never runs

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: crontab -e only creates temporary files in tmp. it never runs

    Does this happen only when you start ktorrent via cron?
    Yes. Other ways being desktop links or KAlarm - in both cases it just opens normally.

    Does this happen with other programs if launched via cron?
    I tried Kate and Konsole launched without any text. So I closed Kate and then Konsole had the message:
    Code:
    QThreadStorage: Thread 0x98f9d70 exited after QThreadStorage 2147483636 destroyed
    -------------------------------------------------------------------------
    End of script execution. Type Enter or Ctrl+C to exit.
    ------------------------------------------------------------------------
    For kicks I tried Konsole and a second console launched with:
    Code:
    -------------------------------------------------------------------------
    End of script execution. Type Enter or Ctrl+C to exit.
    -------------------------------------------------------------------------
    ---------------------------------------------------------------------------------------------------
    You could try using this command to launch ktorrent (via cron):
    Code:
    /usr/bin/ktorrent --display :0 >> /dev/null 2>&1
    (this will send all terminal output from ktorrent to "bit heaven" (/dev/null))
    This did not change anything. Konsole launched with same message.

    I tried your last two suggestions and nothing changed. Except a zero byte ktorrent_output.txt file was created but empty in both of these cases.

    Another thing I've noticed is that if I close Konsole (after cron launched it) Ktorrent will close with it.
    If I just close Ktorrent the Konsole remains open with that 'end of script' message.

    Could I have messed up system/environment settings, paths, shell etc?
    I did add the shell/path variables manually but when I removed them nothing changed

    Here is the whole cron now:
    Code:
    #No comment
    SHELL=/bin/sh
    
    #No comment
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    
    #Min Hr DoM MoY DoW
    0 3 * * *    env DISPLAY=:0.0 /usr/bin/ktorrent > ~/ktorrent_output.txt 2>&1
    #No comment
    0 4 * * *    /usr/bin/kate --display :0
    #No comment
    0 8 * * *    /usr/bin/konsole --display :0
    
    # File generated by KCron the Tuesday 13 April 2010 12:56 pm.
    Reinstall cron?

    thx
    KDE neon LTS 5.12

    Comment


      #17
      Re: crontab -e only creates temporary files in tmp. it never runs

      Reinstall cron?
      I'm not sure this is cron's doing, but as I can't replicate the issue it's rather hard to pinpoint the problem. You're still making progress (as it happens with other programs, we've ruled out a ktorrent issue).

      You can troubleshoot further by removing cron from the equation by launching ktorrent (or another program) from a text terminal (outside your X session)...you can do this with (you might wish to write the instructions down as you can't see them in the terminal):
      1. switch to tty1 with Ctrl+Alt+F1 (see #4 for how to get back)
      2. Login with your username and password
      3. Run 'env DISPLAY=:0.0 /usr/bin/ktorrent'
      4. switch back to your X session with Ctrl+Alt+F7 (if that doesn't work, try Ctrl+Alt+F8)
      5. Check that ktorrent is running and whether konsole has also started
      6. After you're done you can log out from tty1 by switching back to it (Ctrl+Alt+F1) and running 'exit' (or press Ctrl+D)...Ctrl+Alt+F7 will again bring you back to your X session.

      Comment


        #18
        Re: crontab -e only creates temporary files in tmp. it never runs

        I followed your steps and KTorrent started nicely. No Konsole.

        does that isolate cron?
        KDE neon LTS 5.12

        Comment


          #19
          Re: crontab -e only creates temporary files in tmp. it never runs

          Does it behave better if you run
          Code:
          env DISPLAY=:0.0 /usr/bin/ktorrent &

          Comment


            #20
            Re: crontab -e only creates temporary files in tmp. it never runs

            no...
            Konsole comes up flashing an error then closes. So quickly I tried to take a screen shot but it was too fast.

            So no, but I'll try to make out the error and post again. nevertheless I don't think that helped.

            but thanks
            KDE neon LTS 5.12

            Comment


              #21
              Re: crontab -e only creates temporary files in tmp. it never runs

              Originally posted by finny388
              does that isolate cron?
              I'm starting to lean that way, but one more thing you could rule out is switching the SHELL variable from SHELL=/bin/sh to SHELL=/bin/bash in your crontab (I assume bash is your default shell...in which case /bin/bash should be the default shell for your user in crontab, but setting it explicitly will make sure of that).

              This should rule out differences in shell/environment invocation between /bin/sh (actually dash) and /bin/bash as the cause of your issue.

              Comment


                #22
                Re: crontab -e only creates temporary files in tmp. it never runs

                Same result. (here's the crontab to be sure this is what you meant:
                #No comment
                SHELL=/bin/bash

                #Min Hr DoM MoY DoW
                5 6 * * * env DISPLAY=:0.0 /usr/bin/ktorrent

                #No comment
                30 3 * * * rsync -aHuv --delete --exclude=Sys/ /home/eeepc /media/SD_BACKUP/EEE_BackUp

                # File generated by KCron the Thursday 15 April 2010 02:45 pm.
                2 things I've noted:
                1. rsync runs without starting a bash (b/c it doesn't run in x session?)
                2. If I press ctrl-c as the message asks, it errors out as follows:
                -------------------------------------------------------------------------
                End of script execution. Type Enter or Ctrl+C to exit.
                -------------------------------------------------------------------------
                ^C

                Warning: Program 'bash' crashed.
                KDE neon LTS 5.12

                Comment


                  #23
                  Re: crontab -e only creates temporary files in tmp. it never runs

                  Well, this is certainly tricky.

                  One last thing you can try is creating a script to launch ktorrent and running that script with cron:
                  1. create a script, for example /usr/local/bin/startktorrent
                  Code:
                  kdesudo kate /usr/local/bin/startktorrent
                  2. script contents:
                  #!/bin/bash
                  env DISPLAY=:0.0 /usr/bin/ktorrent & disown >> /dev/null 2>&1
                  exit 0
                  3. make the script executable:
                  Code:
                  sudo chmod 755 /usr/local/bin/startktorrent
                  4. make cron call the script instead of ktorrent directly:
                  #Min Hr DoM MoY DoW
                  5 6 * * * /usr/local/bin/startktorrent

                  Comment


                    #24
                    Re: crontab -e only creates temporary files in tmp. it never runs

                    holy crap
                    I created and ran the script and same bash message in terminal. wow.
                    and again if I close the terminal window, Ktorrent closes with it.

                    what about reinstalling? is it messy or pointless?
                    KDE neon LTS 5.12

                    Comment


                      #25
                      Re: crontab -e only creates temporary files in tmp. it never runs

                      Originally posted by finny388
                      I created and ran the script and same bash message in terminal. wow.
                      and again if I close the terminal window, Ktorrent closes with it.
                      what about reinstalling? is it messy or pointless?
                      Well, I'm certainly running out of ideas to try :P

                      Grasping at straws here, but there aren't anything funny in your /etc/profile, /etc/profile.d/* or ~/.profile (or bashrc-files while we're at it) that might run once a shell is started?

                      Anyway, I'd recommend sticking with it for a while (after all, this looks more like an annoyance than a serious problem) in case someone comes up with a solution. You may also upgrade to lucid when it's released at he end of the month and see whether that solves the issue for you (because I certainly cannot reproduce it on lucid).

                      Comment


                        #26
                        Re: crontab -e only creates temporary files in tmp. it never runs

                        /etc/profile
                        does not exist

                        ~/.profile
                        cannot find. (if it exists)

                        bashrc-files
                        cannot find

                        /etc/profile.d/*
                        1 file in this folder called gvfs-bash-completion.sh:
                        # Copyright (C) 2006-2007 Red Hat, Inc.
                        #
                        # This library is free software; you can redistribute it and/or modify
                        # it under the terms of the GNU Lesser General Public License as
                        # published by the Free Software Foundation; either version 2 of the
                        # License, or (at your option) any later version.
                        #
                        # This library is distributed in the hope that it will be useful, but
                        # WITHOUT ANY WARRANTY; without even the implied warranty of
                        # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
                        # Lesser General Public License for more details.
                        #
                        # You should have received a copy of the GNU Lesser General Public
                        # License along with this library; if not, write to the Free Software
                        # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
                        # USA.
                        #
                        # Author: David Zeuthen <davidz@redhat.com>

                        # Check for bash
                        [ -z "$BASH_VERSION" ] && return

                        ################################################## ##################################################


                        __gvfs_multiple_uris() {
                        local IFS=$'\n'
                        local cur="${COMP_WORDS[COMP_CWORD]}"

                        COMPREPLY=($(compgen -W '$(gvfs-ls --show-completions "$cur")' -- ""))

                        # don't misbehave on colons; See item E13 at http://tiswww.case.edu/php/chet/bash/FAQ
                        # We handle this locally be extracting any BLAH: prefix and removing it from the result.
                        # Not great, but better than globally changing COMP_WORDBREAKS

                        case "$cur" in
                        *:*)
                        case "$COMP_WORDBREAKS" in
                        *:*) colon_prefix=$(echo $cur | sed 's/:[^:]*$/:/' )
                        COMPREPLY=${COMPREPLY##${colon_prefix}}
                        ;;
                        esac
                        ;;
                        esac
                        }

                        ################################################## ##################################################

                        complete -o nospace -F __gvfs_multiple_uris gvfs-ls
                        complete -o nospace -F __gvfs_multiple_uris gvfs-info
                        complete -o nospace -F __gvfs_multiple_uris gvfs-cat
                        complete -o nospace -F __gvfs_multiple_uris gvfs-less
                        complete -o nospace -F __gvfs_multiple_uris gvfs-copy
                        complete -o nospace -F __gvfs_multiple_uris gvfs-mkdir
                        complete -o nospace -F __gvfs_multiple_uris gvfs-monitor-dir
                        complete -o nospace -F __gvfs_multiple_uris gvfs-monitor-file
                        complete -o nospace -F __gvfs_multiple_uris gvfs-move
                        complete -o nospace -F __gvfs_multiple_uris gvfs-open
                        complete -o nospace -F __gvfs_multiple_uris gvfs-rm
                        complete -o nospace -F __gvfs_multiple_uris gvfs-save
                        complete -o nospace -F __gvfs_multiple_uris gvfs-trash
                        complete -o nospace -F __gvfs_multiple_uris gvfs-tree
                        Lucid is coming soon and may do the trick
                        by the way, is it recommended to fresh iinstall 10.04 or upgrade?
                        KDE neon LTS 5.12

                        Comment


                          #27
                          Re: crontab -e only creates temporary files in tmp. it never runs

                          Originally posted by finny388
                          bashrc-files
                          cannot find
                          Nothing with:
                          Code:
                          locate bashrc
                          ?

                          If you still want to try something new, you could create a new user, log in to kde with that user, and see if this user has the same issue. This would tell you if it's a system wide issue or something wrong with your user configs.

                          Lucid is coming soon and may do the trick
                          by the way, is it recommended to fresh iinstall 10.04 or upgrade?
                          Both ways have their upsides and downsides. In your case I'd lean towards reinstallation, so that you can be sure to start with a "clean slate".

                          Comment

                          Working...
                          X