Results 1 to 8 of 8
  1.    #1  
    I'm trying to convince upstart on my Pre3 to start a cron instance after each device start, but no success.
    As I noticed, on the Pre3 (webOS 2.2.4) there is no crond executable (as it was on previous Pre's), only the config file is there. So I installed the cron package it from optware. I tried to modify the already given config file to make it start the cron from optware, but nothing.

    Anybody could help me with some thoughts?
    If need any config files, just ask.

    Background: I wrote a little shell script that would upload (via SCP) my saverestore folder to one of my servers, but it should be run everyday after save/restore has finished its job. This would be a marvelous job for cron. Now if I start cron from the command line, than it works untilI restart my phone. But after restart I have to remember to start it again, otherways my backups are just resting on my phone.
  2. #2  
    Try to start it from /etc/rc.local

    I don't know if WebOS uses this file, but till now all Unix/Linux systems I saw, do so.
  3. #3  
    I had to create an init script and put it in the proper /etc/init.rc* directory.
    Did you know:

    webOS ran on a Treo 800 during initial development.
  4.    #4  
    @nichtwirklich: there is no /etc/rc.local on webOS.

    @dkirker: Would you mind sharing your init script with us? I tried using the already available one from the optware package, but it seems its not working.
  5. #5  
    Quote Originally Posted by tylla View Post
    @nichtwirklich: there is no /etc/rc.local on webOS.

    @dkirker: Would you mind sharing your init script with us? I tried using the already available one from the optware package, but it seems its not working.
    novaterm -> touch /etc/rc.local

    now you have one

    I think 70:30 that webos will use a existing rc.local file
  6. #6  
    Quote Originally Posted by tylla View Post
    @nichtwirklich: there is no /etc/rc.local on webOS.

    @dkirker: Would you mind sharing your init script with us? I tried using the already available one from the optware package, but it seems its not working.
    /etc/init.d/cron

    Quote Originally Posted by /etc/init.d/cron
    #!/bin/sh
    #
    # Startup script for cron
    #
    # Stop myself if running

    set -e

    PIDFILE=/opt/var/run/cron.pid

    mountwait()
    {
    cronresult=`mount 2>/dev/null | grep opt`
    while [ "$cronresult" == "" ]
    do
    sleep 15
    cronresult=`mount 2>/dev/null | grep opt`
    done
    }

    stop()
    {
    mountwait

    echo "Stopping cron"
    if [ -e ${PIDFILE} ]
    then
    kill `cat ${PIDFILE}`
    sleep 3
    if [ -e ${PIDFILE} ]
    then
    rm ${PIDFILE}
    fi
    fi
    }

    start()
    {
    mountwait

    echo "Starting cron"
    /opt/sbin/cron
    }

    restart()
    {
    stop
    sleep 2
    start
    }

    case $1 in
    start)
    start
    ;;
    stop)
    stop
    ;;
    restart)
    restart
    ;;
    esac

    exit 0

    Then use this command to enable on start:

    update-rc.d cron defaults

    Then just use this to edit:

    crontab -e
    Did you know:

    webOS ran on a Treo 800 during initial development.
  7.    #7  
    Thanks guys for the informations.

    Currently I'm a little busy (getting married in a week :-) but I will come back to you and try your suggestions.

    See you.
  8.    #8  
    Back in business.

    I tried both ideas, and the results are confusing.
    /etc/rc.local doesn't get executed. I tried to simply create a new file from this one, but the new file doesn't get created.

    /etc/init.d/cron this runs on boot, but misteriously cron doesn't get started. I can create a new file from this one, but cron doesn't run.
    /opt is available I can list the directory contents...
    What am I missing? Any thoughts?

    Thanks in advance.

    Edit: I made some further modifications and it seems that the init.d script does get called but only on shutdown.
    (I simply put an echo $1 >> /cron.log and it only shows "stop" entries)
    Last edited by tylla; 11/18/2013 at 05:57 AM. Reason: Some more trials

Similar Threads

  1. OpenVPN Optware and Upstart Script
    By grasshoper in forum webOS Apps & Games
    Replies: 8
    Last Post: 09/11/2013, 11:02 AM
  2. Upstart scripts
    By knobbysideup in forum WebOS Internals
    Replies: 0
    Last Post: 09/05/2012, 11:00 AM
  3. reduce bootup time using upstart and bootchart
    By Bib in forum WebOS Internals
    Replies: 0
    Last Post: 06/06/2010, 06:47 AM
  4. Need cron help
    By jsabo in forum webOS Development
    Replies: 1
    Last Post: 06/27/2009, 06:27 PM

Tags for this Thread

Posting Permissions